mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 21:45:33 +00:00
Use a ConstPtr for the ActorMap and ObjectMap
This commit is contained in:
parent
7a8a7e3dd6
commit
795032621c
3 changed files with 12 additions and 7 deletions
|
@ -31,7 +31,12 @@ namespace MWPhysics
|
||||||
mPtr = updated;
|
mPtr = updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
MWWorld::Ptr getPtr() const
|
MWWorld::Ptr getPtr()
|
||||||
|
{
|
||||||
|
return mPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
MWWorld::ConstPtr getPtr() const
|
||||||
{
|
{
|
||||||
return mPtr;
|
return mPtr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -409,7 +409,7 @@ namespace MWPhysics
|
||||||
&& tracer.mHitObject->getBroadphaseHandle()->m_collisionFilterGroup != CollisionType_Actor)
|
&& tracer.mHitObject->getBroadphaseHandle()->m_collisionFilterGroup != CollisionType_Actor)
|
||||||
{
|
{
|
||||||
const btCollisionObject* standingOn = tracer.mHitObject;
|
const btCollisionObject* standingOn = tracer.mHitObject;
|
||||||
const PtrHolder* ptrHolder = static_cast<PtrHolder*>(standingOn->getUserPointer());
|
PtrHolder* ptrHolder = static_cast<PtrHolder*>(standingOn->getUserPointer());
|
||||||
if (ptrHolder)
|
if (ptrHolder)
|
||||||
standingCollisionTracker[ptr] = ptrHolder->getPtr();
|
standingCollisionTracker[ptr] = ptrHolder->getPtr();
|
||||||
|
|
||||||
|
@ -801,7 +801,7 @@ namespace MWPhysics
|
||||||
|
|
||||||
if (resultCallback.mObject)
|
if (resultCallback.mObject)
|
||||||
{
|
{
|
||||||
const PtrHolder* holder = static_cast<const PtrHolder*>(resultCallback.mObject->getUserPointer());
|
PtrHolder* holder = static_cast<PtrHolder*>(resultCallback.mObject->getUserPointer());
|
||||||
if (holder)
|
if (holder)
|
||||||
return std::make_pair(holder->getPtr(), toOsg(resultCallback.mContactPoint));
|
return std::make_pair(holder->getPtr(), toOsg(resultCallback.mContactPoint));
|
||||||
}
|
}
|
||||||
|
@ -1020,7 +1020,7 @@ namespace MWPhysics
|
||||||
if (collisionObject == mTestedAgainst)
|
if (collisionObject == mTestedAgainst)
|
||||||
collisionObject = col1;
|
collisionObject = col1;
|
||||||
#endif
|
#endif
|
||||||
const PtrHolder* holder = static_cast<const PtrHolder*>(collisionObject->getUserPointer());
|
PtrHolder* holder = static_cast<PtrHolder*>(collisionObject->getUserPointer());
|
||||||
if (holder)
|
if (holder)
|
||||||
mResult.push_back(holder->getPtr());
|
mResult.push_back(holder->getPtr());
|
||||||
return 0.f;
|
return 0.f;
|
||||||
|
@ -1303,7 +1303,7 @@ namespace MWPhysics
|
||||||
// Slow fall reduces fall speed by a factor of (effect magnitude / 200)
|
// Slow fall reduces fall speed by a factor of (effect magnitude / 200)
|
||||||
float slowFall = 1.f - std::max(0.f, std::min(1.f, effects.get(ESM::MagicEffect::SlowFall).getMagnitude() * 0.005f));
|
float slowFall = 1.f - std::max(0.f, std::min(1.f, effects.get(ESM::MagicEffect::SlowFall).getMagnitude() * 0.005f));
|
||||||
|
|
||||||
osg::Vec3f newpos = MovementSolver::move(iter->first, physicActor, iter->second, mTimeAccum,
|
osg::Vec3f newpos = MovementSolver::move(physicActor->getPtr(), physicActor, iter->second, mTimeAccum,
|
||||||
world->isFlying(iter->first),
|
world->isFlying(iter->first),
|
||||||
waterlevel, slowFall, mCollisionWorld, mStandingCollisions);
|
waterlevel, slowFall, mCollisionWorld, mStandingCollisions);
|
||||||
|
|
||||||
|
|
|
@ -170,12 +170,12 @@ namespace MWPhysics
|
||||||
|
|
||||||
std::auto_ptr<Resource::BulletShapeManager> mShapeManager;
|
std::auto_ptr<Resource::BulletShapeManager> mShapeManager;
|
||||||
|
|
||||||
typedef std::map<MWWorld::Ptr, Object*> ObjectMap;
|
typedef std::map<MWWorld::ConstPtr, Object*> ObjectMap;
|
||||||
ObjectMap mObjects;
|
ObjectMap mObjects;
|
||||||
|
|
||||||
std::set<Object*> mAnimatedObjects; // stores pointers to elements in mObjects
|
std::set<Object*> mAnimatedObjects; // stores pointers to elements in mObjects
|
||||||
|
|
||||||
typedef std::map<MWWorld::Ptr, Actor*> ActorMap;
|
typedef std::map<MWWorld::ConstPtr, Actor*> ActorMap;
|
||||||
ActorMap mActors;
|
ActorMap mActors;
|
||||||
|
|
||||||
typedef std::map<std::pair<int, int>, HeightField*> HeightFieldMap;
|
typedef std::map<std::pair<int, int>, HeightField*> HeightFieldMap;
|
||||||
|
|
Loading…
Reference in a new issue