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 | |
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')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSActorHover.cs | 2 | ||||
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs | 16 | ||||
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | 6 |
3 files changed, 18 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorHover.cs b/OpenSim/Region/Physics/BulletSPlugin/BSActorHover.cs index e8310df..92ace66 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSActorHover.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSActorHover.cs | |||
@@ -50,7 +50,7 @@ public class BSActorHover : 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. |
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 | } |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index 64bf395..98eb4ca 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |||
@@ -295,6 +295,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
295 | if (PhysicalActors.TryGetActor(actorName, out theActor)) | 295 | if (PhysicalActors.TryGetActor(actorName, out theActor)) |
296 | { | 296 | { |
297 | // The actor already exists so just turn it on or off | 297 | // The actor already exists so just turn it on or off |
298 | DetailLog("{0},BSPhysObject.EnableActor,enablingExistingActor,name={1},enable={2}", LocalID, actorName, enableActor); | ||
298 | theActor.Enabled = enableActor; | 299 | theActor.Enabled = enableActor; |
299 | } | 300 | } |
300 | else | 301 | else |
@@ -302,10 +303,15 @@ public abstract class BSPhysObject : PhysicsActor | |||
302 | // The actor does not exist. If it should, create it. | 303 | // The actor does not exist. If it should, create it. |
303 | if (enableActor) | 304 | if (enableActor) |
304 | { | 305 | { |
306 | DetailLog("{0},BSPhysObject.EnableActor,creatingActor,name={1}", LocalID, actorName); | ||
305 | theActor = creator(); | 307 | theActor = creator(); |
306 | PhysicalActors.Add(actorName, theActor); | 308 | PhysicalActors.Add(actorName, theActor); |
307 | theActor.Enabled = true; | 309 | theActor.Enabled = true; |
308 | } | 310 | } |
311 | else | ||
312 | { | ||
313 | DetailLog("{0},BSPhysObject.EnableActor,notCreatingActorSinceNotEnabled,name={1}", LocalID, actorName); | ||
314 | } | ||
309 | } | 315 | } |
310 | } | 316 | } |
311 | } | 317 | } |