From 49ed68e98c34c752fac407aa9359201e244df19f Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sun, 22 Apr 2012 20:28:12 +0100 Subject: [PATCH] refactor: simply some properties code in BasicPhysicsPlugin --- .../BasicPhysicsPlugin/BasicPhysicsActor.cs | 42 +++---------------- .../BasicPhysicsPlugin/BasicPhysicsPrim.cs | 42 +++---------------- 2 files changed, 12 insertions(+), 72 deletions(-) diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs index b1a3ff9df5..e43136a258 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs @@ -36,13 +36,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin { public class BasicActor : PhysicsActor { - private Vector3 _position; - private Vector3 _velocity; - private Vector3 _acceleration; private Vector3 _size; - private Vector3 m_rotationalVelocity; - private bool flying; - private bool iscolliding; public BasicActor(Vector3 size) { @@ -55,11 +49,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin set { return; } } - public override Vector3 RotationalVelocity - { - get { return m_rotationalVelocity; } - set { m_rotationalVelocity = value; } - } + public override Vector3 RotationalVelocity { get; set; } public override bool SetAlwaysRun { @@ -105,17 +95,9 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin set { return; } } - public override bool Flying - { - get { return flying; } - set { flying = value; } - } + public override bool Flying { get; set; } - public override bool IsColliding - { - get { return iscolliding; } - set { iscolliding = value; } - } + public override bool IsColliding { get; set; } public override bool CollidingGround { @@ -134,11 +116,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin get { return false; } } - public override Vector3 Position - { - get { return _position; } - set { _position = value; } - } + public override Vector3 Position { get; set; } public override Vector3 Size { @@ -206,11 +184,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin get { return Vector3.Zero; } } - public override Vector3 Velocity - { - get { return _velocity; } - set { _velocity = value; } - } + public override Vector3 Velocity { get; set; } public override Vector3 Torque { @@ -230,11 +204,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin set { } } - public override Vector3 Acceleration - { - get { return _acceleration; } - set { _acceleration = value; } - } + public override Vector3 Acceleration { get; set; } public override bool Kinematic { diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPrim.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPrim.cs index ba7fe1e7bb..b89eeed329 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPrim.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPrim.cs @@ -36,14 +36,8 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin { public class BasicPhysicsPrim : PhysicsActor { - private Vector3 _position; - private Vector3 _velocity; - private Vector3 _acceleration; private Vector3 _size; private PrimitiveBaseShape _shape; - private Vector3 m_rotationalVelocity; - private bool flying; - private bool iscolliding; public BasicPhysicsPrim( string name, uint localId, Vector3 position, Vector3 size, Quaternion orientation, PrimitiveBaseShape shape) @@ -62,11 +56,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin set { return; } } - public override Vector3 RotationalVelocity - { - get { return m_rotationalVelocity; } - set { m_rotationalVelocity = value; } - } + public override Vector3 RotationalVelocity { get; set; } public override bool SetAlwaysRun { @@ -112,17 +102,9 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin set { return; } } - public override bool Flying - { - get { return flying; } - set { flying = value; } - } + public override bool Flying { get; set; } - public override bool IsColliding - { - get { return iscolliding; } - set { iscolliding = value; } - } + public override bool IsColliding { get; set; } public override bool CollidingGround { @@ -141,11 +123,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin get { return false; } } - public override Vector3 Position - { - get { return _position; } - set { _position = value; } - } + public override Vector3 Position { get; set; } public override Vector3 Size { @@ -213,11 +191,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin get { return Vector3.Zero; } } - public override Vector3 Velocity - { - get { return _velocity; } - set { _velocity = value; } - } + public override Vector3 Velocity { get; set; } public override Vector3 Torque { @@ -233,11 +207,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin public override Quaternion Orientation { get; set; } - public override Vector3 Acceleration - { - get { return _acceleration; } - set { _acceleration = value; } - } + public override Vector3 Acceleration { get; set; } public override bool Kinematic {