@ -604,7 +604,9 @@ namespace MWPhysics
return object - > getCollisionObject ( ) ;
return object - > getCollisionObject ( ) ;
return nullptr ;
return nullptr ;
} ( ) ;
} ( ) ;
assert ( caster ) ;
if ( caster = = nullptr )
Log ( Debug : : Warning ) < < " No caster for projectile " < < projectileId ;
ProjectileConvexCallback resultCallback ( caster , btFrom , btTo , projectile ) ;
ProjectileConvexCallback resultCallback ( caster , btFrom , btTo , projectile ) ;
resultCallback . m_collisionFilterMask = 0xff ;
resultCallback . m_collisionFilterMask = 0xff ;
@ -695,6 +697,15 @@ namespace MWPhysics
return mProjectileId ;
return mProjectileId ;
}
}
void PhysicsSystem : : setCaster ( int projectileId , const MWWorld : : Ptr & caster )
{
const auto foundProjectile = mProjectiles . find ( projectileId ) ;
assert ( foundProjectile ! = mProjectiles . end ( ) ) ;
auto * projectile = foundProjectile - > second . get ( ) ;
projectile - > setCaster ( caster ) ;
}
bool PhysicsSystem : : toggleCollisionMode ( )
bool PhysicsSystem : : toggleCollisionMode ( )
{
{
ActorMap : : iterator found = mActors . find ( MWMechanics : : getPlayer ( ) ) ;
ActorMap : : iterator found = mActors . find ( MWMechanics : : getPlayer ( ) ) ;