Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
PhysControllerClass.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#ifndef TT_INCLUDE__PHYSCONTROLLERCLASS_H
13#define TT_INCLUDE__PHYSCONTROLLERCLASS_H
14
15#include "Vector3.h"
16class ChunkLoadClass;
17class ChunkSaveClass;
18class PhysControllerClass
19{
20public:
21 PhysControllerClass(void) : MoveVector(0,0,0), TurnLeft(0) { }
22 void Reset(void) { Reset_Move(); Reset_Turn(); }
23 void Set_Move_Forward(float scl) { MoveVector.X = scl; }
24 void Set_Move_Left(float scl) { MoveVector.Y = scl; }
25 void Set_Move_Up(float scl) { MoveVector.Z = scl; }
26 void Set_Turn_Left(float scl) { TurnLeft = scl; }
27 float Get_Move_Forward(void) { return MoveVector.X; }
28 float Get_Move_Left(void) { return MoveVector.Y; }
29 float Get_Move_Up(void) { return MoveVector.Z; }
30 float Get_Turn_Left(void) { return TurnLeft; }
31 void Reset_Move(void) { MoveVector.Set(0,0,0); }
32 const Vector3 & Get_Move_Vector(void) { return MoveVector; }
33 void Reset_Turn(void) { TurnLeft = 0.0f; }
34 bool Is_Inactive(void)
35 {
36 return ((TurnLeft == 0.0f) && (MoveVector.Length2() == 0.0f));
37 }
38 bool Save(ChunkSaveClass & csave);
39 bool Load(ChunkLoadClass & cload);
40private:
41 Vector3 MoveVector;
42 float TurnLeft;
43}; // size: 16
44
45
46#endif