Minor documentation fixes for ode module.
[MidoriGraph.git] / ode / src / main / Body.cpp
blob301028202d56e3ca7164601cdebbcd89b41629ee
1 /*
2 Copyright 2007, JD Marble <midorikid@yahoo.com>
4 This file is part of MidoriGraph.
6 MidoriGraph is free software; you can redistribute it and/or modify it under the
7 terms of the GNU General Public License as published by the Free Software
8 Foundation; either version 2 of the License, or (at your option) any later
9 version.
11 MidoriGraph is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along with
16 MidoriGraph; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include "Body.hpp"
21 #include "Transform.hpp"
22 #include "utility.hpp"
23 #include "World.hpp"
25 namespace MidoriGraph {
28 void Body::initialize(const Node& owner) {
30 Property::initialize(owner);
32 dWorldID worldID = owner.getAncestorProperty<World>()->getWorldID();
34 bodyID = dBodyCreate(worldID);
36 // Set mass
37 dMassSetSphereTotal(&mass, 1.0, 1.0);
38 dBodySetMass(bodyID, &mass);
40 // Set translation
41 Vector3 translate = owner.getProperty<Transform>()->getTranslate();
42 dBodySetPosition(bodyID, translate.x, translate.y, translate.z);
44 // Set velocity
45 dBodySetLinearVel(bodyID, 0, 0, 0);
50 void Body::setTransform() {
52 //getTransform:
53 //Vector3 translate = owner.getProperty<Transform>()->getTranslate();
54 //sceneNode->setPosition(translate.x, translate.y, translate.z);
58 } //namespace MidoriGraph