Collision not detected

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
random
Posts: 158
Joined: Wed Aug 11, 2010 6:01 am

Collision not detected

Post by random »

I have a problem regarding collision detection.

//!Collisiondetection

Code: Select all

.....
enum
{
    // I use this ISceneNode ID to indicate a scene node that is
    // not pickable by getSceneNodeAndCollisionPointFromRay()
    ID_IsNotPickable = 0,

    // I use this flag in ISceneNode IDs to indicate that the
    // scene node can be picked by ray selection.
    IDFlag_IsPickable = 1 << 0,

    // I use this flag in ISceneNode IDs to indicate that the
    // scene node can be highlighted.  In this example, the
    // homonids can be highlighted, but the level mesh can't.
    IDFlag_IsHighlightable = 1 << 1
};
...
myShip = mgr->addOctreeSceneNode(shipMesh, this, IDFlag_IsPickable);
...
    selector_myShip = mgr->createOctreeTriangleSelector(myShip_Node->getMesh(), myShip_Node);
    myShip_Node->setTriangleSelector(selector_myShip);
    selector_myShip->drop();
...
myCollisionManager = mgr->getSceneCollisionManager();
...
if (myCollisionManager->getCollisionPoint  ( scanlineCollision, selector_myShip, outCollisionPoint, outTriangle, outNode))
                    {
....
                    } else { .....
the code should be ok because it works in the most cases, please tell me if not.

But it happens that the scanlineCollision.start is INSIDE myShip_Node while the scanlineCollision.end is far away outside at the other end of myShip_Node.

I would have thought that a collision would also be detected when the startpoint is inside the mesh but it is not.

is there a regular way to get rid of this?
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

normals...

you can write your own collision detection, or quickhack would be to have the spaceship using double sided faces.
agamemnus
Posts: 283
Joined: Sun Jan 31, 2010 6:06 pm

Post by agamemnus »

Hmm...

Why would a triangle selector not work for the other side? Is there a reason for this? I don't see how a ray-triangle intersection function could be based on whether a triangle is drawn clockwise or counterclockwise.
agamemnus
Posts: 283
Joined: Sun Jan 31, 2010 6:06 pm

Post by agamemnus »

Anyone? Bueller? :)
Tarzan02
Posts: 93
Joined: Tue May 01, 2007 8:36 pm
Location: France

Post by Tarzan02 »

High

i've got the same problem with a 3d model, sometime the camera fly through the model no collision is detected. It happens when 2 triangles are allmost coplanar (i hope the sentence is corrected). I'm investing to see where is the mistake. When i change the problematic triangle => collision detected, very strange.I'll post my search in this subject.

I've tried several physics engine => irrlicht is for me the best (trying to land a fighter in an capital ship so the mesh is not convex (only irrlicht can handle this configuration with ellipsoid great work).
Post Reply