Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
task.h
1 /*
2  * This file is part of the Colobot: Gold Edition source code
3  * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
4  * http://epsiteс.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 // task.h
21 
22 #pragma once
23 
24 
25 #include "common/event.h"
26 #include "common/global.h"
27 
28 #include "math/const.h"
29 
30 
31 class CBrain;
32 class CPhysics;
33 class CMotion;
34 class CObject;
35 class CRobotMain;
36 class CSoundInterface;
37 
38 
39 namespace Gfx {
40 class CEngine;
41 class CLightManager;
42 class CParticle;
43 class CTerrain;
44 class CWater;
45 class CCamera;
46 } /* Gfx */
47 
48 
49 const float TAKE_DIST = 6.0f; // distance to an object to pick it
50 const float TAKE_DIST_OTHER = 1.5f; // additional distance if on friend
51 
52 //?const float ARM_NEUTRAL_ANGLE1 = 155.0f*Math::PI/180.0f;
53 //?const float ARM_NEUTRAL_ANGLE2 = -125.0f*Math::PI/180.0f;
54 //?const float ARM_NEUTRAL_ANGLE3 = -45.0f*Math::PI/180.0f;
55 const float ARM_NEUTRAL_ANGLE1 = 110.0f*Math::PI/180.0f;
56 const float ARM_NEUTRAL_ANGLE2 = -130.0f*Math::PI/180.0f;
57 const float ARM_NEUTRAL_ANGLE3 = -50.0f*Math::PI/180.0f;
58 
59 const float ARM_STOCK_ANGLE1 = 110.0f*Math::PI/180.0f;
60 const float ARM_STOCK_ANGLE2 = -100.0f*Math::PI/180.0f;
61 const float ARM_STOCK_ANGLE3 = -70.0f*Math::PI/180.0f;
62 
63 
64 class CTask
65 {
66 public:
67  CTask(CObject* object);
68  virtual ~CTask();
69 
70  virtual bool EventProcess(const Event &event);
71  virtual Error IsEnded();
72  virtual bool IsBusy();
73  virtual bool Abort();
74 
75 protected:
76  Gfx::CEngine* m_engine;
77  Gfx::CLightManager* m_lightMan;
78  Gfx::CParticle* m_particle;
79  Gfx::CTerrain* m_terrain;
80  Gfx::CWater* m_water;
81  Gfx::CCamera* m_camera;
82  CMotion* m_motion;
83  CBrain* m_brain;
84  CPhysics* m_physics;
85  CObject* m_object;
86  CRobotMain* m_main;
87  CSoundInterface* m_sound;
88 };
89 
Some common, global definitions.
Definition: physics.h:98
Manager for dynamic lights in 3D scene.
Definition: lightman.h:144
const float PI
PI.
Definition: const.h:47
Definition: robotmain.h:172
Particle engine.
Definition: particle.h:268
Camera moving in 3D scene.
Definition: camera.h:133
Terrain loader/generator and manager.
Definition: terrain.h:222
Constants used in math functions.
Namespace for (new) graphics code.
Definition: app.h:49
Definition: motion.h:48
Definition: task.h:64
The graphics engine.
Definition: engine.h:684
Event types, structs and event queue.
Error
Type of error or info message.
Definition: global.h:32
Water manager/renderer.
Definition: water.h:118
Event sent by system, interface or game.
Definition: event.h:678
Definition: object.h:357
Sound plugin interface.
Definition: sound.h:151
Definition: brain.h:87