|
|
|
@ -492,7 +492,7 @@ namespace MWWorld
|
|
|
|
|
return std::make_pair(true, ray.getPoint(len * test.second));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::pair<bool, Ogre::Vector3> PhysicsSystem::castRay(float mouseX, float mouseY)
|
|
|
|
|
std::pair<bool, Ogre::Vector3> PhysicsSystem::castRay(float mouseX, float mouseY, Ogre::Vector3* normal)
|
|
|
|
|
{
|
|
|
|
|
Ogre::Ray ray = mRender.getCamera()->getCameraToViewportRay(
|
|
|
|
|
mouseX,
|
|
|
|
@ -504,7 +504,7 @@ namespace MWWorld
|
|
|
|
|
_from = btVector3(from.x, from.y, from.z);
|
|
|
|
|
_to = btVector3(to.x, to.y, to.z);
|
|
|
|
|
|
|
|
|
|
std::pair<std::string, float> result = mEngine->rayTest(_from, _to);
|
|
|
|
|
std::pair<std::string, float> result = mEngine->rayTest(_from, _to, true, false, normal);
|
|
|
|
|
|
|
|
|
|
if (result.first == "")
|
|
|
|
|
return std::make_pair(false, Ogre::Vector3());
|
|
|
|
|