ScummVM API documentation
GameForceArea.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * Copyright (C) 2006-2010 - Frictional Games
24  *
25  * This file is part of Penumbra Overture.
26  */
27 
28 #ifndef GAME_GAME_FORCE_AREA_H
29 #define GAME_GAME_FORCE_AREA_H
30 
31 #include "hpl1/engine/engine.h"
32 #include "hpl1/penumbra-overture/GameEntity.h"
33 
34 using namespace hpl;
35 
36 //------------------------------------------
37 
39  kSerializableClassInit(cGameForceArea_SaveData);
40 
41 public:
42  cVector3f mvSize;
43 
44  float mfMaxForce;
45  float mfConstant;
46  float mfDestSpeed;
47  float mfMaxMass;
48 
49  bool mbMulWithMass;
50  bool mbAffectCharacters;
51  bool mbAffectBodies;
52  bool mbForceAtPoint;
53 
54  iGameEntity *CreateEntity();
55 };
56 
57 //------------------------------------------
58 
59 class cGameForceArea : public iGameEntity {
60  typedef iGameEntity super;
61  friend class cAreaLoader_GameForceArea;
62 
63 public:
64  cGameForceArea(cInit *apInit, const tString &asName);
65  ~cGameForceArea(void);
66 
67  void Setup();
68 
69  void Update(float afTimeStep);
70  void OnPostSceneDraw();
71 
72  void SetMaxForce(float afX) { mfMaxForce = afX; }
73  void SetConstant(float afX) { mfConstant = afX; }
74  void SetDestSpeed(float afX) { mfDestSpeed = afX; }
75  void SetMaxMass(float afX) { mfMaxMass = afX; }
76 
77  void SetMulWithMass(bool abX) { mbMulWithMass = abX; }
78  void SetAffectCharacters(bool abX) { mbAffectCharacters = abX; }
79  void SetAffectBodies(bool abX) { mbAffectBodies = abX; }
80  void SetForceAtPoint(bool abX) { mbForceAtPoint = abX; }
81 
82  // SaveObject implementation
83  iGameEntity_SaveData *CreateSaveData();
84  void SaveToSaveData(iGameEntity_SaveData *apSaveData);
85  void LoadFromSaveData(iGameEntity_SaveData *apSaveData);
86  void SetupSaveData(iGameEntity_SaveData *apSaveData);
87 
88 private:
89  float mfMaxForce;
90  float mfConstant;
91  float mfDestSpeed;
92  float mfMaxMass;
93 
94  bool mbMulWithMass;
95  bool mbAffectCharacters;
96  bool mbAffectBodies;
97  bool mbForceAtPoint;
98 
99  cVector3f mvUp;
100 };
101 
102 //------------------------------------------
103 
105 
106 public:
107  cAreaLoader_GameForceArea(const tString &asName, cInit *apInit);
109 
110  iEntity3D *Load(const tString &asName, const cVector3f &avSize, const cMatrixf &a_mtxTransform, cWorld3D *apWorld);
111 
112 private:
113  cInit *mpInit;
114 };
115 
116 #endif // GAME_GAME_DAMAGE_AREA_H
Definition: AI.h:36
Definition: str.h:59
Definition: GameForceArea.h:38
Definition: GameEntity.h:76
Definition: World3D.h:179
Definition: GameForceArea.h:59
Definition: Entity3D.h:81
Definition: Resources.h:133
Definition: GameEntity.h:126
Definition: Init.h:70
Definition: GameForceArea.h:104