-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhysicsContact.h
70 lines (56 loc) · 1.78 KB
/
PhysicsContact.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef PHYSICS_RT_PHYSICSCONTACT_H
#define PHYSICS_RT_PHYSICSCONTACT_H
#include "CKBehavior.h"
#include "ivu_types.hxx"
#include "ivu_vector.hxx"
#include "ivu_linear.hxx"
#include "ivp_listener_collision.hxx"
class CKIpionManager;
class PhysicsObject;
class PhysicsContactManager;
class PhysicsContactData
{
public:
struct GroupOutput
{
CKBOOL active = FALSE;
int number = 0;
};
PhysicsContactData(float timeDelayStart, float timeDelayEnd, PhysicsContactManager *man, CKBehavior *beh);
~PhysicsContactData();
float m_TimeDelayStart;
float m_TimeDelayEnd;
PhysicsContactManager *m_Manager;
CKBehavior *m_Behavior;
GroupOutput *m_GroupOutputs;
IVP_Listener_Collision *m_Listener;
};
struct PhysicsContactRecord
{
IVP_Time m_Time;
int m_Index;
PhysicsObject *m_PhysicsObject;
PhysicsContactRecord(IVP_Time time, int index, PhysicsObject *obj)
: m_Time(time), m_Index(index), m_PhysicsObject(obj) {}
};
class PhysicsContactManager
{
public:
explicit PhysicsContactManager(CKIpionManager *man)
: m_IpionManager(man), m_NumberGroupOutput(50), m_ContactIDAttribType(0) {}
void Process(IVP_Time time);
int GetRecordCount() const;
PhysicsContactRecord *GetRecord(int index);
void AddRecord(PhysicsObject *obj, int index, IVP_Time time);
void RemoveRecord(int index);
void RemoveRecord(PhysicsObject *obj);
void RemoveRecord(PhysicsObject *obj, int index);
void SetupContactID();
int GetContactID(CK3dEntity *entity) const;
int GetNumberGroupOutput() const { return m_NumberGroupOutput; }
int m_NumberGroupOutput;
IVP_U_Vector<PhysicsContactRecord> m_Records;
CKIpionManager *m_IpionManager;
int m_ContactIDAttribType;
};
#endif // PHYSICS_RT_PHYSICSCONTACT_H