aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs19
1 files changed, 14 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs
index a7dda7a..3c952ae 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs
@@ -137,6 +137,7 @@ namespace OpenSim.Region.Physics.OdePlugin
137 float m_amdampY; 137 float m_amdampY;
138 float m_amdampZ; 138 float m_amdampZ;
139 139
140 float m_gravmod;
140 141
141 public float FrictionFactor 142 public float FrictionFactor
142 { 143 {
@@ -146,6 +147,14 @@ namespace OpenSim.Region.Physics.OdePlugin
146 } 147 }
147 } 148 }
148 149
150 public float GravMod
151 {
152 set
153 {
154 m_gravmod = value;
155 }
156 }
157
149 158
150 public ODEDynamics(OdePrim rootp) 159 public ODEDynamics(OdePrim rootp)
151 { 160 {
@@ -153,6 +162,7 @@ namespace OpenSim.Region.Physics.OdePlugin
153 _pParentScene = rootPrim._parent_scene; 162 _pParentScene = rootPrim._parent_scene;
154 m_timestep = _pParentScene.ODE_STEPSIZE; 163 m_timestep = _pParentScene.ODE_STEPSIZE;
155 m_invtimestep = 1.0f / m_timestep; 164 m_invtimestep = 1.0f / m_timestep;
165 m_gravmod = rootPrim.GravModifier;
156 } 166 }
157 167
158 public void DoSetVehicle(VehicleData vd) 168 public void DoSetVehicle(VehicleData vd)
@@ -816,7 +826,7 @@ namespace OpenSim.Region.Physics.OdePlugin
816 m_lmEfect = 0; 826 m_lmEfect = 0;
817 m_ffactor = 1f; 827 m_ffactor = 1f;
818 } 828 }
819 829
820 // hover 830 // hover
821 if (m_VhoverTimescale < 300 && rootPrim.prim_geom != IntPtr.Zero) 831 if (m_VhoverTimescale < 300 && rootPrim.prim_geom != IntPtr.Zero)
822 { 832 {
@@ -862,7 +872,7 @@ namespace OpenSim.Region.Physics.OdePlugin
862 force.Z += perr; 872 force.Z += perr;
863 ldampZ *= -curVel.Z; 873 ldampZ *= -curVel.Z;
864 874
865 force.Z += _pParentScene.gravityz * (1f - m_VehicleBuoyancy); 875 force.Z += _pParentScene.gravityz * m_gravmod * (1f - m_VehicleBuoyancy);
866 } 876 }
867 else // no buoyancy 877 else // no buoyancy
868 force.Z += _pParentScene.gravityz; 878 force.Z += _pParentScene.gravityz;
@@ -870,7 +880,7 @@ namespace OpenSim.Region.Physics.OdePlugin
870 else 880 else
871 { 881 {
872 // default gravity and Buoyancy 882 // default gravity and Buoyancy
873 force.Z += _pParentScene.gravityz * (1f - m_VehicleBuoyancy); 883 force.Z += _pParentScene.gravityz * m_gravmod * (1f - m_VehicleBuoyancy);
874 } 884 }
875 885
876 // linear deflection 886 // linear deflection
@@ -1063,8 +1073,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1063 torque.Y -= curLocalAngVel.Y * m_amdampY; 1073 torque.Y -= curLocalAngVel.Y * m_amdampY;
1064 torque.Z -= curLocalAngVel.Z * m_amdampZ; 1074 torque.Z -= curLocalAngVel.Z * m_amdampZ;
1065 } 1075 }
1066 1076
1067
1068 1077
1069 if (force.X != 0 || force.Y != 0 || force.Z != 0) 1078 if (force.X != 0 || force.Y != 0 || force.Z != 0)
1070 { 1079 {