-
Notifications
You must be signed in to change notification settings - Fork 3
/
CharacterPhysicsSupport.h
104 lines (93 loc) · 7.97 KB
/
CharacterPhysicsSupport.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef CHARACTER_PHYSICS_SUPPORT
#define CHARACTER_PHYSICS_SUPPORT
#include "alife_space.h"
#include "PHSkeleton.h"
#include "Entity_Alive.h"
#include "PHDestroyable.h"
class CPhysicsShell;
class CPHMovementControl;
class CCharacterPhysicsSupport :
public CPHSkeleton,
public CPHDestroyable
{
public:
enum EType
{
etActor,
etStalker,
etBitting
};
enum EState
{
esDead,
esAlive
};
private:
EType m_eType;
EState m_eState;
CEntityAlive &m_EntityAlife ;
Fmatrix &mXFORM ;
CPhysicsShell *&m_pPhysicsShell ;
CPhysicsShell *m_physics_skeleton ;
CPHMovementControl &m_PhysicMovementControl ;
//skeleton
float skel_airr_lin_factor ;
float skel_airr_ang_factor ;
float hinge_force_factor1 ;
float skel_fatal_impulse_factor ;
int skel_ddelay ;
bool b_death_anim_on ;
bool b_skeleton_in_shell ;
float m_saved_impulse ;
Fvector m_saved_hit_position ;
Fvector m_saved_hit_dir ;
s16 m_saved_element ;
ALife::EHitType m_saved_hit_type ;
float m_shot_up_factor ;
float m_after_death_velocity_factor ;
public:
EType Type()
{
return m_eType;
}
EState STate()
{
return m_eState;
}
void SetState(EState astate)
{
m_eState=astate;
}
IC bool isDead()
{
return m_eState==esDead;
}
IC bool isAlive()
{
return !m_pPhysicsShell;
}
protected:
virtual void SpawnInitPhysics (CSE_Abstract *D) ;
virtual CPhysicsShellHolder* PPhysicsShellHolder () {return m_EntityAlife.PhysicsShellHolder();}
public:
void Deactivate () ;
void Activate () ;
void Clear () ;
void Allocate () ;
void in_UpdateCL() ;
void in_shedule_Update ( u32 DT ) ;
void in_NetSpawn (CSE_Abstract* e) ;
void in_NetDestroy () ;
void in_Init () ;
void in_Load (LPCSTR section) ;
void in_Hit (float P,Fvector &dir, s16 element,Fvector p_in_object_space, float impulse,ALife::EHitType hit_type ,bool is_killing=false);
void in_NetSave (NET_Packet& P) ;
CCharacterPhysicsSupport& operator = (CCharacterPhysicsSupport& ){R_ASSERT2(false,"Can not assign it");}
CCharacterPhysicsSupport (EType atype,CEntityAlive* aentity) ;
virtual ~CCharacterPhysicsSupport () ;
private:
void CreateSkeleton (CPhysicsShell* &pShell) ;
void CreateSkeleton ();
void ActivateShell () ;
};
#endif //CHARACTER_PHYSICS_SUPPORT