Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
motionvehicle.h
1 // * This file is part of the COLOBOT source code
2 // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
3 // *
4 // * This program is free software: you can redistribute it and/or modify
5 // * it under the terms of the GNU General Public License as published by
6 // * the Free Software Foundation, either version 3 of the License, or
7 // * (at your option) any later version.
8 // *
9 // * This program is distributed in the hope that it will be useful,
10 // * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // * GNU General Public License for more details.
13 // *
14 // * You should have received a copy of the GNU General Public License
15 // * along with this program. If not, see http://www.gnu.org/licenses/.
16 
17 // motionvehicle.h
18 
19 #pragma once
20 
21 
22 #include "object/motion/motion.h"
23 
24 
25 
26 class CMotionVehicle : public CMotion
27 {
28 public:
29  CMotionVehicle(CObject* object);
30  ~CMotionVehicle();
31 
32  void DeleteObject(bool bAll=false);
33  bool Create(Math::Vector pos, float angle, ObjectType type, float power);
34  bool EventProcess(const Event &event);
35 
36  bool GetTraceDown();
37  void SetTraceDown(bool bDown);
38  int GetTraceColor();
39  void SetTraceColor(int color);
40  float GetTraceWidth();
41  void SetTraceWidth(float width);
42 
43 protected:
44  void CreatePhysics(ObjectType type);
45  bool EventFrame(const Event &event);
46  bool EventFrameFly(const Event &event);
47  bool EventFrameInsect(const Event &event);
48  bool EventFrameCanoni(const Event &event);
49  void UpdateTrackMapping(float left, float right, ObjectType type);
50 
51 protected:
52  float m_wheelTurn[4];
53  float m_flyPaw[3];
54  float m_posTrackLeft;
55  float m_posTrackRight;
56  int m_partiReactor;
57  float m_armTimeAbs;
58  float m_armMember;
59  float m_canonTime;
60  float m_lastTimeCanon;
61  Math::Vector m_wheelLastPos;
62  Math::Vector m_wheelLastAngle;
63  Math::Vector m_posKey;
64  bool m_bFlyFix;
65  bool m_bTraceDown;
66  int m_traceColor;
67  float m_traceWidth;
68 };
69