not calling dGeomGetPosition/Rotation() for planes

git-svn-id: svn://anubis/misc/OdeWorld@200 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
josh committed 2009-10-29 02:52:09 +00:00
1 parent cd64681a71
commit af7060b853
1 file changed
+10 -3
+10 -3
View File
@@ -372,7 +372,8 @@ const dReal * OdeWorld::Object::getPosition()
} }
else if (m_geoms.size() > 0) else if (m_geoms.size() > 0)
{ {
return dGeomGetPosition(m_geoms[0]); if (dGeomGetClass(m_geoms[0]) != dPlaneClass)
return dGeomGetPosition(m_geoms[0]);
} }
return m_position; return m_position;
} }
@@ -385,7 +386,8 @@ const dReal * OdeWorld::Object::getRotation()
} }
else if (m_geoms.size() > 0) else if (m_geoms.size() > 0)
{ {
return dGeomGetRotation(m_geoms[0]); if (dGeomGetClass(m_geoms[0]) != dPlaneClass)
return dGeomGetRotation(m_geoms[0]);
} }
return m_rotation; return m_rotation;
} }
@@ -413,7 +415,12 @@ void OdeWorld::Object::getPosition(double * x, double * y, double * z)
if (m_is_static) if (m_is_static)
{ {
if (m_geoms.size() > 0) if (m_geoms.size() > 0)
pos = dGeomGetPosition(m_geoms[0]); {
if (dGeomGetClass(m_geoms[0]) == dPlaneClass)
pos = &m_position[0];
else
pos = dGeomGetPosition(m_geoms[0]);
}
} }
else else
{ {