aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs178
1 files changed, 160 insertions, 18 deletions
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
40 : base(scriptEngine, host, localID, itemID) 40 : base(scriptEngine, host, localID, itemID)
41 { 41 {
42 Prim = new OSSLPrim(this); 42 Prim = new OSSLPrim(this);
43 43
44 } 44 }
45 45
46 46
@@ -49,28 +49,39 @@ namespace OpenSim.Region.ScriptEngine.Common
49 [Serializable] 49 [Serializable]
50 public class OSSLPrim 50 public class OSSLPrim
51 { 51 {
52 private OSSL_BuilIn_Commands OSSL; 52 internal OSSL_BuilIn_Commands OSSL;
53 public OSSLPrim(OSSL_BuilIn_Commands bc) 53 public OSSLPrim(OSSL_BuilIn_Commands bc)
54 { 54 {
55 OSSL = bc; 55 OSSL = bc;
56 Position = new OSSLPrim_Position(this);
57 Rotation = new OSSLPrim_Rotation(this);
56 } 58 }
57 59
58 public LSL_Types.Vector3 Position { 60
59 get { return OSSL.llGetPos(); } 61 public OSSLPrim_Position Position;
60 set { OSSL.llSetPos(value); } 62 public OSSLPrim_Rotation Rotation;
61 } 63 //public LSL_Types.Vector3 Position
62 public LSL_Types.Quaternion Rotation { 64 //{
63 get { return OSSL.llGetRot(); } 65 // get { return OSSL.llGetPos(); }
64 set { OSSL.llSetRot(value); } 66 // set { OSSL.llSetPos(value); }
65 } 67 //}
68 //public LSL_Types.Quaternion Rotation
69 //{
70 // get { return OSSL.llGetRot(); }
71 // set { OSSL.llSetRot(value); }
72 //}
66 private TextStruct _text; 73 private TextStruct _text;
67 public TextStruct Text 74 public TextStruct Text
68 { 75 {
69 get { return _text; } 76 get { return _text; }
70 set { _text = value; 77 set
71 OSSL.llSetText(_text.Text, _text.color, _text.alpha); } 78 {
79 _text = value;
80 OSSL.llSetText(_text.Text, _text.color, _text.alpha);
81 }
72 } 82 }
73 83
84 [Serializable]
74 public struct TextStruct 85 public struct TextStruct
75 { 86 {
76 public string Text; 87 public string Text;
@@ -78,12 +89,143 @@ namespace OpenSim.Region.ScriptEngine.Common
78 public double alpha; 89 public double alpha;
79 } 90 }
80 } 91 }
81 //public struct OSSLPrim_Position 92
82 //{ 93 [Serializable]
83 // public int X; 94 public class OSSLPrim_Position
84 // public int Y; 95 {
85 // public int Z; 96 private OSSLPrim prim;
86 //} 97 private LSL_Types.Vector3 Position;
98 public OSSLPrim_Position(OSSLPrim _prim)
99 {
100 prim = _prim;
101 }
102 private void Load()
103 {
104 Position = prim.OSSL.llGetPos();
105 }
106 private void Save()
107 {
108 prim.OSSL.llSetPos(Position);
109 }
110
111 public double x
112 {
113 get
114 {
115 Load();
116 return Position.x;
117 }
118 set
119 {
120 Load();
121 Position.x += value;
122 Save();
123 }
124 }
125 public double y
126 {
127 get
128 {
129 Load();
130 return Position.y;
131 }
132 set
133 {
134 Load();
135 Position.y += value;
136 Save();
137 }
138 }
139 public double z
140 {
141 get
142 {
143 Load();
144 return Position.z;
145 }
146 set
147 {
148 Load();
149 Position.z += value;
150 Save();
151 }
152 }
153 }
154 [Serializable]
155 public class OSSLPrim_Rotation
156 {
157 private OSSLPrim prim;
158 private LSL_Types.Quaternion Rotation;
159 public OSSLPrim_Rotation(OSSLPrim _prim)
160 {
161 prim = _prim;
162 }
163 private void Load()
164 {
165 Rotation = prim.OSSL.llGetRot();
166 }
167 private void Save()
168 {
169 prim.OSSL.llSetRot(Rotation);
170 }
171
172 public double x
173 {
174 get
175 {
176 Load();
177 return Rotation.x;
178 }
179 set
180 {
181 Load();
182 Rotation.x += value;
183 Save();
184 }
185 }
186 public double y
187 {
188 get
189 {
190 Load();
191 return Rotation.y;
192 }
193 set
194 {
195 Load();
196 Rotation.y += value;
197 Save();
198 }
199 }
200 public double z
201 {
202 get
203 {
204 Load();
205 return Rotation.z;
206 }
207 set
208 {
209 Load();
210 Rotation.z += value;
211 Save();
212 }
213 }
214 public double s
215 {
216 get
217 {
218 Load();
219 return Rotation.s;
220 }
221 set
222 {
223 Load();
224 Rotation.s += value;
225 Save();
226 }
227 }
228 }
87 //public struct OSSLPrim_Rotation 229 //public struct OSSLPrim_Rotation
88 //{ 230 //{
89 // public double X; 231 // public double X;