#ifndef _PHYSICS_H_ #define _PHYSICS_H_ #include "object.h" #include "math.h" class physics : public object { public: physics(); explicit physics(const physics&); // Use explicit to avoid implicit conversion ~physics(); XMVECTOR GetGravity() const; // Get the gravity value void SetGravity(XMVECTOR gravity); // Define the gravity value void ApplyGravity(object*, float); // Apply gravity to an object void AddForce(object*, XMVECTOR); bool IsColliding(object*, object*); bool CubesOverlap(object*, object*); bool SpheresOverlap(object*, object*); bool SphereCubeOverlap(object*, object*); private: XMVECTOR m_gravity; }; #endif