aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
diff options
context:
space:
mode:
authorTeravus Ovares2009-03-07 07:17:43 +0000
committerTeravus Ovares2009-03-07 07:17:43 +0000
commit5a49c772ca41b92fe7b6e00858fa9add24b6d8a3 (patch)
tree449d11eb8f8be6f9b2ca090c001708a728e39b51 /OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
parent* fixes mantis 3259 (diff)
downloadopensim-SC-5a49c772ca41b92fe7b6e00858fa9add24b6d8a3.zip
opensim-SC-5a49c772ca41b92fe7b6e00858fa9add24b6d8a3.tar.gz
opensim-SC-5a49c772ca41b92fe7b6e00858fa9add24b6d8a3.tar.bz2
opensim-SC-5a49c772ca41b92fe7b6e00858fa9add24b6d8a3.tar.xz
* Making the minimum ground offset for flying a configurable offset in the OpenSim.ini. This is the code that causes you to rise off the ground when you press the fly button and attempts to keep you above ground automatically when flying in a simulator.
* minimum_ground_flight_offset, by default is 3 meters, as per Kitto Flora See OpenSim.ini.example for an example.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs13
1 files changed, 8 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index a62409c..1808fa0 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -95,8 +95,11 @@ namespace OpenSim.Region.Physics.OdePlugin
95 // taints and their non-tainted counterparts 95 // taints and their non-tainted counterparts
96 public bool m_isPhysical = false; // the current physical status 96 public bool m_isPhysical = false; // the current physical status
97 public bool m_tainted_isPhysical = false; // set when the physical status is tainted (false=not existing in physics engine, true=existing) 97 public bool m_tainted_isPhysical = false; // set when the physical status is tainted (false=not existing in physics engine, true=existing)
98 public float MinimumGroundFlightOffset = 3f;
99
98 private float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes. 100 private float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes.
99 101
102
100 private float m_buoyancy = 0f; 103 private float m_buoyancy = 0f;
101 104
102 // private CollisionLocker ode; 105 // private CollisionLocker ode;
@@ -834,12 +837,12 @@ namespace OpenSim.Region.Physics.OdePlugin
834 vec.Z += ((-1 * _parent_scene.gravityz)*m_mass); 837 vec.Z += ((-1 * _parent_scene.gravityz)*m_mass);
835 838
836 //Added for auto fly height. Kitto Flora 839 //Added for auto fly height. Kitto Flora
837 d.Vector3 pos = d.BodyGetPosition(Body); 840 //d.Vector3 pos = d.BodyGetPosition(Body);
838 float ground_height = _parent_scene.GetTerrainHeightAtXY(pos.X, pos.Y); 841 float target_altitude = _parent_scene.GetTerrainHeightAtXY(_position.X, _position.Y) + MinimumGroundFlightOffset;
839 float target_altitude = ground_height + 3.0f; // This is the min fly height 842
840 if (pos.Z < target_altitude) 843 if (_position.Z < target_altitude)
841 { 844 {
842 vec.Z += (target_altitude - pos.Z) * PID_P * 5.0f; 845 vec.Z += (target_altitude - _position.Z) * PID_P * 5.0f;
843 } 846 }
844 // end add Kitto Flora 847 // end add Kitto Flora
845 848