forked from LemonHaze420/DCMoHo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboat.cpp
More file actions
73 lines (50 loc) · 1.21 KB
/
Copy pathboat.cpp
File metadata and controls
73 lines (50 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "Common.h"
#include "Globals.h"
#include "Boat.h"
//******************************************************************************************
void CBoat::Init(CInitThing *i)
{
SUPERTYPE::Init(i);
GET_TARGET;
// float!
if (mPos.Z > GAME.GetLevelData()->mGVars[WATER_HEIGHT])
mPos.Z = GAME.GetLevelData()->mGVars[WATER_HEIGHT];
if (i->mAngleType == AT_YPR)
{
mYaw = i->mYaw;
mPitch = i->mPitch;
mRoll = i->mRoll;
}
else
{
mYaw = G0;
mPitch = G0;
mRoll = G0;
}
// mDestYaw = invalid value..
mOriginalZ = mPos.Z;
}
//******************************************************************************************
void CBoat::Process()
{
// move?
if (mTarget)
{
}
// rotate a bit
GINT v = G((GAME.GetGameTurn() + mNumber * 3547) % 20000);
mPitch = GSIN(v / 23) / 15;
mRoll = GCOS(v / 15) / 12;
mOrientation.MakeRotation(mYaw, mPitch, mRoll);
// Bob up & down
mPos.Z = mOriginalZ + GSIN((v / 15)) / 5; // OK not to use MOVE (maybe...)
SUPERTYPE::Process();
}
//********************************************************************************************************
#if TARGET == PC
void CBoat::WriteData(CInitThing &i)
{
SUPERTYPE::WriteData(i);
WRITE_TARGET;
}
#endif