1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 06:23:52 +00:00

change the rayCasting system. It use bullet now. NOT TESTED!

This commit is contained in:
gugus 2011-02-22 20:52:05 +01:00
parent d3c1640723
commit 903f39cb50

View file

@ -67,9 +67,11 @@ std::pair<std::string, float> MWScene::getFacedHandle (MWWorld::World& world)
Ray centerRay = getCamera()->getCameraToViewportRay( Ray centerRay = getCamera()->getCameraToViewportRay(
getViewport()->getWidth()/2, getViewport()->getWidth()/2,
getViewport()->getHeight()/2); getViewport()->getHeight()/2);
btVector3 from(centerRay.getOrigin().x,centerRay.getOrigin().y,centerRay.getOrigin().z);
btVector3 to(centerRay.getPoint(1000).x,centerRay.getPoint(1000).x,centerRay.getPoint(1000).x);
// get all objects touched by the ray // get all objects touched by the ray
getRaySceneQuery()->setRay (centerRay ); /*getRaySceneQuery()->setRay (centerRay );
RaySceneQueryResult &result = getRaySceneQuery()->execute(); RaySceneQueryResult &result = getRaySceneQuery()->execute();
RaySceneQueryResult::iterator nearest = result.end(); RaySceneQueryResult::iterator nearest = result.end();
@ -102,9 +104,9 @@ std::pair<std::string, float> MWScene::getFacedHandle (MWWorld::World& world)
{ {
handle = nearest->movable->getParentSceneNode()->getName(); handle = nearest->movable->getParentSceneNode()->getName();
distance = nearest->distance; distance = nearest->distance;
} }*/
return std::pair<std::string, float>(handle, distance); return eng->rayTest(from,to);
} }
void MWScene::doPhysics (float duration, MWWorld::World& world, void MWScene::doPhysics (float duration, MWWorld::World& world,