Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/objecthierarchy/src/orxonox/objects/WorldEntity.cc @ 461

Last change on this file since 461 was 461, checked in by landauf, 16 years ago

dt

File size: 1.1 KB
Line 
1#include <string>
2#include <sstream>
3
4#include "WorldEntity.h"
5#include "../core/CoreIncludes.h"
6
7namespace orxonox
8{
9    CreateFactory(WorldEntity);
10
11    Ogre::SceneManager* WorldEntity::sceneManager_s = 0;
12    unsigned int WorldEntity::worldEntityCounter_s = 0;
13    int WorldEntity::num_s = 0;
14
15    WorldEntity::WorldEntity()
16    {
17        RegisterObject(WorldEntity);
18
19        if (WorldEntity::sceneManager_s)
20            WorldEntity::sceneManager_s->setAmbientLight( ColourValue( 1, 1, 1 ) ); // remove this
21
22        if (WorldEntity::sceneManager_s)
23        {
24            std::ostringstream name;
25            name << (WorldEntity::worldEntityCounter_s++);
26            this->setName("WorldEntity" + name.str());
27            node_ = WorldEntity::sceneManager_s->getRootSceneNode()->createChildSceneNode(this->getName());
28        }
29
30        this->bStatic_ = false;
31        this->velocity_ = Vector3(0, 0, 0);
32    }
33
34    WorldEntity::~WorldEntity()
35    {
36    }
37
38    void WorldEntity::tick(float dt)
39    {
40        if (!this->bStatic_)
41        {
42            this->translate(dt * this->velocity_);
43        }
44    }
45}
Note: See TracBrowser for help on using the repository browser.