My mouse acts independently from the camera, the camera is aimed at the player. The below code doesn't work, as in I don't get any hits. If I use the intersection with the line (commented out bit), though, I get tons of hits.
Code: Select all
line3d<f32> mouse3d = colmgr->getRayFromScreenCoordinates(Cursor_Position,camera);
core::line3d<f32> line;
line.start = Camera_Position;
line.end = line.start + (camera->getTarget() - line.start).normalize() * 1000.0f;
core::vector3df intersection;
core::triangle3df tri;
if(colmgr->getCollisionPoint(mouse3d, metaScene, intersection, tri))
// if (smgr->getSceneCollisionManager()->getCollisionPoint(line, metaScene, intersection, tri))
printf("Hit\n");