Calls directly MovementSolver::traceDown instead of

PhysicsSystem::traceDown before inserting into mActors.

The latter does nothing until the actor is inserted into mActors.
We can't move the call after the insertion either because then
the actor is part of the simulation, and we'd have a race.
pull/3097/head
fredzio 3 years ago
parent 8ad3d3d792
commit c1e50f530b

@ -725,8 +725,7 @@ namespace MWPhysics
auto actor = std::make_shared<Actor>(ptr, shape, mTaskScheduler.get(), canWaterWalk);
// check if Actor is on the ground or in the air
traceDown(ptr, ptr.getRefData().getPosition().asVec3(), 10.f);
MovementSolver::traceDown(ptr, ptr.getRefData().getPosition().asVec3(), actor.get(), mCollisionWorld.get(), 10);
mActors.emplace(ptr, std::move(actor));
}

Loading…
Cancel
Save