Return the last set targetVelocity rather than the current velocity as the default action made available in PhysicsActor.TargetVelocity. Doesn't change any physics operation but makes DSG work better as the targetVelocity value does not keep moving around.

0.7.5-pf-bulletsim
Robert Adams 2012-12-13 16:31:28 -08:00
parent 31d3952477
commit 469c6c000a
1 changed files with 8 additions and 5 deletions

View File

@ -250,17 +250,20 @@ namespace OpenSim.Region.Physics.Manager
public abstract Vector3 CenterOfMass { get; } public abstract Vector3 CenterOfMass { get; }
/// <summary> /// <summary>
/// Velocity of this actor. /// The desired velocity of this actor.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Setting this provides a target velocity for physics scene updates. /// Setting this provides a target velocity for physics scene updates.
/// Getting this returns the velocity calculated by physics scene updates, using factors such as target velocity, /// Getting this returns the last set target. Fetch Velocity to get the current velocity.
/// time to accelerate and collisions.
/// </remarks> /// </remarks>
protected Vector3 m_targetVelocity;
public virtual Vector3 TargetVelocity public virtual Vector3 TargetVelocity
{ {
get { return Velocity; } get { return m_targetVelocity; }
set { Velocity = value; } set {
m_targetVelocity = value;
Velocity = m_targetVelocity;
}
} }
public abstract Vector3 Velocity { get; set; } public abstract Vector3 Velocity { get; set; }