28 #ifndef HPL_MESH_ENTITY_H 29 #define HPL_MESH_ENTITY_H 31 #include "hpl1/engine/graphics/GraphicsTypes.h" 32 #include "hpl1/engine/graphics/Renderable.h" 33 #include "hpl1/engine/math/MathTypes.h" 34 #include "hpl1/engine/math/MeshTypes.h" 35 #include "hpl1/engine/scene/Entity3D.h" 36 #include "hpl1/engine/system/SystemTypes.h" 38 #include "hpl1/engine/scene/SubMeshEntity.h" 40 #include "common/array.h" 41 #include "hpl1/engine/scene/AnimationState.h" 42 #include "common/stablemap.h" 46 class cMaterialManager;
48 class cAnimationManager;
53 class cAnimationState;
66 void OnTransformUpdate(
iEntity3D *apEntity);
74 virtual void AfterAnimationUpdate(
cMeshEntity *apMeshEntity,
float afTimeStep) = 0;
91 virtual int GetSaveCreatePrio();
107 void SetWorld(
cWorld3D *apWorld) { mpWorld = apWorld; }
108 cWorld3D *GetWorld() {
return mpWorld; }
110 void SetCastsShadows(
bool abX);
112 cNode3D *GetRootNode() {
return mpRootNode; }
119 int GetSubMeshEntityNum();
123 void ClearAnimations();
126 int GetAnimationStateIndex(
const tString &asName);
128 int GetAnimationStateNum();
131 void Play(
int alIndex,
bool abLoop,
bool bStopPrev);
132 void PlayName(
const tString &asName,
bool abLoop,
bool bStopPrev);
137 int GetBoneStateIndex(
const tString &asName);
139 int GetBoneStateNum();
141 void SetSkeletonPhysicsActive(
bool abX);
142 bool GetSkeletonPhysicsActive();
144 void SetSkeletonPhysicsCanSleep(
bool abX) { mbSkeletonPhysicsCanSleep = abX; }
145 bool GetSkeletonPhysicsCanSleep() {
return mbSkeletonPhysicsCanSleep; }
147 float GetSkeletonPhysicsWeight();
148 void SetSkeletonPhysicsWeight(
float afX);
150 void FadeSkeletonPhysicsWeight(
float afTime);
152 void SetSkeletonCollidersActive(
bool abX);
153 bool GetSkeletonCollidersActive();
155 void AlignBodiesToSkeleton(
bool abCalculateSpeed);
157 cMesh *GetMesh() {
return mpMesh; }
179 void ResetGraphicsUpdated();
182 cNode3D *GetNodeState(
int alIndex);
183 int GetNodeStateIndex(
const tString &asName);
185 int GetNodeStateNum();
186 bool HasNodes() {
return mbHasNodes; }
191 tString GetEntityType() {
return "Mesh"; }
192 bool IsVisible() {
return IsRendered(); }
193 void SetVisible(
bool abVisible) { SetRendered(abVisible); }
195 void UpdateLogic(
float afTimeStep);
199 void SetRendered(
bool abX);
202 bool IsShadowCaster();
205 int GetMatrixUpdateCount();
206 eRenderableType GetRenderType();
213 virtual void SaveToSaveData(
iSaveData *apSaveData);
214 virtual void LoadFromSaveData(
iSaveData *apSaveData);
218 void UpdateNodeMatrixRec(
const cMatrixf &a_mtxParentWorld,
cNode3D *apNode);
222 void SetBoneMatrixFromBodyRec(
const cMatrixf &a_mtxParentWorld,
cBoneState *apBoneState);
224 void UpdateBVFromSubs();
226 void BuildBoneStatesRec(
cBone *apBone,
cNode3D *apParent);
246 bool mbSkeletonPhysics;
247 bool mbSkeletonPhysicsFading;
248 float mfSkeletonPhysicsFadeSpeed;
249 float mfSkeletonPhysicsWeight;
251 bool mbSkeletonPhysicsSleeping;
252 bool mbSkeletonPhysicsCanSleep;
254 bool mbSkeletonColliders;
262 int mlStartSleepCount;
264 float mfTimeStepAccum;
287 #endif // HPL_MESH_ENTITY_H
Definition: SubMeshEntity.h:95
Definition: VertexBuffer.h:90
Definition: MaterialManager.h:41
Definition: PhysicsWorld.h:115
Definition: AnimationState.h:80
Definition: BoundingVolume.h:71
Definition: SaveGame.h:130
Definition: multimap.h:34
Definition: Renderable.h:70
Definition: CollideShape.h:50
Definition: Animation.h:44
Definition: AnimationManager.h:39
Definition: Container.h:121
Definition: PhysicsBody.h:117
Definition: World3D.h:179
Definition: SaveGame.h:111
Definition: RenderList.h:145
Definition: MeshEntity.h:71
Definition: BoneState.h:37
Definition: Entity3D.h:81
Definition: MeshEntity.h:96
Definition: Material.h:203
Definition: Entity3D.h:44
Definition: MeshManager.h:39
Definition: SaveGame.h:183
Definition: Camera3D.h:53
Definition: MeshEntity.h:64
Definition: AnimationState.h:71