* 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.
0.6.4-rc1
Teravus Ovares 2009-03-07 07:17:43 +00:00
parent 6c7151109b
commit 5a49c772ca
3 changed files with 14 additions and 5 deletions

View File

@ -95,8 +95,11 @@ namespace OpenSim.Region.Physics.OdePlugin
// taints and their non-tainted counterparts
public bool m_isPhysical = false; // the current physical status
public bool m_tainted_isPhysical = false; // set when the physical status is tainted (false=not existing in physics engine, true=existing)
public float MinimumGroundFlightOffset = 3f;
private float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes.
private float m_buoyancy = 0f;
// private CollisionLocker ode;
@ -834,12 +837,12 @@ namespace OpenSim.Region.Physics.OdePlugin
vec.Z += ((-1 * _parent_scene.gravityz)*m_mass);
//Added for auto fly height. Kitto Flora
d.Vector3 pos = d.BodyGetPosition(Body);
float ground_height = _parent_scene.GetTerrainHeightAtXY(pos.X, pos.Y);
float target_altitude = ground_height + 3.0f; // This is the min fly height
if (pos.Z < target_altitude)
//d.Vector3 pos = d.BodyGetPosition(Body);
float target_altitude = _parent_scene.GetTerrainHeightAtXY(_position.X, _position.Y) + MinimumGroundFlightOffset;
if (_position.Z < target_altitude)
{
vec.Z += (target_altitude - pos.Z) * PID_P * 5.0f;
vec.Z += (target_altitude - _position.Z) * PID_P * 5.0f;
}
// end add Kitto Flora

View File

@ -181,6 +181,7 @@ namespace OpenSim.Region.Physics.OdePlugin
private float avHeightFudgeFactor = 0.52f;
private float avMovementDivisorWalk = 1.3f;
private float avMovementDivisorRun = 0.8f;
private float minimumGroundFlightOffset = 3f;
public bool meshSculptedPrim = true;
@ -432,6 +433,7 @@ namespace OpenSim.Region.Physics.OdePlugin
physics_logging_append_existing_logfile = physicsconfig.GetBoolean("physics_logging_append_existing_logfile", false);
m_NINJA_physics_joints_enabled = physicsconfig.GetBoolean("use_NINJA_physics_joints", false);
minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", 3f);
}
}
@ -1336,6 +1338,7 @@ namespace OpenSim.Region.Physics.OdePlugin
pos.Z = position.Z;
OdeCharacter newAv = new OdeCharacter(avName, this, pos, ode, size, avPIDD, avPIDP, avCapRadius, avStandupTensor, avDensity, avHeightFudgeFactor, avMovementDivisorWalk, avMovementDivisorRun);
newAv.Flying = isFlying;
newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset;
_characters.Add(newAv);
return newAv;
}

View File

@ -463,6 +463,9 @@ InterregionComms = "RESTComms"
; speed of movement with Always Run on
av_movement_divisor_run = 0.8
; When the avatar flies, it will be moved up by this amount off the ground (in meters)
minimum_ground_flight_offset = 3.0
; ##
; ## Object options
; ##