-
Notifications
You must be signed in to change notification settings - Fork 98
/
Physics_MotionController.h
43 lines (32 loc) · 1.23 KB
/
Physics_MotionController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef PHYSICS_MOTIONCONTROLLER_H
#define PHYSICS_MOTIONCONTROLLER_H
#if defined(_MSC_VER) || (defined(__GNUC__) && __GNUC__ > 3)
#pragma once
#endif
#include "IController.h"
#include "Physics_Object.h"
class CPhysicsEnvironment;
class CPhysicsMotionController : public IController, public IPhysicsMotionController, public IObjectEventListener
{
public:
CPhysicsMotionController(IMotionEvent *pHandler, CPhysicsEnvironment *pEnv);
~CPhysicsMotionController();
void SetEventHandler(IMotionEvent *handler);
void AttachObject(IPhysicsObject *pObject, bool checkIfAlreadyAttached);
void DetachObject(IPhysicsObject *pObject);
int CountObjects();
void GetObjects(IPhysicsObject **pObjectList);
void ClearObjects();
void WakeObjects();
void SetPriority(priority_t priority);
public:
void Tick(float deltaTime);
void ObjectDestroyed(CPhysicsObject *pObject);
private:
IMotionEvent * m_handler;
CUtlVector<CPhysicsObject *> m_objectList;
CPhysicsEnvironment * m_pEnv;
int m_priority;
};
IPhysicsMotionController *CreateMotionController(CPhysicsEnvironment *pEnv, IMotionEvent *pHandler);
#endif // PHYSICS_MOTIONCONTROLLER_H