[Solved] How to get Collision between two scene nodes?
Posted: Tue May 19, 2009 10:00 pm
Hello,
I'm trying to get the current collision state between two scene nodes( aniamted meshs x camera and anim mesh x anim mesh) so i can say what happens when they collide. I want to do something like this.:
i tried teamAlpha's code but i didnt seem to work..:
Thanks!!
PS: This is NOT about triangle selectors, metaselectors or CollisionResponseAnimators............
I'm trying to get the current collision state between two scene nodes( aniamted meshs x camera and anim mesh x anim mesh) so i can say what happens when they collide. I want to do something like this.:
Code: Select all
if( a->isColliding(b))
{// do something }
and irrlicht doesnt seem to have some sort of isColiding method....Code: Select all
static inline bool isInsidePoint(ISceneNode* a, ISceneNode* b) { //temp a->updateAbsolutePosition(); b->updateAbsolutePosition(); return a->getTransformedBoundingBox().isPointTotalInside(b->getPosition()); } static inline bool collidesWith(ISceneNode* a, ISceneNode* b) { //temp a->updateAbsolutePosition(); b->updateAbsolutePosition(); return a->getTransformedBoundingBox().intersectsWithBox(b->getTransformedBoundingBox()); }
Thanks!!
PS: This is NOT about triangle selectors, metaselectors or CollisionResponseAnimators............