From bf8b5844f24d294c459f54147bd511e7112288bf Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 18 Mar 2008 14:51:42 +0000 Subject: Formatting cleanup. Minor refactoring. --- OpenSim/Region/Physics/Manager/PhysicsActor.cs | 45 ++++---------------------- 1 file changed, 6 insertions(+), 39 deletions(-) (limited to 'OpenSim/Region/Physics/Manager') diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 1119db5..c63e1f7 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs @@ -33,9 +33,7 @@ using OpenSim.Framework; namespace OpenSim.Region.Physics.Manager { public delegate void PositionUpdate(PhysicsVector position); - public delegate void VelocityUpdate(PhysicsVector velocity); - public delegate void OrientationUpdate(Quaternion orientation); public enum ActorTypes : int @@ -50,7 +48,6 @@ namespace OpenSim.Region.Physics.Manager { // Raising the event on the object, so don't need to provide location.. further up the tree knows that info. - public int m_colliderType; public int m_GenericStartEnd; //public uint m_LocalID; @@ -88,13 +85,10 @@ namespace OpenSim.Region.Physics.Manager } } - public abstract class PhysicsActor { public delegate void RequestTerseUpdate(); - public delegate void CollisionUpdate(EventArgs e); - public delegate void OutOfBounds(PhysicsVector pos); #pragma warning disable 67 @@ -138,9 +132,7 @@ namespace OpenSim.Region.Physics.Manager if (handler != null) { - - handler(); - + handler(); } } @@ -150,9 +142,10 @@ namespace OpenSim.Region.Physics.Manager // a race condition if the last subscriber unsubscribes // immediately after the null check and before the event is raised. OutOfBounds handler = OnOutOfBounds; + if (handler != null) { - handler(pos); + handler(pos); } } @@ -162,54 +155,34 @@ namespace OpenSim.Region.Physics.Manager if (handler != null) { - handler(e); + handler(e); } - } - public abstract PhysicsVector Position { get; set; } - public abstract float Mass { get; } - public abstract PhysicsVector Force { get; } - public abstract PhysicsVector GeometricCenter { get; } - public abstract PhysicsVector CenterOfMass { get; } - public abstract PhysicsVector Velocity { get; set; } - public abstract float CollisionScore { get;} - public abstract PhysicsVector Acceleration { get; } - public abstract Quaternion Orientation { get; set; } public abstract int PhysicsActorType { get; set; } - public abstract bool IsPhysical { get; set; } - public abstract bool Flying { get; set; } public abstract bool SetAlwaysRun { get; set; } public abstract bool ThrottleUpdates { get; set; } - public abstract bool IsColliding { get; set; } public abstract bool CollidingGround { get; set; } public abstract bool CollidingObj { get; set; } - public abstract bool FloatOnWater { set; } - public abstract PhysicsVector RotationalVelocity { get; set; } - public abstract bool Kinematic { get; set; } - public abstract float Buoyancy { get; set; } public abstract void AddForce(PhysicsVector force); - public abstract void SetMomentum(PhysicsVector momentum); - - } public class NullPhysicsActor : PhysicsActor @@ -246,7 +219,8 @@ namespace OpenSim.Region.Physics.Manager set { return; } } - public override float Buoyancy { + public override float Buoyancy + { get { return 0f; } set { return; } } @@ -256,7 +230,6 @@ namespace OpenSim.Region.Physics.Manager set { return; } } - public override bool CollidingGround { get { return false; } @@ -313,10 +286,8 @@ namespace OpenSim.Region.Physics.Manager public override void CrossingFailure() { - } - public override Quaternion Orientation { get { return Quaternion.Identity; } @@ -366,17 +337,14 @@ namespace OpenSim.Region.Physics.Manager public override void link(PhysicsActor obj) { - } public override void delink() { - } public override void AddForce(PhysicsVector force) { - return; } public override PhysicsVector RotationalVelocity @@ -387,7 +355,6 @@ namespace OpenSim.Region.Physics.Manager public override void SetMomentum(PhysicsVector momentum) { - return; } } } -- cgit v1.1