2 * This file defines SceneNodes, the representants of entities in the
5 * Copyright (C) 2009 Mathias Gottschlag
7 * This file is part of OpenStranded
9 * OpenStranded is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * OpenStranded is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with OpenStranded. If not, see <http://www.gnu.org/licenses/>.
23 #include "eal/scenenode.hh"
24 #include "eal/engine.hh"
25 #include "eal/irrlicht/irrlichtengine.hh"
27 #include <irrlicht/irrlicht.h>
32 SceneNode::SceneNode ()
36 SceneNode::~SceneNode ()
43 SceneNode::getModel ()
49 SceneNode::setModel (std::string model
)
52 // Delete old scene node
55 // Create new scene node
56 scene::ISceneManager
*smgr
= ((IrrlichtEngine
*)Engine::get())->getSceneManager();
57 scene::IAnimatedMesh
*mesh
= smgr
->getMesh(model
.c_str());
58 node
= smgr
->addAnimatedMeshSceneNode(mesh
);
62 SceneNode::getTexture ()
67 SceneNode::setTexture (Texture
&texture
)
72 SceneNode::getColor ()
77 SceneNode::setColor (Color
&color
)
82 SceneNode::setPosition (Vector3 position
)
84 this->position
= position
;
87 node
->setPosition(core::vector3df(position
.x
, position
.y
, position
.z
));
92 SceneNode::getPosition ()
98 SceneNode::setRotation (RotationVector
&rotation
)
103 SceneNode::getRotation ()
108 SceneNode::playAnimation (int start
, int end
, double speed
, int mode
)