ScummVM API documentation
HudModel_Weapon.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_HUD_MODEL_WEAPON_H
29 #define GAME_HUD_MODEL_WEAPON_H
30 
31 #include "hpl1/engine/engine.h"
32 #include "hpl1/penumbra-overture/GameTypes.h"
33 
34 #include "hpl1/penumbra-overture/PlayerHands.h"
35 
36 using namespace hpl;
37 
39 public:
40  cHudModelPose mStart;
41  cHudModelPose mEnd;
42 
43  float mfAttackLength;
44  float mfChargeLength;
45  float mfTimeOfAttack;
46 
47  float mfMaxImpulse;
48  float mfMinImpulse;
49 
50  float mfMinMass;
51  float mfMaxMass;
52 
53  float mfMinDamage;
54  float mfMaxDamage;
55 
56  cVector3f mvSpinMul;
57 
58  float mfDamageRange;
59  cVector3f mvDamageSize;
60 
61  float mfAttackRange;
62 
63  float mfAttackSpeed;
64  int mlAttackStrength;
65 
66  tString msHitPS;
67  int mlHitPSPrio;
68 
69  tString msSwingSound;
70  tString msChargeSound;
71  tString msHitSound;
72 
73  iCollideShape *mpCollider;
74  cBoundingVolume mBV;
75 };
76 
77 //-------------------------------------------
78 
80 public:
81  void Reset();
82  bool OnIntersect(iPhysicsBody *pBody, cPhysicsRayParams *apParams);
83 
84  iPhysicsBody *mpClosestBody;
85  float mfShortestDist;
86  cVector3f mvPosition;
87  cVector3f mvNormal;
88 };
89 
90 //-------------------------------------------
91 
93  friend class cPlayerHands;
94 
95 public:
97 
98  void LoadData(TiXmlElement *apRootElem);
99 
100  void OnAttackDown();
101  void OnAttackUp();
102 
103  bool OnMouseMove(const cVector2f &avMovement);
104 
105  bool UpdatePoseMatrix(cMatrixf &aPoseMtx, float afTimeStep);
106 
107  void PostSceneDraw();
108 
109  bool IsAttacking();
110 
111  cVector3f GetHapticSize() { return mvHapticSize; }
112  float GetHapticScale() { return mfHapticScale; }
113  cVector3f GetHapticRot() { return mvHapticRot; }
114 
115  cMeleeWeaponAttack *GetAttack(int alX) { return &mvAttacks[alX]; }
116 
117 private:
118  void ResetExtraData();
119 
120  void Attack();
121  void HitBody(iPhysicsBody *apBody);
122 
123  void PlaySound(const tString &asSound);
124 
125  void LoadExtraEntites();
126  void DestroyExtraEntities();
127 
128  bool mbDrawDebug;
129 
130  int mlCurrentAttack;
131  int mlAttackState;
132  float mfTime;
133 
134  float mfHapticScale;
135  cVector3f mvHapticSize;
136  cVector3f mvHapticRot;
137 
138  cMatrixf m_mtxPrevPose;
139  cMatrixf m_mtxNextPose;
140 
141  float mfMoveSpeed;
142 
143  bool mbButtonDown;
144  bool mbAttacked;
145 
146  cMeleeRayCallback mRayCallback;
147 
149 };
150 
151 //-------------------------------------------
152 
153 #endif // GAME_HUD_MODEL_WEAPON_H
Definition: AI.h:36
Definition: str.h:59
Definition: PhysicsWorld.h:92
Definition: PhysicsWorld.h:100
Definition: PlayerHands.h:40
Definition: BoundingVolume.h:71
Definition: HudModel_Weapon.h:79
Definition: CollideShape.h:50
Definition: PhysicsBody.h:117
Definition: PlayerHands.h:74
Definition: HudModel_Weapon.h:92
Definition: tinyxml.h:864
Definition: HudModel_Weapon.h:38
Definition: PlayerHands.h:159