//!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 { .....
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?