
implementation de l'acceleration, de la masse (je sais pas si c'est une bonne facon de faire mais on va dire oui) mouvements avec un code tres sale dans application class frame
23 lines
532 B
C++
23 lines
532 B
C++
#ifndef _PHYSICS_H_
|
|
#define _PHYSICS_H_
|
|
|
|
#include "object.h"
|
|
|
|
class Physics : public Object
|
|
{
|
|
public:
|
|
Physics();
|
|
explicit Physics(const Physics&); // Use explicit to avoid implicit conversion
|
|
~Physics();
|
|
|
|
XMVECTOR GetGravity(); // Get the gravity value
|
|
void SetGravity(XMVECTOR gravity); // Define the gravity value
|
|
void ApplyGravity(Object*, float); // Apply gravity to an object
|
|
void ApplyDrag(Object*, float, float);
|
|
void ApplyForce(Object*, XMVECTOR);
|
|
|
|
private:
|
|
XMVECTOR m_gravity;
|
|
};
|
|
|
|
#endif |