28 #ifndef HPL_CHARACTER_BODY_H 29 #define HPL_CHARACTER_BODY_H 31 #include "hpl1/engine/math/MathTypes.h" 32 #include "hpl1/engine/physics/PhysicsWorld.h" 99 float mfMaxGravitySpeed;
103 bool mbCollideCharacter;
107 float mfMaxPosMoveSpeed[2];
108 float mfMaxNegMoveSpeed[2];
109 float mfMoveSpeed[2];
111 float mfMoveDeacc[2];
132 int mlEntitySmoothPosNum;
134 float mfMaxStepHeight;
135 float mfStepClimbSpeed;
136 float mfClimbForwardMul;
137 float mfClimbHeightAdd;
140 float mfGroundFriction;
148 virtual int GetSaveCreatePrio();
155 friend class cSaveData_iCharacterBody;
162 const tString &GetName() {
return msName; }
168 void SetMass(
float afMass);
170 void SetActive(
bool abX);
171 bool IsActive() {
return mbActive; }
175 void SetCollideCharacter(
bool abX);
176 bool GetCollideCharacter() {
return mbCollideCharacter; }
178 void SetTestCollision(
bool abX) { mbTestCollision = abX; }
179 bool GetTestCollision() {
return mbTestCollision; }
181 void SetMaxPositiveMoveSpeed(eCharDir aDir,
float afX);
182 float GetMaxPositiveMoveSpeed(eCharDir aDir);
183 void SetMaxNegativeMoveSpeed(eCharDir aDir,
float afX);
184 float GetMaxNegativeMoveSpeed(eCharDir aDir);
186 void SetMoveSpeed(eCharDir aDir,
float afX);
187 float GetMoveSpeed(eCharDir aDir);
188 void SetMoveAcc(eCharDir aDir,
float afX);
189 float GetMoveAcc(eCharDir aDir);
190 void SetMoveDeacc(eCharDir aDir,
float afX);
191 float GetMoveDeacc(eCharDir aDir);
193 cVector3f GetVelocity(
float afFrameTime);
195 void SetPosition(
const cVector3f &avPos,
bool abSmooth =
false);
198 void SetFeetPosition(
const cVector3f &avPos,
bool abSmooth =
false);
201 void SetYaw(
float afX);
202 void AddYaw(
float afX);
204 void SetPitch(
float afX);
205 void AddPitch(
float afX);
214 void SetGravityActive(
bool abX);
215 bool GravityIsActive();
216 void SetMaxGravitySpeed(
float afX);
217 float GetMaxGravitySpeed();
219 bool GetCustomGravityActive();
220 void SetCustomGravityActive(
bool abX);
221 void SetCustomGravity(
const cVector3f &avCustomGravity);
224 void SetMaxPushMass(
float afX) { mfMaxPushMass = afX; }
225 void SetPushForce(
float afX) { mfPushForce = afX; }
226 float GetMaxPushMass() {
return mfMaxPushMass; }
227 float GetPushForce() {
return mfPushForce; }
229 bool GetPushIn2D() {
return mbPushIn2D; }
230 void SetPushIn2D(
bool abX) { mbPushIn2D = abX; }
232 void AddForceVelocity(
const cVector3f &avVel) { mvVelolcity += avVel; }
233 void SetForceVelocity(
const cVector3f &avVel) { mvVelolcity = avVel; }
234 cVector3f GetForceVelocity() {
return mvVelolcity; }
236 int AddExtraSize(
const cVector3f &avSize);
237 void SetActiveSize(
int alNum);
245 void Move(eCharDir aDir,
float afMul,
float afTimeStep);
247 void Update(
float afTimeStep);
253 void SetCameraPosAdd(
const cVector3f &avAdd);
255 void SetCameraSmoothPosNum(
int alNum) { mlCameraSmoothPosNum = alNum; }
256 int GetCameraSmoothPosNum() {
return mlCameraSmoothPosNum; }
261 void SetEntityOffset(
const cMatrixf &a_mtxOffset);
264 void SetEntityPostOffset(
const cMatrixf &a_mtxOffset);
265 const cMatrixf &GetEntityPostOffset();
267 void SetEntitySmoothPosNum(
int alNum) { mlEntitySmoothPosNum = alNum; }
268 int GetEntitySmoothPosNum() {
return mlEntitySmoothPosNum; }
270 void SetUserData(
void *apUserData) { mpUserData = apUserData; }
271 void *GetUserData() {
return mpUserData; }
275 void SetEnableNearbyBodies(
bool abX) { mbEnableNearbyBodies = abX; }
276 bool GetEnableNearbyBodies() {
return mbEnableNearbyBodies; }
281 iPhysicsBody *GetExtraBody(
size_t alIdx) {
return mvExtraBodies[alIdx]; }
285 float GetMaxStepSize() {
return mfMaxStepHeight; }
286 void SetMaxStepSize(
float afSize) { mfMaxStepHeight = afSize; }
288 void SetStepClimbSpeed(
float afX) { mfStepClimbSpeed = afX; }
289 float GetStepClimbSpeed() {
return mfStepClimbSpeed; }
291 void SetAccurateClimbing(
bool abX) { mbAccurateClimbing = abX; }
292 bool GetAccurateClimbing() {
return mbAccurateClimbing; }
294 void SetClimbForwardMul(
float afX) { mfClimbForwardMul = afX; }
295 float GetClimbForwardMul() {
return mfClimbForwardMul; }
297 void SetClimbHeightAdd(
float afX) { mfClimbHeightAdd = afX; }
298 float GetClimbHeightAdd() {
return mfClimbHeightAdd; }
300 void SetGroundFriction(
float afX) { mfGroundFriction = afX; }
301 float GetGroundFriction() {
return mfGroundFriction; }
303 void SetAirFriction(
float afX) { mfAirFriction = afX; }
304 float GetAirFriction() {
return mfAirFriction; }
306 bool IsClimbing() {
return mbClimbing; }
309 iPhysicsBody *GetAttachedBody() {
return mpAttachedBody; }
312 void UpdateMoveMarix();
317 void UpdateAttachment();
321 virtual void SaveToSaveData(
iSaveData *apSaveData);
322 virtual void LoadFromSaveData(
iSaveData *apSaveData);
332 bool mbCollideCharacter;
334 bool mbTestCollision;
336 bool mbGravityActive;
337 float mfMaxGravitySpeed;
338 bool mbCustomGravity;
344 float mfMaxPosMoveSpeed[2];
345 float mfMaxNegMoveSpeed[2];
347 float mfMoveSpeed[2];
349 float mfMoveDeacc[2];
361 float mfCheckStepClimbCount;
362 float mfCheckStepClimbInterval;
373 int mlCameraSmoothPosNum;
379 int mlEntitySmoothPosNum;
382 float mfGroundFriction;
389 bool mbAttachmentJustAdded;
398 float mfMaxStepHeight;
399 float mfStepClimbSpeed;
400 float mfClimbForwardMul;
401 float mfClimbHeightAdd;
403 bool mbAccurateClimbing;
405 bool mbEnableNearbyBodies;
415 #endif // HPL_CHARACTER_BODY_H
Definition: PhysicsWorld.h:92
Definition: PhysicsWorld.h:100
Definition: CharacterBody.h:72
Definition: PhysicsWorld.h:115
Definition: CharacterBody.h:83
Definition: CharacterBody.h:59
Definition: SaveGame.h:130
Definition: CollideShape.h:50
Definition: PhysicsBody.h:117
Definition: SaveGame.h:111
Definition: CollideData.h:46
Definition: Container.h:219
Definition: CharacterBody.h:153
Definition: Entity3D.h:81
Definition: SaveGame.h:183
Definition: PhysicsWorld.h:107
Definition: Camera3D.h:53
Definition: CharacterBody.h:49