aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/scripting/ScriptInterpretedAPI.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/scripting/ScriptInterpretedAPI.cs412
1 files changed, 206 insertions, 206 deletions
diff --git a/OpenSim/Region/Environment/Scenes/scripting/ScriptInterpretedAPI.cs b/OpenSim/Region/Environment/Scenes/scripting/ScriptInterpretedAPI.cs
index 085d97e..b4a6019 100644
--- a/OpenSim/Region/Environment/Scenes/scripting/ScriptInterpretedAPI.cs
+++ b/OpenSim/Region/Environment/Scenes/scripting/ScriptInterpretedAPI.cs
@@ -1,206 +1,206 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using Key = libsecondlife.LLUUID; 4using Key = libsecondlife.LLUUID;
5using Rotation = libsecondlife.LLQuaternion; 5using Rotation = libsecondlife.LLQuaternion;
6using Vector = libsecondlife.LLVector3; 6using Vector = libsecondlife.LLVector3;
7using LSLList = System.Collections.Generic.List<string>; 7using LSLList = System.Collections.Generic.List<string>;
8 8
9using OpenSim.Region.Environment.Scenes; 9using OpenSim.Region.Environment.Scenes;
10 10
11namespace OpenSim.Region.Scripting 11namespace OpenSim.Region.Scripting
12{ 12{
13 /// <summary> 13 /// <summary>
14 /// A class inteded to act as an API for LSL-styled interpreted languages 14 /// A class inteded to act as an API for LSL-styled interpreted languages
15 /// </summary> 15 /// </summary>
16 /// <remarks>Avoid at all costs. This should ONLY be used for LSL.</remarks> 16 /// <remarks>Avoid at all costs. This should ONLY be used for LSL.</remarks>
17 class ScriptInterpretedAPI 17 class ScriptInterpretedAPI
18 { 18 {
19 public int osAbs(int val) 19 public int osAbs(int val)
20 { 20 {
21 return Math.Abs(val); 21 return Math.Abs(val);
22 } 22 }
23 23
24 public float osAcos(float val) 24 public float osAcos(float val)
25 { 25 {
26 return (float)Math.Acos(val); 26 return (float)Math.Acos(val);
27 } 27 }
28 28
29 [Obsolete("Unimplemented")] 29 [Obsolete("Unimplemented")]
30 public void osAddToLandPassList(Key avatar, float hours) 30 public void osAddToLandPassList(Key avatar, float hours)
31 { 31 {
32 OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)"); 32 OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)");
33 return; 33 return;
34 } 34 }
35 35
36 [Obsolete("Unimplemented")] 36 [Obsolete("Unimplemented")]
37 public void osAdjustSoundVolume(float volume) 37 public void osAdjustSoundVolume(float volume)
38 { 38 {
39 OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented function called by script: osAdjustSoundVolume(float volume)"); 39 OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented function called by script: osAdjustSoundVolume(float volume)");
40 return; 40 return;
41 } 41 }
42 42
43 [Obsolete("Unimplemented")] 43 [Obsolete("Unimplemented")]
44 public void osAllowInventoryDrop(int add) 44 public void osAllowInventoryDrop(int add)
45 { 45 {
46 return; 46 return;
47 } 47 }
48 48
49 [Obsolete("Unimplemented")] 49 [Obsolete("Unimplemented")]
50 public float osAngleBetween(Rotation a, Rotation b) 50 public float osAngleBetween(Rotation a, Rotation b)
51 { 51 {
52 Axiom.Math.Quaternion axA = new Axiom.Math.Quaternion(a.W, a.X, a.Y, a.Z); 52 Axiom.Math.Quaternion axA = new Axiom.Math.Quaternion(a.W, a.X, a.Y, a.Z);
53 Axiom.Math.Quaternion axB = new Axiom.Math.Quaternion(b.W, b.X, b.Y, b.Z); 53 Axiom.Math.Quaternion axB = new Axiom.Math.Quaternion(b.W, b.X, b.Y, b.Z);
54 54
55 return 0; 55 return 0;
56 } 56 }
57 57
58 [Obsolete("Unimplemented")] 58 [Obsolete("Unimplemented")]
59 public void osApplyImpulse(Vector force, int local) 59 public void osApplyImpulse(Vector force, int local)
60 { 60 {
61 return; 61 return;
62 } 62 }
63 63
64 [Obsolete("Unimplemented")] 64 [Obsolete("Unimplemented")]
65 public void osApplyRotationalImpulse(Vector force, int local) 65 public void osApplyRotationalImpulse(Vector force, int local)
66 { 66 {
67 return; 67 return;
68 } 68 }
69 69
70 public float osAsin(float val) 70 public float osAsin(float val)
71 { 71 {
72 return (float)Math.Asin(val); 72 return (float)Math.Asin(val);
73 } 73 }
74 74
75 public float osAtan2(float x, float y) 75 public float osAtan2(float x, float y)
76 { 76 {
77 return (float)Math.Atan2(x, y); 77 return (float)Math.Atan2(x, y);
78 } 78 }
79 79
80 [Obsolete("Unimplemented")] 80 [Obsolete("Unimplemented")]
81 public void osAttachToAvatar(Key avatar, int attachmentPoint) 81 public void osAttachToAvatar(Key avatar, int attachmentPoint)
82 { 82 {
83 return; 83 return;
84 } 84 }
85 85
86 [Obsolete("Unimplemented")] 86 [Obsolete("Unimplemented")]
87 public Key osAvatarOnSitTarget() 87 public Key osAvatarOnSitTarget()
88 { 88 {
89 return Key.Zero; 89 return Key.Zero;
90 } 90 }
91 91
92 public Rotation osAxes2Rot(Vector fwd, Vector left, Vector up) 92 public Rotation osAxes2Rot(Vector fwd, Vector left, Vector up)
93 { 93 {
94 Axiom.Math.Quaternion axQ = new Axiom.Math.Quaternion(); 94 Axiom.Math.Quaternion axQ = new Axiom.Math.Quaternion();
95 Axiom.Math.Vector3 axFwd = new Axiom.Math.Vector3(fwd.X, fwd.Y, fwd.Z); 95 Axiom.Math.Vector3 axFwd = new Axiom.Math.Vector3(fwd.X, fwd.Y, fwd.Z);
96 Axiom.Math.Vector3 axLeft = new Axiom.Math.Vector3(left.X, left.Y, left.Z); 96 Axiom.Math.Vector3 axLeft = new Axiom.Math.Vector3(left.X, left.Y, left.Z);
97 Axiom.Math.Vector3 axUp = new Axiom.Math.Vector3(up.X, up.Y, up.Z); 97 Axiom.Math.Vector3 axUp = new Axiom.Math.Vector3(up.X, up.Y, up.Z);
98 98
99 axQ.FromAxes(axFwd, axLeft, axUp); 99 axQ.FromAxes(axFwd, axLeft, axUp);
100 100
101 return new Rotation(axQ.x, axQ.y, axQ.z, axQ.w); 101 return new Rotation(axQ.x, axQ.y, axQ.z, axQ.w);
102 } 102 }
103 103
104 public Rotation osAxisAngle2Rot(Vector axis, float angle) 104 public Rotation osAxisAngle2Rot(Vector axis, float angle)
105 { 105 {
106 Axiom.Math.Quaternion axQ = Axiom.Math.Quaternion.FromAngleAxis(angle, new Axiom.Math.Vector3(axis.X, axis.Y, axis.Z)); 106 Axiom.Math.Quaternion axQ = Axiom.Math.Quaternion.FromAngleAxis(angle, new Axiom.Math.Vector3(axis.X, axis.Y, axis.Z));
107 107
108 return new Rotation(axQ.x, axQ.y, axQ.z, axQ.w); 108 return new Rotation(axQ.x, axQ.y, axQ.z, axQ.w);
109 } 109 }
110 110
111 public string osBase64ToString(string str) 111 public string osBase64ToString(string str)
112 { 112 {
113 Encoding enc = System.Text.Encoding.UTF8; 113 Encoding enc = System.Text.Encoding.UTF8;
114 return enc.GetString(Convert.FromBase64String(str)); 114 return enc.GetString(Convert.FromBase64String(str));
115 } 115 }
116 116
117 [Obsolete("Unimplemented")] 117 [Obsolete("Unimplemented")]
118 public void osBreakAllLinks() 118 public void osBreakAllLinks()
119 { 119 {
120 return; 120 return;
121 } 121 }
122 122
123 [Obsolete("Unimplemented")] 123 [Obsolete("Unimplemented")]
124 public void osBreakLink() 124 public void osBreakLink()
125 { 125 {
126 return; 126 return;
127 } 127 }
128 128
129 public LSLList osCSV2List(string src) 129 public LSLList osCSV2List(string src)
130 { 130 {
131 LSLList retVal = new LSLList(); 131 LSLList retVal = new LSLList();
132 retVal.AddRange(src.Split(',')); 132 retVal.AddRange(src.Split(','));
133 133
134 return retVal; 134 return retVal;
135 } 135 }
136 136
137 public int osCeil(float val) 137 public int osCeil(float val)
138 { 138 {
139 return (int)Math.Ceiling(val); 139 return (int)Math.Ceiling(val);
140 } 140 }
141 141
142 [Obsolete("Unimplemented")] 142 [Obsolete("Unimplemented")]
143 public void osCloseRemoteDataChannel(Key channel) 143 public void osCloseRemoteDataChannel(Key channel)
144 { 144 {
145 return; 145 return;
146 } 146 }
147 147
148 [Obsolete("Unimplemented")] 148 [Obsolete("Unimplemented")]
149 public float osCloud(Vector offset) 149 public float osCloud(Vector offset)
150 { 150 {
151 return 0.0f; 151 return 0.0f;
152 } 152 }
153 153
154 [Obsolete("Unimplemented")] 154 [Obsolete("Unimplemented")]
155 public void osCollisionFilter(string name, Key id, int accept) 155 public void osCollisionFilter(string name, Key id, int accept)
156 { 156 {
157 return; 157 return;
158 } 158 }
159 159
160 [Obsolete("Unimplemented")] 160 [Obsolete("Unimplemented")]
161 public void osCollisionSprite(string impact_sprite) 161 public void osCollisionSprite(string impact_sprite)
162 { 162 {
163 return; 163 return;
164 } 164 }
165 165
166 public float osCos(float theta) 166 public float osCos(float theta)
167 { 167 {
168 return (float)Math.Cos(theta); 168 return (float)Math.Cos(theta);
169 } 169 }
170 170
171 [Obsolete("Unimplemented")] 171 [Obsolete("Unimplemented")]
172 public void osCreateLink(Key target, int parent) 172 public void osCreateLink(Key target, int parent)
173 { 173 {
174 return; 174 return;
175 } 175 }
176 176
177 [Obsolete("Partially Unimplemented")] 177 [Obsolete("Partially Unimplemented")]
178 public LSLList osDeleteSubList(LSLList src, int start, int end) 178 public LSLList osDeleteSubList(LSLList src, int start, int end)
179 { 179 {
180 if (start < 0 || end < 0) 180 if (start < 0 || end < 0)
181 { 181 {
182 throw new Exception("Unsupported at this time."); 182 throw new Exception("Unsupported at this time.");
183 } 183 }
184 184
185 src.RemoveRange(start, start - end + 1); 185 src.RemoveRange(start, start - end + 1);
186 return src; 186 return src;
187 } 187 }
188 188
189 [Obsolete("Partially Unimplemented")] 189 [Obsolete("Partially Unimplemented")]
190 public string osDeleteSubString(string src, int start, int end) 190 public string osDeleteSubString(string src, int start, int end)
191 { 191 {
192 if (start < 0 || end < 0) 192 if (start < 0 || end < 0)
193 { 193 {
194 throw new Exception("Unsupported at this time."); 194 throw new Exception("Unsupported at this time.");
195 } 195 }
196 196
197 return src.Remove(start, start - end + 1); 197 return src.Remove(start, start - end + 1);
198 } 198 }
199 199
200 [Obsolete("Unimplemented")] 200 [Obsolete("Unimplemented")]
201 public void osDetachFromAvatar(Key avatar) 201 public void osDetachFromAvatar(Key avatar)
202 { 202 {
203 return; 203 return;
204 } 204 }
205 } 205 }
206} 206}