aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs22
1 files changed, 10 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs b/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
index 634a898..8416740 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
@@ -67,14 +67,6 @@ public class BSActorAvatarMove : BSActor
67 { 67 {
68 m_physicsScene.DetailLog("{0},BSActorAvatarMove,refresh", m_controllingPrim.LocalID); 68 m_physicsScene.DetailLog("{0},BSActorAvatarMove,refresh", m_controllingPrim.LocalID);
69 69
70 // If not active any more, get rid of me (shouldn't ever happen, but just to be safe)
71 if (m_controllingPrim.RawForce == OMV.Vector3.Zero)
72 {
73 m_physicsScene.DetailLog("{0},BSActorAvatarMove,refresh,notAvatarMove,removing={1}", m_controllingPrim.LocalID, ActorName);
74 m_controllingPrim.PhysicalActors.RemoveAndRelease(ActorName);
75 return;
76 }
77
78 // If the object is physically active, add the hoverer prestep action 70 // If the object is physically active, add the hoverer prestep action
79 if (isActive) 71 if (isActive)
80 { 72 {
@@ -95,14 +87,19 @@ public class BSActorAvatarMove : BSActor
95 // Nothing to do for the hoverer since it is all software at pre-step action time. 87 // Nothing to do for the hoverer since it is all software at pre-step action time.
96 } 88 }
97 89
90 // Usually called when target velocity changes to set the current velocity and the target
91 // into the movement motor.
98 public void SetVelocityAndTarget(OMV.Vector3 vel, OMV.Vector3 targ, bool inTaintTime) 92 public void SetVelocityAndTarget(OMV.Vector3 vel, OMV.Vector3 targ, bool inTaintTime)
99 { 93 {
100 m_physicsScene.TaintedObject(inTaintTime, "BSActorAvatarMove.setVelocityAndTarget", delegate() 94 m_physicsScene.TaintedObject(inTaintTime, "BSActorAvatarMove.setVelocityAndTarget", delegate()
101 { 95 {
102 m_velocityMotor.Reset(); 96 if (m_velocityMotor != null)
103 m_velocityMotor.SetTarget(targ); 97 {
104 m_velocityMotor.SetCurrent(vel); 98 m_velocityMotor.Reset();
105 m_velocityMotor.Enabled = true; 99 m_velocityMotor.SetTarget(targ);
100 m_velocityMotor.SetCurrent(vel);
101 m_velocityMotor.Enabled = true;
102 }
106 }); 103 });
107 } 104 }
108 105
@@ -119,6 +116,7 @@ public class BSActorAvatarMove : BSActor
119 1f // efficiency 116 1f // efficiency
120 ); 117 );
121 // _velocityMotor.PhysicsScene = PhysicsScene; // DEBUG DEBUG so motor will output detail log messages. 118 // _velocityMotor.PhysicsScene = PhysicsScene; // DEBUG DEBUG so motor will output detail log messages.
119 SetVelocityAndTarget(m_controllingPrim.RawVelocity, m_controllingPrim.TargetVelocity, true /* inTaintTime */);
122 120
123 m_physicsScene.BeforeStep += Mover; 121 m_physicsScene.BeforeStep += Mover;
124 } 122 }