mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-08 09:37:53 +00:00
Allow an Object to be specified as ignore parameter for castRay
This commit is contained in:
parent
76b47c6d5d
commit
910e41e3c4
@ -557,6 +557,11 @@ namespace MWPhysics
|
||||
return mCollisionObject.get();
|
||||
}
|
||||
|
||||
const btCollisionObject* getCollisionObject() const
|
||||
{
|
||||
return mCollisionObject.get();
|
||||
}
|
||||
|
||||
/// Return solid flag. Not used by the object itself, true by default.
|
||||
bool isSolid() const
|
||||
{
|
||||
@ -883,6 +888,12 @@ namespace MWPhysics
|
||||
const Actor* actor = getActor(ignore);
|
||||
if (actor)
|
||||
me = actor->getCollisionObject();
|
||||
else
|
||||
{
|
||||
const Object* object = getObject(ignore);
|
||||
if (object)
|
||||
me = object->getCollisionObject();
|
||||
}
|
||||
}
|
||||
|
||||
ClosestNotMeRayResultCallback resultCallback(me, btFrom, btTo);
|
||||
@ -1174,6 +1185,14 @@ namespace MWPhysics
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const Object* PhysicsSystem::getObject(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
ObjectMap::const_iterator found = mObjects.find(ptr);
|
||||
if (found != mObjects.end())
|
||||
return found->second;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void PhysicsSystem::updateScale(const MWWorld::Ptr &ptr)
|
||||
{
|
||||
ObjectMap::iterator found = mObjects.find(ptr);
|
||||
|
@ -70,6 +70,8 @@ namespace MWPhysics
|
||||
Actor* getActor(const MWWorld::Ptr& ptr);
|
||||
const Actor* getActor(const MWWorld::ConstPtr& ptr) const;
|
||||
|
||||
const Object* getObject(const MWWorld::ConstPtr& ptr) const;
|
||||
|
||||
// Object or Actor
|
||||
void remove (const MWWorld::Ptr& ptr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user