28 #ifndef GAME_GAME_ENTITY_H 29 #define GAME_GAME_ENTITY_H 31 #include "hpl1/engine/engine.h" 35 #include "hpl1/penumbra-overture/GameTypes.h" 36 #include "hpl1/penumbra-overture/SaveTypes.h" 85 float mfMaxExamineDist;
86 float mfMaxInteractDist;
88 bool mbHasBeenExamined;
93 bool mbShowDescritionOnce;
95 eGameEntityType mType;
133 const tString &GetName() {
return msName; }
135 bool IsActive() {
return mbActive; }
136 void SetActive(
bool abX);
137 virtual void OnSetActive(
bool abX) {}
139 virtual bool IsSaved() {
return mbIsSaved; }
141 virtual void OnWorldLoad() {}
142 virtual void OnPostLoadScripts() {}
143 virtual void OnWorldExit() {}
144 virtual void Update(
float afTimeStep) {}
145 virtual void OnDraw() {}
146 virtual void OnPostSceneDraw() {}
148 void OnUpdate(
float afTimeStep);
150 eGameEntityType GetType() {
return mType; }
152 const tString &GetSubType() {
return msSubType; }
154 void SetDescription(
const tWString &asDesc) { msDescription = asDesc; }
155 const tWString &GetDescription() {
return msDescription; }
157 void SetShowDescritionOnce(
bool abX) { mbShowDescritionOnce = abX; }
158 bool GetShowDescritionOnce() {
return mbShowDescritionOnce; }
160 bool GetHasBeenExamined() {
return mbHasBeenExamined; }
162 void SetGameName(
const tWString &asName) { msGameName = asName; }
163 const tWString &GetGameName() {
return msGameName; }
165 iPhysicsBody *GetBody(
int alNum) {
return mvBodies[alNum]; }
166 int GetBodyNum() {
return (
int)mvBodies.size(); }
169 iPhysicsJoint *GetJoint(
int alNum) {
return mvJoints[alNum]; }
170 int GetJointNum() {
return (
int)mvJoints.size(); }
173 int GetLightNum() {
return (
int)mvLights.
size(); }
174 iLight3D *GetLight(
int alX) {
return mvLights[alX]; }
182 void DestroyLight(
iLight3D *apLight);
184 void DestroyBillboard(
cBillboard *apBillboard);
187 cMeshEntity *GetMeshEntity() {
return mpMeshEntity; }
188 void SetMeshEntity(
cMeshEntity *apEnity) { mpMeshEntity = apEnity; }
191 void PlayerInteract();
192 void PlayerExamine();
194 virtual void OnPlayerPick() {}
195 virtual void OnPlayerInteract() {}
196 virtual void OnPlayerExamine();
200 virtual void BreakAction() {}
202 virtual void OnDamage(
float afDamage) {}
203 virtual void OnDeath(
float afDamage) {}
207 bool GetHasInteraction() {
return mbHasInteraction; }
209 float GetMaxExamineDist() {
return mfMaxExamineDist; }
210 void SetMaxExamineDist(
float afX) { mfMaxExamineDist = afX; }
211 float GetMaxInteractDist() {
return mfMaxInteractDist; }
212 void SetMaxInteractDist(
float afX) { mfMaxInteractDist = afX; }
214 virtual eCrossHairState GetPickCrossHairState(
iPhysicsBody *apBody);
215 virtual float GetPickedDistance();
217 void AddCollideScript(eGameCollideScriptType aType,
const tString &asFunc,
const tString &asEntity);
218 void RemoveCollideScript(eGameCollideScriptType aType,
const tString &asFunc);
219 void RemoveCollideScriptWithChildEntity(
iGameEntity *apEntity);
221 void AddScript(eGameEntityScriptType aType,
const tString &asFunc);
222 void RemoveScript(eGameEntityScriptType aType);
224 void CreateVar(
const tString &asName,
int alVal);
225 void SetVar(
const tString &asName,
int alVal);
226 void AddVar(
const tString &asName,
int alVal);
227 int GetVar(
const tString &asName);
229 void Damage(
float afDamage,
int alStrength);
230 float GetHealth() {
return mfHealth; }
231 void SetHealth(
float afHealth);
233 void SetToughness(
int alX) { mlToughness = alX; }
234 int GetToughness() {
return mlToughness; }
236 bool GetDestroyMe() {
return mbDestroyMe; }
237 bool GetBreakMe() {
return mbBreakMe; }
239 void Break() { mbBreakMe =
true; }
241 void SetCharBody(
iCharacterBody *apCharBody) { mpCharBody = apCharBody; }
244 void SetUpTransMaterials();
245 void SetTransActive(
bool abX);
247 void SetPauseControllers(
bool abX) { mbPauseControllers = abX; }
248 bool GetPauseControllers() {
return mbPauseControllers; }
250 void SetPauseGravity(
bool abX) { mbPauseGravity = abX; }
251 bool GetPauseGravity() {
return mbPauseGravity; }
253 const cMatrixf &GetOnLoadTransform() {
return m_mtxOnLoadTransform; }
254 void SetOnLoadTransform(
const cMatrixf &a_mtxPose) { m_mtxOnLoadTransform = a_mtxPose; }
256 void SetLastImpulse(
const cVector3f &avVec) { mvLastImpulse = avVec; }
258 const tString &GetFileName() {
return msFileName; }
260 cGameEntityScript *GetCallbackScript(eGameEntityScriptType aType) {
return mvCallbackScripts[aType]; }
272 tString GetScriptCommand(eGameEntityScriptType aType);
274 void PreloadModel(
const tString &asFile);
287 bool mbHasInteraction;
289 bool mbHasBeenExamined;
301 bool mbShowDescritionOnce;
303 float mfMaxExamineDist;
304 float mfMaxInteractDist;
306 eGameEntityType mType;
308 bool mbPauseControllers;
344 bool mbUpdatingCollisionCallbacks;
347 #endif // GAME_GAME_ENTITY_H
Definition: SaveTypes.h:80
Definition: GameEntity.h:44
Definition: GameEntity.h:65
Definition: SaveTypes.h:107
Definition: Light3D.h:117
typename TreeT::BasicIterator iterator
Definition: stablemap.h:48
Definition: stablemap.h:43
Definition: SerializeClass.h:230
Definition: GameEntity.h:76
Definition: BillBoard.h:78
Definition: PhysicsBody.h:117
Definition: Inventory.h:123
Definition: CollideData.h:46
size_type size() const
Definition: array.h:315
Definition: ParticleSystem3D.h:90
Definition: CharacterBody.h:153
Definition: MeshEntity.h:96
Definition: SoundEntity.h:86
Definition: PhysicsJoint.h:135
Definition: GameEntity.h:126