diff --git a/OpenSim/Region/Framework/Scenes/EntityBase.cs b/OpenSim/Region/Framework/Scenes/EntityBase.cs index 741f53b0bf..091baff5a2 100644 --- a/OpenSim/Region/Framework/Scenes/EntityBase.cs +++ b/OpenSim/Region/Framework/Scenes/EntityBase.cs @@ -37,92 +37,98 @@ namespace OpenSim.Region.Framework.Scenes { public abstract class EntityBase : ISceneEntity { -// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// /// The scene to which this entity belongs /// + protected Scene m_scene; public Scene Scene { get { return m_scene; } } - protected Scene m_scene; protected UUID m_uuid; - public virtual UUID UUID { get { return m_uuid; } set { m_uuid = value; } } - protected string m_name; - /// /// The name of this entity /// + protected string m_name; public virtual string Name { get { return m_name; } set { m_name = value; } } + /// + /// id local to scene + /// + protected uint m_localId; + public virtual uint LocalId + { + get + { + return m_localId; + } + set + { + m_localId = value; + // m_log.DebugFormat("[ENTITY BASE]: Set part {0} to local id {1}", Name, m_localId); + } + } + /// /// Signals whether this entity was in a scene but has since been removed from it. /// public bool IsDeleted { get; protected internal set; } - protected Vector3 m_pos; - /// /// Absolute position of this entity in a scene. /// + protected Vector3 m_pos; public virtual Vector3 AbsolutePosition { - get { return m_pos; } + get + { + return m_pos; + } set { m_pos = value; } } - protected Vector3 m_velocity; - protected Vector3 m_rotationalvelocity; - /// /// Current velocity of the entity. /// + protected Vector3 m_velocity; public virtual Vector3 Velocity { get { return m_velocity; } set { m_velocity = value; } } - protected uint m_localId; - - public virtual uint LocalId - { - get { return m_localId; } - set - { - m_localId = value; -// m_log.DebugFormat("[ENTITY BASE]: Set part {0} to local id {1}", Name, m_localId); - } - } + protected Vector3 m_rotationalvelocity; /// /// Creates a new Entity (should not occur on it's own) /// public EntityBase() { - m_name = "(basic entity)"; } /// /// Performs any updates that need to be done at each frame, as opposed to immediately. /// These included scheduled updates and updates that occur due to physics processing. /// - public abstract void Update(); + public virtual void Update() + { + } /// /// Copies the entity diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 0c603b3244..e90cd1503e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs @@ -100,7 +100,9 @@ namespace OpenSim.Region.Framework.Scenes /// public void StopScriptInstances() { - Array.ForEach(m_parts.GetArray(), p => p.Inventory.StopScriptInstances()); + SceneObjectPart[] parts = m_parts.GetArray(); + for(int i = 0; i < parts.Length; ++i) + parts[i].Inventory.StopScriptInstances(); } public void SendReleaseScriptsControl() diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 95bb618022..271d3ae36e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -500,8 +500,6 @@ namespace OpenSim.Region.Framework.Scenes /// /// Does this group contain the given part? - /// should be able to remove these methods once we have a entity index in scene - /// /// /// public bool ContainsPart(uint localID) @@ -612,7 +610,6 @@ namespace OpenSim.Region.Framework.Scenes // this is needed because physics may not have linksets but just loose SOPs in world SceneObjectPart[] parts = m_parts.GetArray(); - foreach (SceneObjectPart part in parts) { if (part != m_rootPart) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 11f754ee4a..0faefebdf6 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -93,7 +93,7 @@ namespace OpenSim.Region.Framework.Scenes #endregion Enumerations - public class SceneObjectPart : ISceneEntity, IDisposable + public class SceneObjectPart : EntityBase, IDisposable { /// /// Denote all sides of the prim @@ -325,9 +325,7 @@ namespace OpenSim.Region.Framework.Scenes //unkown if this will be kept, added as a way of removing the group position from the group class protected Vector3 m_groupPosition; - protected uint m_localId; protected Material m_material = OpenMetaverse.Material.Wood; - protected string m_name; protected Vector3 m_offsetPosition; protected SceneObjectGroup m_parentGroup; @@ -335,8 +333,6 @@ namespace OpenSim.Region.Framework.Scenes protected ulong m_regionHandle; protected Quaternion m_rotationOffset = Quaternion.Identity; protected PrimitiveBaseShape m_shape; - protected UUID m_uuid; - protected Vector3 m_velocity; protected Vector3 m_lastPosition; protected Quaternion m_lastRotation; @@ -611,7 +607,7 @@ namespace OpenSim.Region.Framework.Scenes set { Flags = (PrimFlags)value; } } - public UUID UUID + public override UUID UUID { get { return m_uuid; } set @@ -623,18 +619,8 @@ namespace OpenSim.Region.Framework.Scenes Inventory.ResetObjectID(); } } - - public uint LocalId - { - get { return m_localId; } - set - { - m_localId = value; -// m_log.DebugFormat("[SCENE OBJECT PART]: Set part {0} to local id {1}", Name, m_localId); - } - } - - public virtual string Name + + public override string Name { get { return m_name; } set @@ -644,7 +630,6 @@ namespace OpenSim.Region.Framework.Scenes ParentGroup.InvalidatePartsLinkMaps(); PhysicsActor pa = PhysActor; - if (pa != null) pa.SOPName = value; } @@ -708,14 +693,12 @@ namespace OpenSim.Region.Framework.Scenes set { m_APIDTarget = value; } } - protected float APIDDamp { get { return m_APIDDamp; } set { m_APIDDamp = value; } } - protected float APIDStrength { get { return m_APIDStrength; } @@ -955,7 +938,7 @@ namespace OpenSim.Region.Framework.Scenes } /// - public Vector3 Velocity + public override Vector3 Velocity { get { @@ -1232,7 +1215,7 @@ namespace OpenSim.Region.Framework.Scenes //--------------- #region Public Properties with only Get - public Vector3 AbsolutePosition + public override Vector3 AbsolutePosition { get { @@ -1468,7 +1451,7 @@ namespace OpenSim.Region.Framework.Scenes set { m_sitAnimation = value; } } - public UUID invalidCollisionSoundUUID = new UUID("ffffffff-ffff-ffff-ffff-ffffffffffff"); + public readonly UUID invalidCollisionSoundUUID = new UUID("ffffffff-ffff-ffff-ffff-ffffffffffff"); // 0 for default collision sounds, -1 for script disabled sound 1 for script defined sound // runtime thing.. do not persist diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index be1199378d..4545661ee5 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -401,7 +401,6 @@ namespace OpenSim.Region.Framework.Scenes } } - // If the prim is a sculpt then preserve this information too if (part.Shape.SculptTexture != UUID.Zero) GatheredUuids[part.Shape.SculptTexture] = (sbyte)AssetType.Texture;