fixed bug to initialize m_body to 0 in OdeWorld::Object

git-svn-id: svn://anubis/misc/OdeWorld@163 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
josh 2009-10-09 03:00:51 +00:00
parent ccb6708633
commit 0496353916
2 changed files with 5 additions and 4 deletions

View File

@ -87,7 +87,7 @@ OdeWorld::Object * OdeWorld::createObject(bool is_static)
/* push an OpenGL matrix onto the matrix stack for a given
* ODE body position and rotation */
void OdeWorld::pushTransform(const float pos[3], const float R[12])
void OdeWorld::pushTransform(const dReal * pos, const dReal * R)
{
GLfloat matrix[16];
matrix[0] = R[0];
@ -115,6 +115,7 @@ OdeWorld::Object::Object(bool is_static, dWorldID world, dSpaceID space)
m_is_static = is_static;
m_world = world;
m_space = space;
m_body = 0;
}
void OdeWorld::Object::setPosition(double x, double y, double z)
@ -314,7 +315,7 @@ void OdeWorld::Object::setupGeom(dGeomID geom, dMass * mass,
const dReal * OdeWorld::Object::getPosition()
{
if (m_body != NULL)
if (m_body != 0)
{
return dBodyGetPosition(m_body);
}
@ -327,7 +328,7 @@ const dReal * OdeWorld::Object::getPosition()
const dReal * OdeWorld::Object::getRotation()
{
if (m_body != NULL)
if (m_body != 0)
{
return dBodyGetRotation(m_body);
}

View File

@ -54,7 +54,7 @@ class OdeWorld
friend void OdeWorld_collide_callback(void * data,
dGeomID o1, dGeomID o2);
static void pushTransform(const float pos[3], const float R[12]);
static void pushTransform(const dReal * pos, const dReal * R);
protected:
dWorldID m_world;