I wanted to do raycasting on a large plane. I did this:
Code: Select all
IAnimatedMesh* planeMesh=smgr->getMesh("plane.x");
IAnimatedMeshSceneNode* planeNode=smgr->addAnimatedMeshSceneNode(planeMesh);
planeNode->setRotation(vector3df(180, 0, 0));
planeNode->setScale(vector3df(1000.0, 1, 1000.0));
planeNode->setVisible(false);
Code: Select all
ITriangleSelector* planeCollision = smgr->createTriangleSelector(planeMesh->getMesh(0), planeNode);
planeNode->setTriangleSelector(planeCollision);
planeCollision->drop();
Code: Select all
cmgr->getCollisionPoint (cmgr->getRayFromScreenCoordinates(mouse->getPosition()),
planeCollision, mousePointAt, triDump);