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
38
class
cMeleeWeaponAttack
{
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
79
class
cMeleeRayCallback
:
public
iPhysicsRayCallback
{
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
92
class
cHudModel_WeaponMelee
:
public
iHudModel
{
93
friend
class
cPlayerHands
;
94
95
public
:
96
cHudModel_WeaponMelee
();
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
148
Common::Array<cMeleeWeaponAttack>
mvAttacks;
149
};
150
151
//-------------------------------------------
152
153
#endif // GAME_HUD_MODEL_WEAPON_H
hpl
Definition:
AI.h:36
Common::String
Definition:
str.h:59
hpl::cPhysicsRayParams
Definition:
PhysicsWorld.h:92
Common::Array< cMeleeWeaponAttack >
hpl::cVector2< float >
hpl::iPhysicsRayCallback
Definition:
PhysicsWorld.h:100
cHudModelPose
Definition:
PlayerHands.h:40
hpl::cBoundingVolume
Definition:
BoundingVolume.h:71
hpl::cVector3< float >
cMeleeRayCallback
Definition:
HudModel_Weapon.h:79
hpl::iCollideShape
Definition:
CollideShape.h:50
hpl::iPhysicsBody
Definition:
PhysicsBody.h:117
iHudModel
Definition:
PlayerHands.h:74
cHudModel_WeaponMelee
Definition:
HudModel_Weapon.h:92
TiXmlElement
Definition:
tinyxml.h:864
hpl::cMatrix< float >
cMeleeWeaponAttack
Definition:
HudModel_Weapon.h:38
cPlayerHands
Definition:
PlayerHands.h:159
engines
hpl1
penumbra-overture
HudModel_Weapon.h
Generated on Sat Aug 31 2024 09:12:53 for ScummVM API documentation by
1.8.13