StratiX0 291afe9424 Ajout collision semi fonctionnelle entre 2 spheres
feat:
+ collision entre 2 spheres, fonctionne a moitie, overlap entre les 2
2024-04-24 12:59:40 +02:00

26 lines
642 B
C++

#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, float); // Apply gravity to an object
void AddForce(Object*, XMVECTOR);
bool IsColliding(Object*, Object*);
bool CubesOverlap(Object*, Object*);
bool SpheresOverlap(Object*, Object*);
private:
XMVECTOR m_gravity;
};
#endif