From af7060b853a561d32bbe808db4aca761e6e28fd2 Mon Sep 17 00:00:00 2001 From: josh Date: Thu, 29 Oct 2009 02:52:09 +0000 Subject: [PATCH] not calling dGeomGetPosition/Rotation() for planes git-svn-id: svn://anubis/misc/OdeWorld@200 bd8a9e45-a331-0410-811e-c64571078777 --- OdeWorld.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/OdeWorld.cc b/OdeWorld.cc index 9e32015..397a88d 100644 --- a/OdeWorld.cc +++ b/OdeWorld.cc @@ -372,7 +372,8 @@ const dReal * OdeWorld::Object::getPosition() } 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; } @@ -385,7 +386,8 @@ const dReal * OdeWorld::Object::getRotation() } 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; } @@ -413,7 +415,12 @@ void OdeWorld::Object::getPosition(double * x, double * y, double * z) if (m_is_static) { 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 {