BulletSim: zero velocity target when setting velocity through the
SetMomentum method.melanie
parent
f3e7603c37
commit
e13fecfd3d
|
@ -350,7 +350,6 @@ public sealed class BSCharacter : BSPhysObject
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Check that the current position is sane and, if not, modify the position to make it so.
|
||||
// Check for being below terrain or on water.
|
||||
// Returns 'true' of the position was made sane by some action.
|
||||
|
@ -502,6 +501,17 @@ public sealed class BSCharacter : BSPhysObject
|
|||
}
|
||||
}
|
||||
|
||||
// SetMomentum just sets the velocity without a target. We need to stop the movement actor if a character.
|
||||
public override void SetMomentum(OMV.Vector3 momentum)
|
||||
{
|
||||
if (m_moveActor != null)
|
||||
{
|
||||
m_moveActor.SetVelocityAndTarget(OMV.Vector3.Zero, OMV.Vector3.Zero, false /* inTaintTime */);
|
||||
}
|
||||
base.SetMomentum(momentum);
|
||||
}
|
||||
|
||||
|
||||
public override OMV.Vector3 Torque {
|
||||
get { return RawTorque; }
|
||||
set { RawTorque = value;
|
||||
|
|
|
@ -625,7 +625,7 @@ public abstract class BSPhysObject : PhysicsActor
|
|||
{
|
||||
CurrentCollisionFlags = PhysScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS);
|
||||
DetailLog("{0},{1}.SubscribeEvents,setting collision. ms={2}, collisionFlags={3:x}",
|
||||
LocalID, TypeName, ms, CurrentCollisionFlags);
|
||||
LocalID, TypeName, SubscribedEventsMs, CurrentCollisionFlags);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue