Offset position & quaternion (Question for Tuan)

bleubleu

16-01-2007 17:10:56

Hi!

ODE has some function to offset the geometry from its body. In OgreOde, these calls have been wrapped :
  1. void Geometry::setOffsetPosition (const Ogre::Vector3 &position);[/*:m]
  2. void Geometry::setOffsetQuaternion(const Ogre::Quaternion &orientation);[/*:m]
  3. void Geometry::setOffsetWorldPosition(const Ogre::Vector3 &position); [/*:m]
  4. void Geometry::setOffsetWorldQuaternion(const Ogre::Quaternion &orientation);[/*:m][/list:u]However, the debug objects do not seem to consider the offset at all. Shouldn't they ?

    So, if I offset a geometry by some distance and some angle, the collision detection will be performed on the offset'ed geometry. For this reason, I think we should translate & rotate de debug objects to reflect these offsets.

    What do you think Tuan ?
    And are you aware of any other parameter that might affect the location of the debug geometries ?

    Mat

tuan kuranes

16-01-2007 17:47:50


However, the debug objects do not seem to consider the offset at all. Shouldn't they ?
...
What do you think Tuan ?

Indeed they should. I just forgot about those.

Patch are indeed welcome...

And are you aware of any other parameter that might affect the location of the debug geometries ?

Not that I know of.

bleubleu

16-01-2007 18:01:15

Will do this week! That and the cylinder thingy.

Mat

bleubleu

17-01-2007 02:49:12

Hi!

Turns out it almost work out of the box. the dGeomGetQuaternion() and dGeomGetPosition() already include any offset transformation that was applied to the geometry. I just have a few questions now :

1) Why is there a debug node in the OgreOdeBody class ? On a geometry I can see, but on a body ???

2) I am not sure I understand the tests in OgreOdeGeometry::setOrientation() and setPosition() methods. Why is it that when a geometry has a body or is an encapsulator (?) the debug geometry is not updated.
void Geometry::setOrientation(const Ogre::Quaternion& orientation)
{
dQuaternion q;
q[0] = (dReal)orientation.w;
q[1] = (dReal)orientation.x;
q[2] = (dReal)orientation.y;
q[3] = (dReal)orientation.z;
dGeomSetQuaternion(_geom,q);

if ((_debug_node)&& ((!getBody()) || (_encapsulator))) _debug_node->setOrientation(orientation);
}

Thanks!

Mat

tuan kuranes

17-01-2007 12:28:05

1) one node for all geometry attached to a body... that makes more sense than one node per geometry.

2) Hard to remember, but I would say : geometry without body has to render its visual debug itself (cf 1 above) and encapsulated geometry is also in need of a node to ease ode geometry transformation applying.
attached to a body node only.

eugen

26-09-2007 09:34:05

@bleubleu - have u shared the code for the changes to take the offset into account for debug objects? any patch or code snippet?