From c3e1756a48049664a4381cb8b2497415719d8d5c Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 4 Apr 2009 06:28:55 +0000 Subject: * Removes IObject.Position, IObject.Rotation from IObject * Adds IObject.WorldPosition and IObject.OffsetPosition - this is equivilent to AbsolutePosition and OffsetPosition in SOP respectively. * Adds IObject.WorldRotation and IObject.OffsetRotation - as above. --- .../Scripting/Minimodule/IObject.cs | 45 ++++++++++++++++++++-- .../Scripting/Minimodule/SOPObject.cs | 16 +++++++- 2 files changed, 55 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Scripting/Minimodule') diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IObject.cs index 21efc6d..d3eeffb 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IObject.cs @@ -33,14 +33,35 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { public interface IObject { + /// + /// Returns whether or not this object is still in the world. + /// Eg, if you store an IObject reference, however the object + /// is deleted before you use it, it will throw a NullReference + /// exception. 'Exists' allows you to check the object is still + /// in play before utilizing it. + /// bool Exists { get; } + + /// + /// The local region-unique ID for this object. + /// uint LocalID { get; } + + /// + /// The global 'world-unique' ID for this object. + /// (Note, may not actually be world unique) + /// UUID GlobalID { get; } + /// + /// The name of this Object. + /// String Name { get; set; } - String Description { get; set; } - + /// + /// The description assigned to this object. + /// + String Description { get; set; } /// /// Returns the root object of a linkset. If this object is the root, it will return itself. @@ -67,19 +88,35 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule /// /// The rotation of the object relative to the Scene /// - Quaternion Rotation { get; set; } + Quaternion WorldRotation { get; set; } + + /// + /// The rotation of the object relative to a parent object + /// If root, works the same as WorldRotation + /// + Quaternion OffsetRotation { get; set; } /// /// The position of the object relative to the Scene /// - Vector3 Position { get; set; } + Vector3 WorldPosition { get; set; } + /// + /// The position of the object relative to a parent object + /// If root, works the same as WorldPosition + /// + Vector3 OffsetPosition { get; set; } Vector3 SitTarget { get; set; } String SitTargetText { get; set; } String TouchText { get; set; } + /// + /// Text to be associated with this object, in the + /// Second Life(r) viewer, this is shown above the + /// object. + /// String Text { get; set; } bool IsPhysical { get; set; } // SetStatus(PHYSICS) diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index 12d996a..f53a7df 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs @@ -103,13 +103,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule set { GetSOP().Scale = value; } } - public Quaternion Rotation + public Quaternion WorldRotation { get { throw new System.NotImplementedException(); } set { throw new System.NotImplementedException(); } } - public Vector3 Position + public Quaternion OffsetRotation + { + get { throw new System.NotImplementedException(); } + set { throw new System.NotImplementedException(); } + } + + public Vector3 WorldPosition { get { return GetSOP().AbsolutePosition; } set @@ -119,6 +125,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule } } + public Vector3 OffsetPosition + { + get { return GetSOP().OffsetPosition; } + set { GetSOP().OffsetPosition = value; } + } + public Vector3 SitTarget { get { throw new System.NotImplementedException(); } -- cgit v1.1