Bug ? Ellipsoid Primitive

Markness

10-09-2006 00:09:54

Heyas all, ive been trying to get my character to walk smoothly up hills / over uneven terrain and found something possibly wrong.

These are the two ways ive been creating the characters physics primitive:

Example 1

OgreNewt::Collision* col = new OgreNewt::CollisionPrimitives::Ellipsoid( PhyWorld, Ogre::Vector3( 0.5, 0.5, 0.5 ), tempWynd->GetSceneNode()->getOrientation() );


Example 2

OgreNewt::Collision* col = new OgreNewt::CollisionPrimitives::Ellipsoid( PhyWorld, Ogre::Vector3( 0.5, 0.5, 0.5 ), tempWynd->GetSceneNode()->getOrientation(), Ogre::Vector3( 0.0F, 1.0F, 0.0F ) );


As you can see, the only difference is the fourth parameter 'pos' which according to the OgreNewt documentation is:

pos position offset of the primitive

So this should do little if anything to the way in which the object interacts with the world, correct?

If i use example 2 (which has a simple Y offset) the object will fall thro the ground quite often, but if i use example 1 it never falls through....

Any suggestions as to why this is happening?

walaber

10-09-2006 01:41:22

the "pos" is an offset parameter, to offset the center-of-mass of the collision object. in the case of an ellipsoid for a character, this should almost always be Vector3::ZERO. after you create the Rigid body, call setPositionOrientation() to set the world position of the body.

Markness

10-09-2006 02:03:30

Ah thanks for the explaination :)

I currently use setPositionOrientation() and pass both the position and orientation of the node iam using it with.

Even if i add an extra 20.0F onto the position parameter, the body always ends up at the exact same position :(

walaber

10-09-2006 02:30:01

sorry... I didn't read you post closely enough.

setting such a small offset should not cause the collision issues you are describing. try posting on the Newton forums, this may be a bug.

Markness

10-09-2006 02:34:12

Thanks, hey while we're on this topic, im curious as to why when i turn line drawing on, it draws the lines but they dont move with the objects, if i want to update the lines, i have to turn line drawing off, and then back on again? :D

walaber

10-09-2006 07:25:25

it just makes a mesh object drawn in wireframe.. if you don't call hideLines(), it will still be drawn on later frames.