Introduced FileSystem and Out classes
[openstranded.git] / src / eal / irrlicht / scenenode.cc
blob0c0c038d5c1e334d4853fba5560ddf90abdb3b16
1 /*
2 * Irrlicht scene node
4 * Copyright (C) 2009 Mathias Gottschlag
6 * This file is part of OpenStranded
8 * OpenStranded is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * OpenStranded is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with OpenStranded. If not, see <http://www.gnu.org/licenses/>.
22 #include "eal/irrlicht/scenenode.hh"
23 #include "eal/irrlicht/engine.hh"
25 #include <irrlicht/irrlicht.h>
26 using namespace irr;
28 namespace eal
30 IrrlichtSceneNode::IrrlichtSceneNode()
32 node = 0;
34 IrrlichtSceneNode::~IrrlichtSceneNode()
36 if (node)
37 node->remove();
40 std::string
41 IrrlichtSceneNode::getModel()
43 return model;
46 void
47 IrrlichtSceneNode::setModel(std::string model)
49 this->model = model;
50 // Delete old scene node
51 if (node)
52 node->remove();
53 // Create new scene node
54 scene::ISceneManager *smgr = ((IrrlichtEngine*)Engine::get())->getSceneManager();
55 scene::IAnimatedMesh *mesh = smgr->getMesh(model.c_str());
56 node = smgr->addAnimatedMeshSceneNode(mesh);
59 Texture&
60 IrrlichtSceneNode::getTexture()
64 void
65 IrrlichtSceneNode::setTexture(Texture &texture)
69 Color
70 IrrlichtSceneNode::getColor()
74 void
75 IrrlichtSceneNode::setColor(const Color &color)
79 void
80 IrrlichtSceneNode::setPosition(const Vector3 &position)
82 this->position = position;
83 if (node)
85 node->setPosition(core::vector3df(position.x, position.y, position.z));
89 Vector3
90 IrrlichtSceneNode::getPosition()
92 return position;
95 void
96 IrrlichtSceneNode::setRotation(const RotationVector &rotation)
100 RotationVector
101 IrrlichtSceneNode::getRotation()
105 void
106 IrrlichtSceneNode::playAnimation (int start, int end, double speed, int mode)