1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 05:53:54 +00:00

Adjust the eye level for line of sight checks (Fixes #3407)

This commit is contained in:
scrawl 2016-05-27 17:42:17 +02:00
parent a2153a6213
commit e396e6f2ea

View file

@ -3,6 +3,7 @@
#include <stdexcept> #include <stdexcept>
#include <osg/Group> #include <osg/Group>
#include <osg/io_utils>
#include <BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h> #include <BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h>
#include <BulletCollision/CollisionShapes/btConeShape.h> #include <BulletCollision/CollisionShapes/btConeShape.h>
@ -946,8 +947,10 @@ namespace MWPhysics
if (!physactor1 || !physactor2) if (!physactor1 || !physactor2)
return false; return false;
osg::Vec3f pos1 (physactor1->getCollisionObjectPosition() + osg::Vec3f(0,0,physactor1->getHalfExtents().z() * 0.8)); // eye level osg::Vec3f pos1 (physactor1->getCollisionObjectPosition() + osg::Vec3f(0,0,physactor1->getHalfExtents().z() * 0.9)); // eye level
osg::Vec3f pos2 (physactor2->getCollisionObjectPosition() + osg::Vec3f(0,0,physactor2->getHalfExtents().z() * 0.8)); osg::Vec3f pos2 (physactor2->getCollisionObjectPosition() + osg::Vec3f(0,0,physactor2->getHalfExtents().z() * 0.9));
std::cout << "pos1 is " << pos1 << " pos2 " << pos2 << std::endl;
RayResult result = castRay(pos1, pos2, MWWorld::Ptr(), CollisionType_World|CollisionType_HeightMap|CollisionType_Door); RayResult result = castRay(pos1, pos2, MWWorld::Ptr(), CollisionType_World|CollisionType_HeightMap|CollisionType_Door);