diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/scripting/ScriptAPI.cs | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/scripting/ScriptAPI.cs b/OpenSim/Region/Environment/Scenes/scripting/ScriptAPI.cs index fd601cb..894713f 100644 --- a/OpenSim/Region/Environment/Scenes/scripting/ScriptAPI.cs +++ b/OpenSim/Region/Environment/Scenes/scripting/ScriptAPI.cs | |||
@@ -1,6 +1,10 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using Key = libsecondlife.LLUUID; | ||
5 | using Rotation = libsecondlife.LLQuaternion; | ||
6 | using Vector = libsecondlife.LLVector3; | ||
7 | |||
4 | 8 | ||
5 | using OpenSim.Region.Environment.Scenes; | 9 | using OpenSim.Region.Environment.Scenes; |
6 | 10 | ||
@@ -21,5 +25,111 @@ namespace OpenSim.Region.Environment.Scripting | |||
21 | { | 25 | { |
22 | return null; | 26 | return null; |
23 | } | 27 | } |
28 | |||
29 | // LSL Compatibility below | ||
30 | // remap LL* functions to OS* | ||
31 | public int osAbs(int val) | ||
32 | { | ||
33 | return Math.Abs(val); | ||
34 | } | ||
35 | |||
36 | public float osAcos(float val) | ||
37 | { | ||
38 | return (float)Math.Acos(val); | ||
39 | } | ||
40 | |||
41 | [Obsolete("Unimplemented")] | ||
42 | public void osAddToLandPassList(Key avatar, float hours) | ||
43 | { | ||
44 | OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)"); | ||
45 | return; | ||
46 | } | ||
47 | |||
48 | [Obsolete("Unimplemented")] | ||
49 | public void osAdjustSoundVolume(float volume) | ||
50 | { | ||
51 | OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented function called by script: osAdjustSoundVolume(float volume)"); | ||
52 | return; | ||
53 | } | ||
54 | |||
55 | [Obsolete("Unimplemented")] | ||
56 | public void osAllowInventoryDrop(int add) | ||
57 | { | ||
58 | return; | ||
59 | } | ||
60 | |||
61 | [Obsolete("Unimplemented")] | ||
62 | public float osAngleBetween(Rotation a, Rotation b) | ||
63 | { | ||
64 | Axiom.Math.Quaternion axA = new Axiom.Math.Quaternion(a.W, a.X, a.Y, a.Z); | ||
65 | Axiom.Math.Quaternion axB = new Axiom.Math.Quaternion(b.W, b.X, b.Y, b.Z); | ||
66 | |||
67 | return 0; | ||
68 | } | ||
69 | |||
70 | [Obsolete("Unimplemented")] | ||
71 | public void osApplyImpulse(Vector force, int local) | ||
72 | { | ||
73 | return; | ||
74 | } | ||
75 | |||
76 | [Obsolete("Unimplemented")] | ||
77 | public void osApplyRotationalImpulse(Vector force, int local) | ||
78 | { | ||
79 | return; | ||
80 | } | ||
81 | |||
82 | public float osAsin(float val) | ||
83 | { | ||
84 | return (float)Math.Asin(val); | ||
85 | } | ||
86 | |||
87 | public float osAtan2(float x, float y) | ||
88 | { | ||
89 | return (float)Math.Atan2(x, y); | ||
90 | } | ||
91 | |||
92 | [Obsolete("Unimplemented")] | ||
93 | public void osAttachToAvatar(Key avatar, int attachmentPoint) | ||
94 | { | ||
95 | return; | ||
96 | } | ||
97 | |||
98 | [Obsolete("Unimplemented")] | ||
99 | public Key osAvatarOnSitTarget() | ||
100 | { | ||
101 | return Key.Zero; | ||
102 | } | ||
103 | |||
104 | public Rotation osAxes2Rot(Vector fwd, Vector left, Vector up) | ||
105 | { | ||
106 | Axiom.Math.Quaternion axQ = new Axiom.Math.Quaternion(); | ||
107 | Axiom.Math.Vector3 axFwd = new Axiom.Math.Vector3(fwd.X, fwd.Y, fwd.Z); | ||
108 | Axiom.Math.Vector3 axLeft = new Axiom.Math.Vector3(left.X, left.Y, left.Z); | ||
109 | Axiom.Math.Vector3 axUp = new Axiom.Math.Vector3(up.X, up.Y, up.Z); | ||
110 | |||
111 | axQ.FromAxes(axFwd, axLeft, axUp); | ||
112 | |||
113 | return new Rotation(axQ.x, axQ.y, axQ.z, axQ.w); | ||
114 | } | ||
115 | |||
116 | public Rotation osAxisAngle2Rot(Vector axis, float angle) | ||
117 | { | ||
118 | Axiom.Math.Quaternion axQ = Axiom.Math.Quaternion.FromAngleAxis(angle, new Axiom.Math.Vector3(axis.X, axis.Y, axis.Z)); | ||
119 | |||
120 | return new Rotation(axQ.x, axQ.y, axQ.z, axQ.w); | ||
121 | } | ||
122 | |||
123 | public string osBase64ToString(string str) | ||
124 | { | ||
125 | Encoding enc = System.Text.Encoding.UTF8; | ||
126 | return enc.GetString(Convert.FromBase64String(str)); | ||
127 | } | ||
128 | |||
129 | [Obsolete("Unimplemented")] | ||
130 | public void osBreakAllLinks() | ||
131 | { | ||
132 | return; | ||
133 | } | ||
24 | } | 134 | } |
25 | } | 135 | } |