When doing a ray cast to the next projectile position, ignore collisions

that occurs with the projectile own collision object. Otherwise a magic
bolt can explode "spontaneously".
pull/3041/head
fredzio 4 years ago
parent 884b434ee0
commit 259d522800

@ -24,6 +24,10 @@ namespace MWPhysics
{
if (rayResult.m_collisionObject == mMe)
return 1.f;
if (mProjectile && rayResult.m_collisionObject == mProjectile->getCollisionObject())
return 1.f;
if (!mTargets.empty())
{
if ((std::find(mTargets.begin(), mTargets.end(), rayResult.m_collisionObject) == mTargets.end()))

Loading…
Cancel
Save