If calling llStopMoveToTarget() on an in-world prim, don't send an unnecessary object update if the prim was not moving to target.
This involves making PhysicsActor.PIDActive get as well as set. On physics components that don't implement this (all characters and some phys engines) we return false.mb-throttle-test
parent
bdebd525db
commit
7a2c77e7ea
|
@ -1921,12 +1921,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
PhysicsActor pa = RootPart.PhysActor;
|
PhysicsActor pa = RootPart.PhysActor;
|
||||||
|
|
||||||
if (pa != null)
|
if (pa != null && pa.PIDActive)
|
||||||
{
|
{
|
||||||
pa.PIDActive = false;
|
pa.PIDActive = false;
|
||||||
|
|
||||||
ScheduleGroupForTerseUpdate();
|
ScheduleGroupForTerseUpdate();
|
||||||
//ParentGroup.ScheduleGroupForFullUpdate();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -238,6 +238,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||||
|
|
||||||
public override bool PIDActive
|
public override bool PIDActive
|
||||||
{
|
{
|
||||||
|
get { return false; }
|
||||||
set { return; }
|
set { return; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -251,6 +251,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||||
|
|
||||||
public override bool PIDActive
|
public override bool PIDActive
|
||||||
{
|
{
|
||||||
|
get { return false; }
|
||||||
set { return; }
|
set { return; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -614,9 +614,9 @@ public sealed class BSCharacter : BSPhysObject
|
||||||
public override OMV.Vector3 PIDTarget {
|
public override OMV.Vector3 PIDTarget {
|
||||||
set { _PIDTarget = value; }
|
set { _PIDTarget = value; }
|
||||||
}
|
}
|
||||||
public override bool PIDActive {
|
|
||||||
set { _usePID = value; }
|
public override bool PIDActive { get; set; }
|
||||||
}
|
|
||||||
public override float PIDTau {
|
public override float PIDTau {
|
||||||
set { _PIDTau = value; }
|
set { _PIDTau = value; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,7 +246,12 @@ public abstract class BSPhysObject : PhysicsActor
|
||||||
|
|
||||||
public virtual bool ForceBodyShapeRebuild(bool inTaintTime) { return false; }
|
public virtual bool ForceBodyShapeRebuild(bool inTaintTime) { return false; }
|
||||||
|
|
||||||
public override bool PIDActive { set { MoveToTargetActive = value; } }
|
public override bool PIDActive
|
||||||
|
{
|
||||||
|
get { return MoveToTargetActive; }
|
||||||
|
set { MoveToTargetActive = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public override OMV.Vector3 PIDTarget { set { MoveToTargetTarget = value; } }
|
public override OMV.Vector3 PIDTarget { set { MoveToTargetTarget = value; } }
|
||||||
public override float PIDTau { set { MoveToTargetTau = value; } }
|
public override float PIDTau { set { MoveToTargetTau = value; } }
|
||||||
|
|
||||||
|
|
|
@ -1087,9 +1087,17 @@ public class BSPrim : BSPhysObject
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool PIDActive {
|
public override bool PIDActive
|
||||||
set {
|
{
|
||||||
base.MoveToTargetActive = value;
|
get
|
||||||
|
{
|
||||||
|
return MoveToTargetActive;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
MoveToTargetActive = value;
|
||||||
|
|
||||||
EnableActor(MoveToTargetActive, MoveToTargetActorName, delegate()
|
EnableActor(MoveToTargetActive, MoveToTargetActorName, delegate()
|
||||||
{
|
{
|
||||||
return new BSActorMoveToTarget(PhysScene, this, MoveToTargetActorName);
|
return new BSActorMoveToTarget(PhysScene, this, MoveToTargetActorName);
|
||||||
|
|
|
@ -291,7 +291,7 @@ namespace OpenSim.Region.Physics.Manager
|
||||||
|
|
||||||
// Used for MoveTo
|
// Used for MoveTo
|
||||||
public abstract Vector3 PIDTarget { set; }
|
public abstract Vector3 PIDTarget { set; }
|
||||||
public abstract bool PIDActive { set;}
|
public abstract bool PIDActive { get; set; }
|
||||||
public abstract float PIDTau { set; }
|
public abstract float PIDTau { set; }
|
||||||
|
|
||||||
// Used for llSetHoverHeight and maybe vehicle height
|
// Used for llSetHoverHeight and maybe vehicle height
|
||||||
|
@ -545,7 +545,13 @@ namespace OpenSim.Region.Physics.Manager
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 PIDTarget { set { return; } }
|
public override Vector3 PIDTarget { set { return; } }
|
||||||
public override bool PIDActive { set { return; } }
|
|
||||||
|
public override bool PIDActive
|
||||||
|
{
|
||||||
|
get { return false; }
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
public override float PIDTau { set { return; } }
|
public override float PIDTau { set { return; } }
|
||||||
|
|
||||||
public override float PIDHoverHeight { set { return; } }
|
public override float PIDHoverHeight { set { return; } }
|
||||||
|
|
|
@ -1245,7 +1245,11 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 PIDTarget { set { return; } }
|
public override Vector3 PIDTarget { set { return; } }
|
||||||
public override bool PIDActive { set { return; } }
|
public override bool PIDActive
|
||||||
|
{
|
||||||
|
get { return false; }
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
public override float PIDTau { set { return; } }
|
public override float PIDTau { set { return; } }
|
||||||
|
|
||||||
public override float PIDHoverHeight { set { return; } }
|
public override float PIDHoverHeight { set { return; } }
|
||||||
|
|
|
@ -114,7 +114,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
private float m_PIDTau;
|
private float m_PIDTau;
|
||||||
private float PID_D = 35f;
|
private float PID_D = 35f;
|
||||||
private float PID_G = 25f;
|
private float PID_G = 25f;
|
||||||
private bool m_usePID;
|
|
||||||
|
|
||||||
// KF: These next 7 params apply to llSetHoverHeight(float height, integer water, float tau),
|
// KF: These next 7 params apply to llSetHoverHeight(float height, integer water, float tau),
|
||||||
// and are for non-VEHICLES only.
|
// and are for non-VEHICLES only.
|
||||||
|
@ -1723,7 +1722,7 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
// gravityz multiplier = 1 - m_buoyancy
|
// gravityz multiplier = 1 - m_buoyancy
|
||||||
fz = _parent_scene.gravityz * (1.0f - m_buoyancy) * m_mass;
|
fz = _parent_scene.gravityz * (1.0f - m_buoyancy) * m_mass;
|
||||||
|
|
||||||
if (m_usePID)
|
if (PIDActive)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("PID " + Name);
|
//Console.WriteLine("PID " + Name);
|
||||||
// KF - this is for object move? eg. llSetPos() ?
|
// KF - this is for object move? eg. llSetPos() ?
|
||||||
|
@ -1792,10 +1791,10 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
|
|
||||||
fz = fz + ((_target_velocity.Z - vel.Z) * (PID_D) * m_mass);
|
fz = fz + ((_target_velocity.Z - vel.Z) * (PID_D) * m_mass);
|
||||||
}
|
}
|
||||||
} // end if (m_usePID)
|
} // end if (PIDActive)
|
||||||
|
|
||||||
// Hover PID Controller needs to be mutually exlusive to MoveTo PID controller
|
// Hover PID Controller needs to be mutually exlusive to MoveTo PID controller
|
||||||
if (m_useHoverPID && !m_usePID)
|
if (m_useHoverPID && !PIDActive)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("Hover " + Name);
|
//Console.WriteLine("Hover " + Name);
|
||||||
|
|
||||||
|
@ -2866,7 +2865,7 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
// it does make sense to do this for tiny little instabilities with physical prim, however 0.5m/frame is fairly large.
|
// it does make sense to do this for tiny little instabilities with physical prim, however 0.5m/frame is fairly large.
|
||||||
// reducing this to 0.02m/frame seems to help the angular rubberbanding quite a bit, however, to make sure it doesn't affect elevators and vehicles
|
// reducing this to 0.02m/frame seems to help the angular rubberbanding quite a bit, however, to make sure it doesn't affect elevators and vehicles
|
||||||
// adding these logical exclusion situations to maintain this where I think it was intended to be.
|
// adding these logical exclusion situations to maintain this where I think it was intended to be.
|
||||||
if (m_throttleUpdates || m_usePID || (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) || (Amotor != IntPtr.Zero))
|
if (m_throttleUpdates || PIDActive || (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) || (Amotor != IntPtr.Zero))
|
||||||
{
|
{
|
||||||
m_minvelocity = 0.5f;
|
m_minvelocity = 0.5f;
|
||||||
}
|
}
|
||||||
|
@ -2947,7 +2946,7 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
m_log.WarnFormat("[PHYSICS]: Got NaN PIDTarget from Scene on Object {0}", Name);
|
m_log.WarnFormat("[PHYSICS]: Got NaN PIDTarget from Scene on Object {0}", Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override bool PIDActive { set { m_usePID = value; } }
|
public override bool PIDActive { get; set; }
|
||||||
public override float PIDTau { set { m_PIDTau = value; } }
|
public override float PIDTau { set { m_PIDTau = value; } }
|
||||||
|
|
||||||
public override float PIDHoverHeight { set { m_PIDHoverHeight = value; ; } }
|
public override float PIDHoverHeight { set { m_PIDHoverHeight = value; ; } }
|
||||||
|
|
|
@ -275,6 +275,7 @@ namespace OpenSim.Region.Physics.POSPlugin
|
||||||
|
|
||||||
public override bool PIDActive
|
public override bool PIDActive
|
||||||
{
|
{
|
||||||
|
get { return false; }
|
||||||
set { return; }
|
set { return; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -270,6 +270,7 @@ namespace OpenSim.Region.Physics.POSPlugin
|
||||||
|
|
||||||
public override bool PIDActive
|
public override bool PIDActive
|
||||||
{
|
{
|
||||||
|
get { return false; }
|
||||||
set { return; }
|
set { return; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue