2
* Delta3D Open Source Game and Simulation Engine
3
* Copyright (C) 2006, Alion Science and Technology, BMH Operation
5
* This library is free software; you can redistribute it and/or modify it under
6
* the terms of the GNU Lesser General Public License as published by the Free
7
* Software Foundation; either version 2.1 of the License, or (at your option)
10
* This library is distributed in the hope that it will be useful, but WITHOUT
11
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15
* You should have received a copy of the GNU Lesser General Public License
16
* along with this library; if not, write to the Free Software Foundation, Inc.,
17
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
* @author Matthew W. Campbell
20
* @editor Allen M. Danklefsen
21
* @editor Curtiss Murphy
27
#include "../../basic/robotActorBase.h"
29
#include "../factories/bodyFactory.h"
30
#include "../factories/actuatorFactory.h"
31
#include "../factories/sensorFactory.h"
32
#include "../bodies/led.h"
33
#include "../connectors/connectorUniKarl.h"
35
//#include "../actuators/screwDrive.h"
42
* This class is the actor that represents a robot. It knows how to
43
* respond to keyboard presses (I, J, K, L to steer). It also listens for
44
* "SpeedBoost" GameEvent. This actor correctly handles
45
* TickLocal versus TickRemote.
47
class ROBOT_EXPORT RobotUniKarl : public RobotActorBase
48
// : public dtGame::GameActor
51
//! Constant identifier for our game event handler method.
52
static const std::string EVENT_HANDLER_NAME;
54
//! Constructs the robot actor.
55
RobotUniKarl(dtGame::GameActorProxy &proxy);
58
* This method is an invokable called when an object is local and
60
* @param tickMessage A message containing tick related information.
62
virtual void TickLocal(const dtGame::Message &tickMessage);
65
* This method is an invokable called when an object is remote and
67
* @param tickMessage A message containing tick related information.
69
// virtual void TickRemote(const dtGame::Message &tickMessage);
72
* Generic handler for messages. Overridden from base class.
73
* This is the default invokable on GameActorProxy.
75
virtual void ProcessMessage(const dtGame::Message &message);
77
/** Called when the actor has been added to the game manager.
78
* You can respond to OnEnteredWorld on either the proxy or actor or both.
80
virtual void OnEnteredWorld();
86
virtual ~RobotUniKarl();
89
* build the robot from meshes and attach joints and physical features to it
90
* you can set the starting position & heading with the normal proxy
91
* SetTranslation & SetRotation method analogical (only the first value -
92
* the heading in the x-y-plane is used)
93
* this Method is called from OnEnteredWorld(), so you have to call
94
* the SetTranslation & SetRotation methods before the AddActor call
99
//! delta time between two simulation steps
102
//! switch between manual (keyboard and GUI control) and automat (Controller) control
109
* Our proxy class for the robot actor. The proxy contains properties,
110
* invokables, and robot actor.
112
class ROBOT_EXPORT RobotUniKarlProxy : public RobotActorBaseProxy//dtGame::GameActorProxy
116
//! Constructs the proxy.
119
//! Creates the properties that are custom to the robot proxy.
120
virtual void BuildPropertyMap();
123
virtual ~RobotUniKarlProxy();
125
//! Creates an instance of our robot tank actor
126
virtual void CreateActor();
128
/** Called when this proxy is added to the game manager (ie, the "world")
129
* You can respond to OnEnteredWorld on either the proxy or actor or both.
131
virtual void OnEnteredWorld();