aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs
diff options
context:
space:
mode:
authorAdam Frisby2009-04-11 10:21:04 +0000
committerAdam Frisby2009-04-11 10:21:04 +0000
commitb8619386eb31a2bf3f460e464d0237f6bee5f56f (patch)
treee9a1f1559e04e3f3597aa8ed6ef37c6a63254ca2 /OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs
parentCorrect Opensim.ini.example to reflect the default settings for clouds. (diff)
downloadopensim-SC-b8619386eb31a2bf3f460e464d0237f6bee5f56f.zip
opensim-SC-b8619386eb31a2bf3f460e464d0237f6bee5f56f.tar.gz
opensim-SC-b8619386eb31a2bf3f460e464d0237f6bee5f56f.tar.bz2
opensim-SC-b8619386eb31a2bf3f460e464d0237f6bee5f56f.tar.xz
* Minor MRM Cleanup
* Interfaces now live in Interfaces subdirectory. * Namespace does not yet reflect this change. * Final namespace for MRMs will probably sit somewhere around OpenSim.Extend.MRM[?]
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs223
1 files changed, 223 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs
new file mode 100644
index 0000000..e17b716
--- /dev/null
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs
@@ -0,0 +1,223 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Drawing;
30using OpenMetaverse;
31using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object;
32
33namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
34{
35 public class TouchEventArgs : EventArgs
36 {
37 public IAvatar Avatar;
38
39 public Vector3 TouchBiNormal;
40 public Vector3 TouchNormal;
41 public Vector3 TouchPosition;
42
43 public Vector2 TouchUV;
44 public Vector2 TouchST;
45
46 public int TouchMaterialIndex;
47 }
48
49 public delegate void OnTouchDelegate(IObject sender, TouchEventArgs e);
50
51 public interface IObject : IEntity
52 {
53 #region Events
54
55 event OnTouchDelegate OnTouch;
56
57 #endregion
58
59 /// <summary>
60 /// Returns whether or not this object is still in the world.
61 /// Eg, if you store an IObject reference, however the object
62 /// is deleted before you use it, it will throw a NullReference
63 /// exception. 'Exists' allows you to check the object is still
64 /// in play before utilizing it.
65 /// </summary>
66 /// <example>
67 /// IObject deleteMe = World.Objects[0];
68 ///
69 /// if (deleteMe.Exists) {
70 /// deleteMe.Say("Hello, I still exist!");
71 /// }
72 ///
73 /// World.Objects.Remove(deleteMe);
74 ///
75 /// if (!deleteMe.Exists) {
76 /// Host.Console.Info("I was deleted");
77 /// }
78 /// </example>
79 /// <remarks>
80 /// Objects should be near-guarunteed to exist for any event which
81 /// passes them as an argument. Storing an object for a longer period
82 /// of time however will limit their reliability.
83 ///
84 /// It is a good practice to use Try/Catch blocks handling for
85 /// NullReferenceException, when accessing remote objects.
86 /// </remarks>
87 bool Exists { get; }
88
89 /// <summary>
90 /// The local region-unique ID for this object.
91 /// </summary>
92 uint LocalID { get; }
93
94 /// <summary>
95 /// The description assigned to this object.
96 /// </summary>
97 String Description { get; set; }
98
99 /// <summary>
100 /// Returns the root object of a linkset. If this object is the root, it will return itself.
101 /// </summary>
102 IObject Root { get; }
103
104 /// <summary>
105 /// Returns a collection of objects which are linked to the current object. Does not include the root object.
106 /// </summary>
107 IObject[] Children { get; }
108
109 /// <summary>
110 /// Returns a list of materials attached to this object. Each may contain unique texture
111 /// and other visual information. For primitive based objects, this correlates with
112 /// Object Faces. For mesh based objects, this correlates with Materials.
113 /// </summary>
114 IObjectMaterial[] Materials { get; }
115
116 /// <summary>
117 /// The bounding box of the object. Primitive and Mesh objects alike are scaled to fit within these bounds.
118 /// </summary>
119 Vector3 Scale { get; set; }
120
121 /// <summary>
122 /// The rotation of the object relative to the Scene
123 /// </summary>
124 Quaternion WorldRotation { get; set; }
125
126 /// <summary>
127 /// The rotation of the object relative to a parent object
128 /// If root, works the same as WorldRotation
129 /// </summary>
130 Quaternion OffsetRotation { get; set; }
131
132 /// <summary>
133 /// The position of the object relative to a parent object
134 /// If root, works the same as WorldPosition
135 /// </summary>
136 Vector3 OffsetPosition { get; set; }
137
138 Vector3 SitTarget { get; set; }
139 String SitTargetText { get; set; }
140
141 String TouchText { get; set; }
142
143 /// <summary>
144 /// Text to be associated with this object, in the
145 /// Second Life(r) viewer, this is shown above the
146 /// object.
147 /// </summary>
148 String Text { get; set; }
149
150 bool IsRotationLockedX { get; set; } // SetStatus(!ROTATE_X)
151 bool IsRotationLockedY { get; set; } // SetStatus(!ROTATE_Y)
152 bool IsRotationLockedZ { get; set; } // SetStatus(!ROTATE_Z)
153 bool IsSandboxed { get; set; } // SetStatus(SANDBOX)
154 bool IsImmotile { get; set; } // SetStatus(BLOCK_GRAB)
155 bool IsAlwaysReturned { get; set; } // SetStatus(!DIE_AT_EDGE)
156 bool IsTemporary { get; set; } // TEMP_ON_REZ
157
158 bool IsFlexible { get; set; }
159
160 PrimType PrimShape { get; set; }
161 // TODO:
162 // PrimHole
163 // Repeats, Offsets, Cut/Dimple/ProfileCut
164 // Hollow, Twist, HoleSize,
165 // Taper[A+B], Shear[A+B], Revolutions,
166 // RadiusOffset, Skew
167
168 PhysicsMaterial PhysicsMaterial { get; set; }
169
170 IObjectPhysics Physics { get; }
171
172
173 /// <summary>
174 /// Causes the object to speak to its surroundings,
175 /// equivilent to LSL/OSSL llSay
176 /// </summary>
177 /// <param name="msg">The message to send to the user</param>
178 void Say(string msg);
179
180 }
181
182 public enum PhysicsMaterial
183 {
184 Default,
185 Glass,
186 Metal,
187 Plastic,
188 Wood,
189 Rubber,
190 Stone,
191 Flesh
192 }
193
194 public enum PrimType
195 {
196 NotPrimitive = 255,
197 Box = 0,
198 Cylinder = 1,
199 Prism = 2,
200 Sphere = 3,
201 Torus = 4,
202 Tube = 5,
203 Ring = 6,
204 Sculpt = 7
205 }
206
207 public enum TextureMapping
208 {
209 Default,
210 Planar
211 }
212
213 public interface IObjectMaterial
214 {
215 Color Color { get; set; }
216 UUID Texture { get; set; }
217 TextureMapping Mapping { get; set; } // SetPrimParms(PRIM_TEXGEN)
218 bool Bright { get; set; } // SetPrimParms(FULLBRIGHT)
219 double Bloom { get; set; } // SetPrimParms(GLOW)
220 bool Shiny { get; set; } // SetPrimParms(SHINY)
221 bool BumpMap { get; set; } // SetPrimParms(BUMPMAP) [DEPRECIATE IN FAVOUR OF UUID?]
222 }
223}