31 #include "hpl1/engine/math/MathTypes.h" 33 #include "common/list.h" 34 #include "hpl1/engine/scene/Entity2D.h" 35 #include "common/stablemap.h" 42 class cCollisionMesh2D;
54 const cRect2f &GetBoundingBox();
55 bool UpdateBoundingBox();
57 void Move(
float afValue);
59 void UpdateLogic(
float afTimeStep);
61 tString GetEntityType() {
return "Body"; };
63 cVector3f &GetPosition() {
return mvPosition; }
64 cVector3f &GetLastPosition() {
return mvLastPosition; }
65 void ResetLastPosition() { mvLastPosition = mvPosition; }
68 float GetMaxVelocity() {
return mfMaxVel; }
69 float GetAcceleration() {
return mfAcc; }
70 float GetGravity() {
return mfGravity; }
71 float GetMaxGravityVel() {
return mfMaxGravityVel; }
72 bool GetCollidable() {
return mbCollidable; }
73 bool GetCollides() {
return mbCollides; }
74 float GetAirFriction() {
return mfAirFriction; }
75 float GetGroundFriction() {
return mfGroundFriction; }
76 const cVector2f &GetSize() {
return mvSize; }
78 const cVector3f &GetMovement() {
return mvMovement; }
80 void SetMaxVelocity(
float afMaxVel) { mfMaxVel = afMaxVel; }
81 void SetAcceleration(
float afAcc) { mfAcc = afAcc; }
82 void SetGravity(
float afGravity) { mfGravity = afGravity; }
83 void SetMaxGravityVel(
float afMaxGravityVel) { mfMaxGravityVel = afMaxGravityVel; }
84 void SetCollidable(
bool abCollidable) { mbCollidable = abCollidable; }
85 void SetCollides(
bool abCollides) { mbCollides = abCollides; }
86 void SetAirFriction(
float afAirFriction) { mfAirFriction = afAirFriction; }
87 void SetGroundFriction(
float afGroundFriction) { mfGroundFriction = afGroundFriction; }
89 void AddForce(
float afAngle,
float afStrength);
92 void SetForce(
float afAngle,
float afStrength);
95 const cVector2f &GetForce()
const {
return mvForce; }
102 tFlag GetCollideFlag() {
return mlCollideFlag; }
109 bool GetAttachToGround() {
return mbAttachToGround; }
116 bool GetAttachBodies() {
return mbAttachBodies; }
118 void AttachBody(
cBody2D *apBody);
119 void DetachBody(
cBody2D *apBody);
120 void SetParentBody(
cBody2D *apBody);
128 tFlag GetCollideType() {
return mlCollideType; }
130 void AttachNode(
cNode2D *apNode) { mpNode = apNode; }
131 void DetachNode() { mpNode = NULL; }
133 int GetID() {
return mlID; }
135 bool OnGround() {
return mbOnGround; }
137 void UpdateCollisionMesh();
144 float mfMaxGravityVel;
146 float mfGroundFriction;
154 bool mbAttachToGround;
156 tBody2DList mlstAttachedBodies;
172 bool mbGroundFrictionX;
173 bool mbGroundFrictionY;
void SetCollideFlag(tFlag alFlag)
Definition: Body2D.h:101
void SetAttachToGround(bool abX)
Definition: Body2D.h:108
Definition: Collider2D.h:48
void SetAttachBodies(bool abX)
Definition: Body2D.h:115
ListInternal::Iterator< t_T > iterator
Definition: list.h:52
void SetCollideType(tFlag alFlag)
Definition: Body2D.h:127
Definition: Entity2D.h:39