Colobot
motionhuman.h
1 /*
2  * This file is part of the Colobot: Gold Edition source code
3  * Copyright (C) 2001-2016, Daniel Roux, EPSITEC SA & TerranovaTeam
4  * http://epsitec.ch; http://colobot.info; http://github.com/colobot
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see http://gnu.org/licenses
18  */
19 
20 #pragma once
21 
22 
23 #include "object/motion/motion.h"
24 
25 
26 
27 enum MotionHumanAction
28 {
29  MH_MARCH = 0,
30  MH_MARCHTAKE = 1,
31  MH_TURN = 2,
32  MH_STOP = 3,
33  MH_FLY = 4,
34  MH_SWIM = 5,
35  MH_SPEC = 6
36 };
37 
38 enum MotionHumanSpecialAction
39 {
40  MHS_FIRE = 0,
41  MHS_GUN = 1,
42  MHS_TAKE = 2,
43  MHS_TAKEOTHER = 3,
44  MHS_TAKEHIGH = 4,
45  MHS_UPRIGHT = 5,
46  MHS_WIN = 6,
47  MHS_LOST = 7,
48  MHS_DEADg = 8,
49  MHS_DEADg1 = 9,
50  MHS_DEADg2 = 10,
51  MHS_DEADg3 = 11,
52  MHS_DEADg4 = 12,
53  MHS_DEADw = 13,
54  MHS_FLAG = 14,
55  MHS_SATCOM = 15
56 };
57 
58 
59 class CMotionHuman : public CMotion
60 {
61 public:
62  CMotionHuman(COldObject* object);
63  ~CMotionHuman();
64 
65  void DeleteObject(bool bAll=false) override;
66  void Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override;
67  bool EventProcess(const Event &event) override;
68  Error SetAction(int action, float time=0.2f) override;
69 
70  void StartDisplayPerso();
71  void StopDisplayPerso();
72 
73 protected:
74  void CreatePhysics(ObjectType type);
75  bool EventFrame(const Event &event);
76 
77 protected:
78  int m_partiReactor;
79  float m_armMember;
80  float m_armTimeAbs;
81  float m_armTimeAction;
82  float m_armTimeSwim;
83  short m_armAngles[3*3*3*3*7 + 3*3*3*16];
84  int m_armTimeIndex;
85  int m_armPartIndex;
86  int m_armMemberIndex;
87  int m_armLastAction;
88  bool m_bArmStop;
89  float m_lastSoundMarch;
90  float m_lastSoundHhh;
91  float m_time;
92  float m_tired;
93  bool m_bDisplayPerso;
94 };
Manager for static models.
Definition: oldmodelmanager.h:54
Definition: old_object.h:79
Definition: motion.h:47
Definition: motionhuman.h:59
ObjectType
Type of game object.
Definition: object_type.h:33
3D (3x1) vector
Definition: vector.h:53
Event sent by system, interface or game.
Definition: event.h:735