Add config option to plant avatar where they are reducing avatar avatar 'pushability' av_planted see OpenSimDefaults.ini. Use when you have unruly visitors that rudely push each other around. Still allows a small amount of movement based on the avatar movement PID controller settings. You can increase the spring tension in the PID controller and really prevent any movement if you would like.

connector_plugin
teravus 2012-10-09 09:26:11 -04:00
parent ef3cc2e507
commit 764270a0d8
3 changed files with 15 additions and 3 deletions

View File

@ -100,7 +100,7 @@ namespace OpenSim.Region.Physics.OdePlugin
private bool m_hackSentFly = false; private bool m_hackSentFly = false;
private int m_requestedUpdateFrequency = 0; private int m_requestedUpdateFrequency = 0;
private Vector3 m_taintPosition; private Vector3 m_taintPosition;
internal bool m_avatarplanted = false;
/// <summary> /// <summary>
/// Hold set forces so we can process them outside physics calculations. This prevents race conditions if we set force /// Hold set forces so we can process them outside physics calculations. This prevents race conditions if we set force
/// while calculatios are going on /// while calculatios are going on
@ -413,7 +413,7 @@ namespace OpenSim.Region.Physics.OdePlugin
set set
{ {
m_iscollidingObj = value; m_iscollidingObj = value;
if (value) if (value && !m_avatarplanted)
m_pidControllerActive = false; m_pidControllerActive = false;
else else
m_pidControllerActive = true; m_pidControllerActive = true;

View File

@ -501,6 +501,8 @@ namespace OpenSim.Region.Physics.OdePlugin
public int physics_logging_interval = 0; public int physics_logging_interval = 0;
public bool physics_logging_append_existing_logfile = false; public bool physics_logging_append_existing_logfile = false;
private bool avplanted = false;
public d.Vector3 xyz = new d.Vector3(128.1640f, 128.3079f, 25.7600f); public d.Vector3 xyz = new d.Vector3(128.1640f, 128.3079f, 25.7600f);
public d.Vector3 hpr = new d.Vector3(125.5000f, -17.0000f, 0.0000f); public d.Vector3 hpr = new d.Vector3(125.5000f, -17.0000f, 0.0000f);
@ -644,6 +646,8 @@ namespace OpenSim.Region.Physics.OdePlugin
avMovementDivisorWalk = physicsconfig.GetFloat("av_movement_divisor_walk", 1.3f); avMovementDivisorWalk = physicsconfig.GetFloat("av_movement_divisor_walk", 1.3f);
avMovementDivisorRun = physicsconfig.GetFloat("av_movement_divisor_run", 0.8f); avMovementDivisorRun = physicsconfig.GetFloat("av_movement_divisor_run", 0.8f);
avCapRadius = physicsconfig.GetFloat("av_capsule_radius", 0.37f); avCapRadius = physicsconfig.GetFloat("av_capsule_radius", 0.37f);
avplanted = physicsconfig.GetBoolean("av_planted", false);
IsAvCapsuleTilted = physicsconfig.GetBoolean("av_capsule_tilted", false); IsAvCapsuleTilted = physicsconfig.GetBoolean("av_capsule_tilted", false);
contactsPerCollision = physicsconfig.GetInt("contacts_per_collision", 80); contactsPerCollision = physicsconfig.GetInt("contacts_per_collision", 80);
@ -1972,6 +1976,7 @@ namespace OpenSim.Region.Physics.OdePlugin
newAv.Flying = isFlying; newAv.Flying = isFlying;
newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset; newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset;
newAv.m_avatarplanted = avplanted;
return newAv; return newAv;
} }
@ -1987,6 +1992,7 @@ namespace OpenSim.Region.Physics.OdePlugin
internal void AddCharacter(OdeCharacter chr) internal void AddCharacter(OdeCharacter chr)
{ {
chr.m_avatarplanted = avplanted;
if (!_characters.Contains(chr)) if (!_characters.Contains(chr))
{ {
_characters.Add(chr); _characters.Add(chr);

View File

@ -844,6 +844,12 @@
; When the avatar flies, it will be moved up by this amount off the ground (in meters) ; When the avatar flies, it will be moved up by this amount off the ground (in meters)
minimum_ground_flight_offset = 3.0 minimum_ground_flight_offset = 3.0
; Plant avatar. This reduces the effect of physical contacts with the avatar.
; If you have a group of unruly and rude visitors that bump each other, turn this on to make that less attractive.
; The avatar still allows a small movement based on the PID settings above. Stronger PID settings AND this active
; will lock the avatar in place
av_planted = false
; ## ; ##
; ## Object options ; ## Object options
; ## ; ##