ScummVM API documentation
ball.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 #ifndef WATCHMAKER_BALL_H
23 #define WATCHMAKER_BALL_H
24 
25 #include "watchmaker/types.h"
26 #include "watchmaker/t3d.h"
27 #include "watchmaker/struct.h"
28 #include "watchmaker/globvar.h"
29 
30 namespace Watchmaker {
31 
32 struct SPhys {
33  t3dF32 Kg = 0.0f; // costante gravitazionale
34  t3dF32 Kn = 0.0f; // coefficiente di attrito viscoso
35  t3dF32 Kc = 0.0f; // percentuale di energia cinetica che si conserva
36  t3dF32 Kt = 0.0f; // percentuale di energia cinetica che si conserva per terra
37  t3dF32 Mp = 0.0f; // massa palla
38  t3dF32 Mb = 0.0f; // massa braccio
39  t3dF32 Rp = 0.0f; // raggio palla
40  t3dF32 Td = 0.0f; // differenza di tempo trascorsa tra un istante e l'altro
41  t3dF32 Ts = 0.0f; // tempo trascorso dall'ultimo impatto
42  t3dF32 Tb = 0.0f; // tempo di carica del braccio
43 
44  t3dV3F Fb; // forza braccio
45  t3dV3F Vb; // velocita' braccio
46  t3dV3F Fv; // forza del vento
47  t3dV3F V0; // velocita' iniziale palla
48  t3dV3F S0; // posizione iniziale palla
49 
50  t3dV3F St; // posizione attuale
51  t3dV3F Vt; // velocita' attuale
52  t3dV3F At; // accelerazione attuale
53  t3dF32 MVt = 0.0f; // modulo della velocita' attuale
54  t3dF32 MAt = 0.0f; // modulo dell'accelerazione attuale
55 
56  uint8 InAir; // Se e' in volo
57  t3dV3F Angle; // Angolazione colpo
58  t3dF32 TimeLeft = 0.0f; // Tempo Riamente
59  SD3DTriangle ViewCone; // Cono visivo
60 };
61 
62 void InitPhys(struct SPhys *p);
63 void ContinuePhys(struct SPhys *p);
64 void ChangePhys(struct SPhys *p, int flags);
65 void NextGopher(WGame &game);
66 void ProcessGopherKeyboard();
67 void UpdateArrow();
68 void ProcessGopherCamera(WGame &game);
69 void UpdateBall(WGame &game, struct SPhys *p);
70 
71 extern struct SPhys Ball[];
72 
73 } // End of namespace Watchmaker
74 
75 #endif // WATCHMAKER_BALL_H
Definition: types3d.h:38
Definition: 2d_stuff.h:30
Definition: game.h:55
Definition: struct.h:433
Definition: ball.h:32