From 469c6c000a85dafc3704b2ff053949e8588506f8 Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Thu, 13 Dec 2012 16:31:28 -0800
Subject: 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.
---
OpenSim/Region/Physics/Manager/PhysicsActor.cs | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/Physics/Manager/PhysicsActor.cs')
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
index 34413e5..d119791 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
@@ -250,17 +250,20 @@ namespace OpenSim.Region.Physics.Manager
public abstract Vector3 CenterOfMass { get; }
///
- /// Velocity of this actor.
+ /// The desired velocity of this actor.
///
///
/// 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,
- /// time to accelerate and collisions.
+ /// Getting this returns the last set target. Fetch Velocity to get the current velocity.
///
+ protected Vector3 m_targetVelocity;
public virtual Vector3 TargetVelocity
{
- get { return Velocity; }
- set { Velocity = value; }
+ get { return m_targetVelocity; }
+ set {
+ m_targetVelocity = value;
+ Velocity = m_targetVelocity;
+ }
}
public abstract Vector3 Velocity { get; set; }
--
cgit v1.1