diff options
author | Robert Adams | 2013-04-09 17:53:18 -0700 |
---|---|---|
committer | Robert Adams | 2013-04-09 18:00:29 -0700 |
commit | 5f2cbfc0fd27198f8f05f4a9a4e2908d8b11752e (patch) | |
tree | 36598faf82f03c50d70f6909e78162ce14589901 /OpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs | |
parent | BulletSim: some formatting changes. (diff) | |
download | opensim-SC_OLD-5f2cbfc0fd27198f8f05f4a9a4e2908d8b11752e.zip opensim-SC_OLD-5f2cbfc0fd27198f8f05f4a9a4e2908d8b11752e.tar.gz opensim-SC_OLD-5f2cbfc0fd27198f8f05f4a9a4e2908d8b11752e.tar.bz2 opensim-SC_OLD-5f2cbfc0fd27198f8f05f4a9a4e2908d8b11752e.tar.xz |
BulletSim: fixing problems with llMoveToTarget. Not all fixed yet.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs b/OpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs index 16c2b14..56aacc5 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs | |||
@@ -50,7 +50,7 @@ public class BSActorMoveToTarget : BSActor | |||
50 | // BSActor.isActive | 50 | // BSActor.isActive |
51 | public override bool isActive | 51 | public override bool isActive |
52 | { | 52 | { |
53 | get { return Enabled && m_controllingPrim.IsPhysicallyActive; } | 53 | get { return Enabled; } |
54 | } | 54 | } |
55 | 55 | ||
56 | // Release any connections and resources used by the actor. | 56 | // Release any connections and resources used by the actor. |
@@ -65,7 +65,9 @@ public class BSActorMoveToTarget : BSActor | |||
65 | // BSActor.Refresh() | 65 | // BSActor.Refresh() |
66 | public override void Refresh() | 66 | public override void Refresh() |
67 | { | 67 | { |
68 | m_physicsScene.DetailLog("{0},BSActorMoveToTarget,refresh", m_controllingPrim.LocalID); | 68 | m_physicsScene.DetailLog("{0},BSActorMoveToTarget,refresh,enabled={1},active={2},target={3},tau={4}", |
69 | m_controllingPrim.LocalID, Enabled, m_controllingPrim.MoveToTargetActive, | ||
70 | m_controllingPrim.MoveToTargetTarget, m_controllingPrim.MoveToTargetTau ); | ||
69 | 71 | ||
70 | // If not active any more... | 72 | // If not active any more... |
71 | if (!m_controllingPrim.MoveToTargetActive) | 73 | if (!m_controllingPrim.MoveToTargetActive) |
@@ -100,7 +102,7 @@ public class BSActorMoveToTarget : BSActor | |||
100 | // We're taking over after this. | 102 | // We're taking over after this. |
101 | m_controllingPrim.ZeroMotion(true); | 103 | m_controllingPrim.ZeroMotion(true); |
102 | 104 | ||
103 | m_targetMotor = new BSVMotor("BSPrim.PIDTarget", | 105 | m_targetMotor = new BSVMotor("BSActorMoveToTargget.Activate", |
104 | m_controllingPrim.MoveToTargetTau, // timeScale | 106 | m_controllingPrim.MoveToTargetTau, // timeScale |
105 | BSMotor.Infinite, // decay time scale | 107 | BSMotor.Infinite, // decay time scale |
106 | BSMotor.InfiniteVector, // friction timescale | 108 | BSMotor.InfiniteVector, // friction timescale |
@@ -138,15 +140,19 @@ public class BSActorMoveToTarget : BSActor | |||
138 | // If we are very close to our target, turn off the movement motor. | 140 | // If we are very close to our target, turn off the movement motor. |
139 | if (m_targetMotor.ErrorIsZero()) | 141 | if (m_targetMotor.ErrorIsZero()) |
140 | { | 142 | { |
141 | m_physicsScene.DetailLog("{0},BSPrim.PIDTarget,zeroMovement,movePos={1},pos={2},mass={3}", | 143 | m_physicsScene.DetailLog("{0},BSActorMoveToTarget.Mover,zeroMovement,movePos={1},pos={2},mass={3}", |
142 | m_controllingPrim.LocalID, movePosition, m_controllingPrim.RawPosition, m_controllingPrim.Mass); | 144 | m_controllingPrim.LocalID, movePosition, m_controllingPrim.RawPosition, m_controllingPrim.Mass); |
143 | m_controllingPrim.ForcePosition = m_targetMotor.TargetValue; | 145 | m_controllingPrim.ForcePosition = m_targetMotor.TargetValue; |
146 | // Setting the position does not cause the physics engine to generate a property update. Force it. | ||
147 | m_physicsScene.PE.PushUpdate(m_controllingPrim.PhysBody); | ||
144 | } | 148 | } |
145 | else | 149 | else |
146 | { | 150 | { |
147 | m_controllingPrim.ForcePosition = movePosition; | 151 | m_controllingPrim.ForcePosition = movePosition; |
152 | // Setting the position does not cause the physics engine to generate a property update. Force it. | ||
153 | m_physicsScene.PE.PushUpdate(m_controllingPrim.PhysBody); | ||
148 | } | 154 | } |
149 | m_physicsScene.DetailLog("{0},BSPrim.PIDTarget,move,fromPos={1},movePos={2}", m_controllingPrim.LocalID, origPosition, movePosition); | 155 | m_physicsScene.DetailLog("{0},BSActorMoveToTarget.Mover,move,fromPos={1},movePos={2}", m_controllingPrim.LocalID, origPosition, movePosition); |
150 | } | 156 | } |
151 | } | 157 | } |
152 | } | 158 | } |