Commit a4171705 authored by Rogerborg's avatar Rogerborg

Have the collision response animator callback return the collision point, not...

Have the collision response animator callback return the collision point, not the new position for the instant node.  Thanks again to garritg for spotting this.  Test updated (to test the proper expected result!)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2119 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 9c34c592
......@@ -188,15 +188,8 @@ void CSceneNodeAnimatorCollisionResponse::animateNode(ISceneNode* node, u32 time
bool collisionConsumed = false;
CollisionPoint = pos;
if (CollisionOccurred)
{
CollisionPoint = pos;
if(CollisionCallback)
collisionConsumed = CollisionCallback->onCollision(*this);
}
if (CollisionOccurred && CollisionCallback)
collisionConsumed = CollisionCallback->onCollision(*this);
if(!collisionConsumed)
Object->setPosition(pos);
......
......@@ -108,7 +108,7 @@ bool collisionResponseAnimator(void)
// Try to move both nodes to the right of the wall.
// This one should be stopped by its animator.
testNode1->setPosition(vector3df(50, 0,0));
collisionCallback.setNextExpectedCollision(testNode1, vector3df(-15.004999f, 0, 0), false);
collisionCallback.setNextExpectedCollision(testNode1, vector3df(-5.005f, 0, 0), false);
// Whereas this one, by forcing the animator to update its target node, should be
// able to pass through the wall. (In <=1.6 it was stopped by the wall even if
......@@ -141,7 +141,7 @@ bool collisionResponseAnimator(void)
testNode2->setPosition(vector3df(-50, 0, 0));
// We'll consume this collision, so the node will actually move all the way through.
collisionCallback.setNextExpectedCollision(testNode2, vector3df(15.004999f, 0, 0), true);
collisionCallback.setNextExpectedCollision(testNode2, vector3df(5.005f, 0, 0), true);
device->run();
smgr->drawAll();
......@@ -154,7 +154,7 @@ bool collisionResponseAnimator(void)
}
// Now we'll try to move it back to the right and allow it to be stopped.
collisionCallback.setNextExpectedCollision(testNode2, vector3df(-15.004999f, 0, 0), false);
collisionCallback.setNextExpectedCollision(testNode2, vector3df(-5.005f, 0, 0), false);
testNode2->setPosition(vector3df(50, 0, 0));
device->run();
......
Test suite pass at GMT Wed Jan 21 14:53:52 2009
Test suite pass at GMT Thu Jan 22 09:54:41 2009
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment