From 4f4dfa8e8230836cb0033dc7ff4d2f2234fe88b8 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sun, 24 Feb 2008 17:29:59 +0000 Subject: Fixed startup logo size to match a Win CMD window. Fixed bugs in new OOP commands. Prim.Rotation.X += 45; Prim.Position.X += 10; Now how do I find the prim I asked to += 10 every 1 second??? --- .../ScriptEngine/Common/OSSL_BuilIn_Commands.cs | 178 ++++++++++++++++++--- 1 file changed, 160 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Common') diff --git a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs index f112e58..091f9d9 100644 --- a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.ScriptEngine.Common : base(scriptEngine, host, localID, itemID) { Prim = new OSSLPrim(this); - + } @@ -49,28 +49,39 @@ namespace OpenSim.Region.ScriptEngine.Common [Serializable] public class OSSLPrim { - private OSSL_BuilIn_Commands OSSL; + internal OSSL_BuilIn_Commands OSSL; public OSSLPrim(OSSL_BuilIn_Commands bc) { OSSL = bc; + Position = new OSSLPrim_Position(this); + Rotation = new OSSLPrim_Rotation(this); } - public LSL_Types.Vector3 Position { - get { return OSSL.llGetPos(); } - set { OSSL.llSetPos(value); } - } - public LSL_Types.Quaternion Rotation { - get { return OSSL.llGetRot(); } - set { OSSL.llSetRot(value); } - } + + public OSSLPrim_Position Position; + public OSSLPrim_Rotation Rotation; + //public LSL_Types.Vector3 Position + //{ + // get { return OSSL.llGetPos(); } + // set { OSSL.llSetPos(value); } + //} + //public LSL_Types.Quaternion Rotation + //{ + // get { return OSSL.llGetRot(); } + // set { OSSL.llSetRot(value); } + //} private TextStruct _text; public TextStruct Text { get { return _text; } - set { _text = value; - OSSL.llSetText(_text.Text, _text.color, _text.alpha); } + set + { + _text = value; + OSSL.llSetText(_text.Text, _text.color, _text.alpha); + } } + [Serializable] public struct TextStruct { public string Text; @@ -78,12 +89,143 @@ namespace OpenSim.Region.ScriptEngine.Common public double alpha; } } - //public struct OSSLPrim_Position - //{ - // public int X; - // public int Y; - // public int Z; - //} + + [Serializable] + public class OSSLPrim_Position + { + private OSSLPrim prim; + private LSL_Types.Vector3 Position; + public OSSLPrim_Position(OSSLPrim _prim) + { + prim = _prim; + } + private void Load() + { + Position = prim.OSSL.llGetPos(); + } + private void Save() + { + prim.OSSL.llSetPos(Position); + } + + public double x + { + get + { + Load(); + return Position.x; + } + set + { + Load(); + Position.x += value; + Save(); + } + } + public double y + { + get + { + Load(); + return Position.y; + } + set + { + Load(); + Position.y += value; + Save(); + } + } + public double z + { + get + { + Load(); + return Position.z; + } + set + { + Load(); + Position.z += value; + Save(); + } + } + } + [Serializable] + public class OSSLPrim_Rotation + { + private OSSLPrim prim; + private LSL_Types.Quaternion Rotation; + public OSSLPrim_Rotation(OSSLPrim _prim) + { + prim = _prim; + } + private void Load() + { + Rotation = prim.OSSL.llGetRot(); + } + private void Save() + { + prim.OSSL.llSetRot(Rotation); + } + + public double x + { + get + { + Load(); + return Rotation.x; + } + set + { + Load(); + Rotation.x += value; + Save(); + } + } + public double y + { + get + { + Load(); + return Rotation.y; + } + set + { + Load(); + Rotation.y += value; + Save(); + } + } + public double z + { + get + { + Load(); + return Rotation.z; + } + set + { + Load(); + Rotation.z += value; + Save(); + } + } + public double s + { + get + { + Load(); + return Rotation.s; + } + set + { + Load(); + Rotation.s += value; + Save(); + } + } + } //public struct OSSLPrim_Rotation //{ // public double X; -- cgit v1.1