diff options
author | Robert Adams | 2012-08-17 13:26:18 -0700 |
---|---|---|
committer | Robert Adams | 2012-08-17 13:34:20 -0700 |
commit | 5c192b9bab4eb3e921f54a94125215c3683f2eca (patch) | |
tree | 7891ae31aaa81debdd175f121c06a2de819891ad | |
parent | BulletSim: add parameters and functionality to specify the mesh (diff) | |
download | opensim-SC_OLD-5c192b9bab4eb3e921f54a94125215c3683f2eca.zip opensim-SC_OLD-5c192b9bab4eb3e921f54a94125215c3683f2eca.tar.gz opensim-SC_OLD-5c192b9bab4eb3e921f54a94125215c3683f2eca.tar.bz2 opensim-SC_OLD-5c192b9bab4eb3e921f54a94125215c3683f2eca.tar.xz |
Modify order of code so SOP doesn't set the physics actor flying
property multiple times every time Update is called.
This eliminates zillions of settings which is better for BulletSim.
The should be no functionality change.
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 548dfd3..98afb75 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1385,17 +1385,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
1385 | bool DCFlagKeyPressed = false; | 1385 | bool DCFlagKeyPressed = false; |
1386 | Vector3 agent_control_v3 = Vector3.Zero; | 1386 | Vector3 agent_control_v3 = Vector3.Zero; |
1387 | 1387 | ||
1388 | bool oldflying = Flying; | 1388 | bool newFlying = actor.Flying; |
1389 | 1389 | ||
1390 | if (ForceFly) | 1390 | if (ForceFly) |
1391 | actor.Flying = true; | 1391 | newFlying = true; |
1392 | else if (FlyDisabled) | 1392 | else if (FlyDisabled) |
1393 | actor.Flying = false; | 1393 | newFlying = false; |
1394 | else | 1394 | else |
1395 | actor.Flying = ((flags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); | 1395 | newFlying = ((flags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); |
1396 | 1396 | ||
1397 | if (actor.Flying != oldflying) | 1397 | if (actor.Flying != newFlying) |
1398 | update_movementflag = true; | 1398 | { |
1399 | // Note: ScenePresence.Flying is actually fetched from the physical actor | ||
1400 | // so setting PhysActor.Flying here also sets the ScenePresence's value. | ||
1401 | actor.Flying = newFlying; | ||
1402 | update_movementflag = true; | ||
1403 | } | ||
1399 | 1404 | ||
1400 | if (ParentID == 0) | 1405 | if (ParentID == 0) |
1401 | { | 1406 | { |