OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IObject.cs
Go to the documentation of this file.
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 
28 using System;
29 using System.Drawing;
30 using OpenMetaverse;
31 using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object;
32 
33 namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
34 {
35  [Serializable]
36  public class TouchEventArgs : EventArgs
37  {
38  public IAvatar Avatar;
39 
40  public Vector3 TouchBiNormal;
41  public Vector3 TouchNormal;
42  public Vector3 TouchPosition;
43 
44  public Vector2 TouchUV;
45  public Vector2 TouchST;
46 
47  public int TouchMaterialIndex;
48  }
49 
50  public delegate void OnTouchDelegate(IObject sender, TouchEventArgs e);
51 
52  public interface IObject : IEntity
53  {
54  #region Events
55 
57 
58  #endregion
59 
88  bool Exists { get; }
89 
93  uint LocalID { get; }
94 
98  String Description { get; set; }
99 
103  UUID OwnerId { get; }
104 
108  UUID CreatorId { get; }
109 
113  IObject Root { get; }
114 
118  IObject[] Children { get; }
119 
125  IObjectMaterial[] Materials { get; }
126 
130  Vector3 Scale { get; set; }
131 
135  Quaternion WorldRotation { get; set; }
136 
141  Quaternion OffsetRotation { get; set; }
142 
147  Vector3 OffsetPosition { get; set; }
148 
149  Vector3 SitTarget { get; set; }
150  String SitTargetText { get; set; }
151 
152  String TouchText { get; set; }
153 
159  String Text { get; set; }
160 
161  bool IsRotationLockedX { get; set; } // SetStatus(!ROTATE_X)
162  bool IsRotationLockedY { get; set; } // SetStatus(!ROTATE_Y)
163  bool IsRotationLockedZ { get; set; } // SetStatus(!ROTATE_Z)
164  bool IsSandboxed { get; set; } // SetStatus(SANDBOX)
165  bool IsImmotile { get; set; } // SetStatus(BLOCK_GRAB)
166  bool IsAlwaysReturned { get; set; } // SetStatus(!DIE_AT_EDGE)
167  bool IsTemporary { get; set; } // TEMP_ON_REZ
168 
169  bool IsFlexible { get; set; }
170 
171  IObjectShape Shape { get; }
172 
173  // TODO:
174  // PrimHole
175  // Repeats, Offsets, Cut/Dimple/ProfileCut
176  // Hollow, Twist, HoleSize,
177  // Taper[A+B], Shear[A+B], Revolutions,
178  // RadiusOffset, Skew
179 
181 
182  IObjectPhysics Physics { get; }
183 
184  IObjectSound Sound { get; }
185 
191  void Say(string msg);
192 
199  void Say(string msg,int channel);
200 
209  void Dialog(UUID avatar, string message, string[] buttons, int chat_channel);
210 
214  IObjectInventory Inventory { get; }
215  }
216 
217  public enum PhysicsMaterial
218  {
219  Default,
220  Glass,
221  Metal,
222  Plastic,
223  Wood,
224  Rubber,
225  Stone,
226  Flesh
227  }
228 
229  public enum TextureMapping
230  {
231  Default,
232  Planar
233  }
234 
235  public interface IObjectMaterial
236  {
237  Color Color { get; set; }
238  UUID Texture { get; set; }
239  TextureMapping Mapping { get; set; } // SetPrimParms(PRIM_TEXGEN)
240  bool Bright { get; set; } // SetPrimParms(FULLBRIGHT)
241  double Bloom { get; set; } // SetPrimParms(GLOW)
242  bool Shiny { get; set; } // SetPrimParms(SHINY)
243  bool BumpMap { get; set; } // SetPrimParms(BUMPMAP) [DEPRECATE IN FAVOUR OF UUID?]
244  }
245 }
This implements an interface similar to that provided by physics engines to OpenSim internally...
delegate void OnTouchDelegate(IObject sender, TouchEventArgs e)
This implements the methods neccesary to operate on the inventory of an object