From 3eb1a23ac1858c7910c1fdf4f2f80ef3f4faa9a2 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Fri, 21 Sep 2007 02:11:19 +0000 Subject: * Removed Unused 'Entity' superclass --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 72 +++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index c75136f..c0b9a35 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -38,7 +38,7 @@ using OpenSim.Region.Physics.Manager; namespace OpenSim.Region.Environment.Scenes { - public partial class ScenePresence : Entity + public partial class ScenePresence : EntityBase { public static AvatarAnimations Animations; public static byte[] DefaultTexture; @@ -132,11 +132,81 @@ namespace OpenSim.Region.Environment.Scenes } private readonly IClientAPI m_controllingClient; + protected PhysicsActor m_physicsActor; + public IClientAPI _ControllingClient { get { return m_controllingClient; } } + public LLVector3 AbsolutePosition + { + get + { + if (m_physicsActor != null) + { + m_pos.X = m_physicsActor.Position.X; + m_pos.Y = m_physicsActor.Position.Y; + m_pos.Z = m_physicsActor.Position.Z; + } + + return m_pos; + } + set + { + if (m_physicsActor != null) + { + try + { + lock (m_scene.SyncRoot) + { + m_physicsActor.Position = new PhysicsVector(value.X, value.Y, value.Z); + } + } + catch (Exception e) + { + Console.WriteLine(e.Message); + } + } + + m_pos = value; + } + } + + public LLVector3 Velocity + { + get + { + if (m_physicsActor != null) + { + m_velocity.X = m_physicsActor.Velocity.X; + m_velocity.Y = m_physicsActor.Velocity.Y; + m_velocity.Z = m_physicsActor.Velocity.Z; + } + + return m_velocity; + } + set + { + if (m_physicsActor != null) + { + try + { + lock (m_scene.SyncRoot) + { + m_physicsActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z); + } + } + catch (Exception e) + { + Console.WriteLine(e.Message); + } + } + + m_velocity = value; + } + } + #endregion #region Constructor(s) -- cgit v1.1