2 (c) 2010 Perttu Ahola <celeron55@gmail.com>
8 #include "common_irrlicht.h"
11 #define PLAYERNAME_SIZE 20
21 void move(f32 dtime, Map &map);
28 void setSpeed(v3f speed)
33 // Y direction is ignored
34 void accelerate(v3f target_speed, f32 max_increase);
41 virtual void setPosition(v3f position)
43 m_position = position;
46 void setPitch(f32 pitch)
51 virtual void setYaw(f32 yaw)
66 virtual void updateName(const char *name)
68 snprintf(m_name, PLAYERNAME_SIZE, "%s", name);
71 const char * getName()
76 virtual bool isLocal() const = 0;
85 char m_name[PLAYERNAME_SIZE];
92 class RemotePlayer : public Player, public scene::ISceneNode
96 scene::ISceneNode* parent=NULL,
97 IrrlichtDevice *device=NULL,
100 virtual ~RemotePlayer();
106 virtual void OnRegisterSceneNode()
109 SceneManager->registerNodeForRendering(this);
111 ISceneNode::OnRegisterSceneNode();
114 virtual void render()
119 virtual const core::aabbox3d<f32>& getBoundingBox() const
124 void setPosition(v3f position)
126 Player::setPosition(position);
127 ISceneNode::setPosition(position);
130 virtual void setYaw(f32 yaw)
133 ISceneNode::setRotation(v3f(0, -yaw, 0));
141 void updateName(const char *name);
144 scene::ITextSceneNode* m_text;
145 core::aabbox3d<f32> m_box;
177 superspeed = a_superspeed;
191 class LocalPlayer : public Player
195 virtual ~LocalPlayer();
202 void applyControl(float dtime);
204 PlayerControl control;