but i have problem when my object move around, the collision is wrong, maybe because it's using aabb algorithm.
this is my collision code
Code: Select all
bool collision(scene::ISceneNode *other)
{
if(colModel->getTransformedBoundingBox().intersectsWithBox(other->getTransformedBoundingBox()))
return true;
return false;
}
.
.
.
irr::core::list<Obstacle*>::Iterator it = obstacle.begin();
while(it!=obstacle.end() && flag == false)
{
Obstacle *objek = *it;
flag = player->collision(objek->colModel);
++it;
}
if( flag == true )
player->pos = before;
how can i implement this using octtree?
the tut explain about using ray, but i want to use the mesh for collision detection. how do i know when a collision detected, so i can make the object stopped.