From f740c9522aa5fd57ffd2d01fa9c2e244113ac880 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 27 May 2012 14:01:42 +0100 Subject: [PATCH] Let OOB information usable outside ubitode --- .../Region/Physics/Manager/PhysicsActor.cs | 29 ++++++++++++++++++- .../Physics/UbitOdePlugin/ODECharacter.cs | 23 --------------- .../Region/Physics/UbitOdePlugin/ODEPrim.cs | 10 +++---- 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index fb90887f6d..aaeae86f3d 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs @@ -294,6 +294,34 @@ namespace OpenSim.Region.Physics.Manager public abstract Vector3 GeometricCenter { get; } public abstract Vector3 CenterOfMass { get; } + public virtual Vector3 OOBsize + { + get + { + Vector3 s=Size; + s.X *=0.5f; + s.Y *=0.5f; + s.Z *=0.5f; + return s; + } + } + + public virtual Vector3 OOBoffset + { + get + { + return Vector3.Zero; + } + } + + public virtual float OOBRadiusSQ + { + get + { + return Size.LengthSquared() * 0.25f; // ((0.5^2) + } + } + /// /// Velocity of this actor. /// @@ -429,7 +457,6 @@ namespace OpenSim.Region.Physics.Manager public override void VehicleFloatParam(int param, float value) { - } public override void VehicleVectorParam(int param, Vector3 value) diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index 1084b0e2a7..6fb54cb09d 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs @@ -522,29 +522,6 @@ namespace OpenSim.Region.Physics.OdePlugin } } - //UBit mess - /* for later use - public override Vector3 PrimOOBsize - { - get - { - Vector3 s=Size; - s.X *=0.5f; - s.Y *=0.5f; - s.Z *=0.5f; - return s; - } - } - - public override Vector3 PrimOOBoffset - { - get - { - return Vector3.Zero; - } - } - */ - public override PrimitiveBaseShape Shape { set { return; } diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index 496e7ace48..1bfe08bdb1 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs @@ -504,8 +504,8 @@ namespace OpenSim.Region.Physics.OdePlugin } } } -/* - public override Vector3 PrimOOBsize + + public override Vector3 OOBsize { get { @@ -513,7 +513,7 @@ namespace OpenSim.Region.Physics.OdePlugin } } - public override Vector3 PrimOOBoffset + public override Vector3 OOBoffset { get { @@ -521,14 +521,14 @@ namespace OpenSim.Region.Physics.OdePlugin } } - public override float PrimOOBRadiusSQ + public override float OOBRadiusSQ { get { return primOOBradiusSQ; } } -*/ + public override PrimitiveBaseShape Shape { set