From b637a11b58292cb6165317b317dc077a79ee6779 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Fri, 6 Mar 2009 23:01:35 +0000 Subject: Fixes Mantis #3260. Thank you kindly, MCortez for a patch that: llSetHoverHeight() should not clamp the x/y position of an object the way MoveTo does, and it should recalculate the absolute height to hover at as an object moves to reflect the current ground/water height under it. Correctly implementing required adjusting the Physics interfaces and implementing at the physics plug-in level. The attached is a patch that correctly implements llSetHoverHeight() including updates to the ODE physics plug-in. --- OpenSim/Region/Physics/Manager/PhysicsActor.cs | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Physics/Manager/PhysicsActor.cs') diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 0f75c46..c4bb889 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs @@ -44,6 +44,14 @@ namespace OpenSim.Region.Physics.Manager Ground = 3 } + public enum PIDHoverType + { + Ground + , GroundAndWater + , Water + , Absolute + } + public class CollisionEventUpdate : EventArgs { // Raising the event on the object, so don't need to provide location.. further up the tree knows that info. @@ -204,9 +212,20 @@ namespace OpenSim.Region.Physics.Manager public abstract PhysicsVector RotationalVelocity { get; set; } public abstract bool Kinematic { get; set; } public abstract float Buoyancy { get; set; } + + // Used for MoveTo public abstract PhysicsVector PIDTarget { set;} - public abstract bool PIDActive { set;} + public abstract bool PIDActive { set;} public abstract float PIDTau { set; } + + // Used for llSetHoverHeight and maybe vehicle height + // Hover Height will override MoveTo target's Z + public abstract bool PIDHoverActive { set;} + public abstract float PIDHoverHeight { set;} + public abstract PIDHoverType PIDHoverType { set;} + public abstract float PIDHoverTau { set;} + + public abstract void AddForce(PhysicsVector force, bool pushforce); public abstract void AddAngularForce(PhysicsVector force, bool pushforce); public abstract void SetMomentum(PhysicsVector momentum); @@ -430,6 +449,11 @@ namespace OpenSim.Region.Physics.Manager public override bool PIDActive { set { return; } } public override float PIDTau { set { return; } } + public override float PIDHoverHeight { set { return; } } + public override bool PIDHoverActive { set { return; } } + public override PIDHoverType PIDHoverType { set { return; } } + public override float PIDHoverTau { set { return; } } + public override void SetMomentum(PhysicsVector momentum) { } -- cgit v1.1