mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
BulletSim: clean up TargetVelocity implementation by using the default defn in the PhysicsActor base class.
This commit is contained in:
@@ -557,11 +557,12 @@ public sealed class BSCharacter : BSPhysObject
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return _velocityMotor.TargetValue;
|
return m_targetVelocity;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
DetailLog("{0},BSCharacter.setTargetVelocity,call,vel={1}", LocalID, value);
|
DetailLog("{0},BSCharacter.setTargetVelocity,call,vel={1}", LocalID, value);
|
||||||
|
m_targetVelocity = value;
|
||||||
OMV.Vector3 targetVel = value;
|
OMV.Vector3 targetVel = value;
|
||||||
if (_setAlwaysRun)
|
if (_setAlwaysRun)
|
||||||
targetVel *= BSParam.AvatarAlwaysRunFactor;
|
targetVel *= BSParam.AvatarAlwaysRunFactor;
|
||||||
@@ -591,7 +592,6 @@ public sealed class BSCharacter : BSPhysObject
|
|||||||
_velocityMotor.Reset();
|
_velocityMotor.Reset();
|
||||||
_velocityMotor.SetCurrent(_velocity);
|
_velocityMotor.SetCurrent(_velocity);
|
||||||
_velocityMotor.SetTarget(_velocity);
|
_velocityMotor.SetTarget(_velocity);
|
||||||
// Even though the motor is initialized, it's not used and the velocity goes straight into the avatar.
|
|
||||||
_velocityMotor.Enabled = false;
|
_velocityMotor.Enabled = false;
|
||||||
|
|
||||||
DetailLog("{0},BSCharacter.setVelocity,taint,vel={1}", LocalID, _velocity);
|
DetailLog("{0},BSCharacter.setVelocity,taint,vel={1}", LocalID, _velocity);
|
||||||
|
|||||||
@@ -190,18 +190,6 @@ public abstract class BSPhysObject : PhysicsActor
|
|||||||
public abstract OMV.Quaternion RawOrientation { get; set; }
|
public abstract OMV.Quaternion RawOrientation { get; set; }
|
||||||
public abstract OMV.Quaternion ForceOrientation { get; set; }
|
public abstract OMV.Quaternion ForceOrientation { get; set; }
|
||||||
|
|
||||||
// The system is telling us the velocity it wants to move at.
|
|
||||||
// Velocity in world coordinates.
|
|
||||||
// protected OMV.Vector3 m_targetVelocity; // use the definition in PhysicsActor
|
|
||||||
public override OMV.Vector3 TargetVelocity
|
|
||||||
{
|
|
||||||
get { return m_targetVelocity; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
m_targetVelocity = value;
|
|
||||||
Velocity = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public virtual float TargetSpeed
|
public virtual float TargetSpeed
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
Reference in New Issue
Block a user