aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
authorRobert Adams2013-10-15 17:02:22 -0700
committerRobert Adams2013-10-15 17:02:22 -0700
commit766a31431e41033b9cddf5759e9b6e1b4c77682a (patch)
treeaf063e5d51907e554d9464cdc6c366887508080c /OpenSim/Region/Physics
parentFixed rezzing coalesced objects from a prim's inventory (diff)
downloadopensim-SC_OLD-766a31431e41033b9cddf5759e9b6e1b4c77682a.zip
opensim-SC_OLD-766a31431e41033b9cddf5759e9b6e1b4c77682a.tar.gz
opensim-SC_OLD-766a31431e41033b9cddf5759e9b6e1b4c77682a.tar.bz2
opensim-SC_OLD-766a31431e41033b9cddf5759e9b6e1b4c77682a.tar.xz
BulletSim: implement the SL bug where VEHICLE_HOVER_UP_ONLY disables
the vehicle buoyancy if the vehicle is above its hover height. This is a known misfeature of this vehicle flag which has been accepted since it would break too many implementations. The problem is noticed when creating a jetski-like vehicle that jumps over sand bars. A boat normally is configured with neutral buoyancy and hovering at water height. When it jumps the sandbar, it needs to have gravity applied to get back to water level.
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
index f0d17d3..7b98f9d 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
@@ -1125,7 +1125,19 @@ namespace OpenSim.Region.Physics.BulletSPlugin
1125 { 1125 {
1126 // If body is already heigher, use its height as target height 1126 // If body is already heigher, use its height as target height
1127 if (VehiclePosition.Z > m_VhoverTargetHeight) 1127 if (VehiclePosition.Z > m_VhoverTargetHeight)
1128 {
1128 m_VhoverTargetHeight = VehiclePosition.Z; 1129 m_VhoverTargetHeight = VehiclePosition.Z;
1130
1131 // A 'misfeature' of this flag is that if the vehicle is above it's hover height,
1132 // the vehicle's buoyancy goes away. This is an SL bug that got used by so many
1133 // scripts that it could not be changed.
1134 // So, if above the height, reapply gravity if buoyancy had it turned off.
1135 if (m_VehicleBuoyancy != 0)
1136 {
1137 Vector3 appliedGravity = ControllingPrim.ComputeGravity(ControllingPrim.Buoyancy) * m_vehicleMass;
1138 VehicleAddForce(appliedGravity);
1139 }
1140 }
1129 } 1141 }
1130 1142
1131 if ((m_flags & VehicleFlag.LOCK_HOVER_HEIGHT) != 0) 1143 if ((m_flags & VehicleFlag.LOCK_HOVER_HEIGHT) != 0)