problem ellipsoid translation.

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
moriwo
Posts: 40
Joined: Fri Jul 04, 2008 9:29 pm

problem ellipsoid translation.

Post by moriwo »

I have the part that cannot be understood about createCollisionResponseAnimator.

This code, mesh fits ground.This appearance is correct.

Code: Select all

ISceneNodeAnimator* anim =Scene->createCollisionResponseAnimator(
	selector, meshNode, vector3df(0.5f,0.8f,0.5f), vector3df(0,-.5,0), vector3df(0.0f,-0.8f,0.0f));
This code, mesh is in the air.This appearance is not correct.

Code: Select all

ISceneNodeAnimator* anim =Scene->createCollisionResponseAnimator(
	selector, meshNode, vector3df(0.5f,0.8f,0.5f), vector3df(0,-.5,0), vector3df(0.0f,0.8f,0.0f));
The difference is a value of "ellipsoid translation".
I think that these results are opposite.

Upvector of my scene is (x,y,z) = (0,1,0).

The height of meshNode is 1.6
and the center(mesh origin) exists in the foot(Y=0).

so, I think ellipseoid center have to move to Y:+0.8.
it is not -0.8!!! because UpVector of this scene is (x,y,z)=(0, +1, 0).


I can't understand the sign is opposite.
How do you think this problem?

Image
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

Breaking news: It's not the ellipsoid that is moved with the translation, but the node! I checked Irrlicht's source and it works like this:

The collision spehere is moved and it returns the new possible position of the node. After finding the position, the translation is added to the new position vector and it is set to the node. So, it's not the ellipsoid that is moved against the node, but the opposite way. I think this should be mentioned in the manual more clearly.

Irrlicht source:

Code: Select all

...

pos = SceneManager->getSceneCollisionManager()->getCollisionResultPosition(
				World, LastPosition-Translation,
				Radius, vel, triangle, f, SlidingSpeed, g);

pos += Translation;

Object->setPosition(pos);
...
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

It's never occurred to me before, but that is indeed bass ackwards. I'd plump for just reversing it in SVN / 1.5 so that the translation is in the natural direction.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply