Page 1 of 1
Is model collided with model
Posted: Sat Dec 23, 2006 6:21 pm
by reiskaG
My first language is finnish...
I can't find anything good from this forum to solve this problem. I have MetaTriangleSelector which has two TriangleSelectors and I have CollisionResponseAnimator. I want to know if the other TriangleSelector and camera collide.
Posted: Sat Dec 23, 2006 6:38 pm
by Xharock
You need to apply a Collision Animator to the camera using the second TriangleSelector.
Posted: Sat Dec 23, 2006 6:52 pm
by reiskaG
Hmm, I mean need something like this.
Code: Select all
if (collisiondetected(selector, camera))
{
hit()
}
Posted: Sat Dec 23, 2006 7:45 pm
by vitek
ISceneCollisionManager::getCollisionResultPosition() can help. It will give you the new position of a moving sphere. If a collision occured, the position returned would be different than the position that you passed in.
You could also copy/paste the CCollisionManager::collideWithWorld() method and modify it to fit your needs.
If your selector represents a single convex object, you could just do a bounding box collision test.
Travis
Posted: Sat Dec 23, 2006 9:43 pm
by reiskaG
And how this bounding box collision test works?