tags:

views:

13

answers:

1

In my game i'm currently working on, i only need very basic physics, so i don't want Newton, ODE, Bullet or similar. I basically only want to fall as long as no node (all equally sized blocks) is beneath me. I tried to send a ray from the camera and 100.0 units downwards. But it gives false positives.

selectedNode = NULL;

    //Falling
    ray.start = camera->getPosition();
    ray.end = vector3df(ray.start.X, ray.start.Y - 100.0f, ray.start.Z);
    selectedNode = collMan->getSceneNodeAndCollisionPointFromRay(ray, intersection, hitTriangle, PICKABLE);

    if(selectedNode)
    {
        std::cout << "ABOVE" << std::endl;
    }

I don't know why this malfunctions. I'm using Irrlicht, but that shouldn't really matter as i think the problem is realted to logics and not specifically to the renderer/engine.

+1  A: 

irrlicht has source code available. I would try tracing into the code in debug mode and see what it's doing.

Jay