aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
diff options
context:
space:
mode:
authoridb2008-12-05 16:48:47 +0000
committeridb2008-12-05 16:48:47 +0000
commit7ae9ec217d6e1ec039fbd6ed16c952d56cc63dc6 (patch)
tree6fed56271b075ef0c9c42e3cc899e86e54ea4c25 /OpenSim/Region/ScriptEngine/Shared/Helpers.cs
parentFixed Mantis #2756 (diff)
downloadopensim-SC-7ae9ec217d6e1ec039fbd6ed16c952d56cc63dc6.zip
opensim-SC-7ae9ec217d6e1ec039fbd6ed16c952d56cc63dc6.tar.gz
opensim-SC-7ae9ec217d6e1ec039fbd6ed16c952d56cc63dc6.tar.bz2
opensim-SC-7ae9ec217d6e1ec039fbd6ed16c952d56cc63dc6.tar.xz
Implementation of the llDetectedTouch* functions
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Helpers.cs58
1 files changed, 57 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
index a061fde..b9ff0cd 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
@@ -80,6 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
80 Rotation = new LSL_Types.Quaternion(); 80 Rotation = new LSL_Types.Quaternion();
81 Type = 0; 81 Type = 0;
82 Velocity = new LSL_Types.Vector3(); 82 Velocity = new LSL_Types.Vector3();
83 initializeSurfaceTouch();
83 } 84 }
84 85
85 public UUID Key; 86 public UUID Key;
@@ -93,6 +94,61 @@ namespace OpenSim.Region.ScriptEngine.Shared
93 public int Type; 94 public int Type;
94 public LSL_Types.Vector3 Velocity; 95 public LSL_Types.Vector3 Velocity;
95 96
97 private LSL_Types.Vector3 touchST;
98 public LSL_Types.Vector3 TouchST { get { return touchST; } }
99
100 private LSL_Types.Vector3 touchNormal;
101 public LSL_Types.Vector3 TouchNormal { get { return touchNormal; } }
102
103 private LSL_Types.Vector3 touchBinormal;
104 public LSL_Types.Vector3 TouchBinormal { get { return touchBinormal; } }
105
106 private LSL_Types.Vector3 touchPos;
107 public LSL_Types.Vector3 TouchPos { get { return touchPos; } }
108
109 private LSL_Types.Vector3 touchUV;
110 public LSL_Types.Vector3 TouchUV { get { return touchUV; } }
111
112 private int touchFace;
113 public int TouchFace { get { return touchFace; } }
114
115 // This can be done in two places including the constructor
116 // so be carefull what gets added here
117 private void initializeSurfaceTouch()
118 {
119 touchST = new LSL_Types.Vector3(-1.0, -1.0, 0.0);
120 touchNormal = new LSL_Types.Vector3();
121 touchBinormal = new LSL_Types.Vector3();
122 touchPos = new LSL_Types.Vector3();
123 touchUV = new LSL_Types.Vector3(-1.0, -1.0, 0.0);
124 touchFace = -1;
125 }
126
127 /*
128 * Set up the surface touch detected values
129 */
130 public SurfaceTouchEventArgs SurfaceTouchArgs
131 {
132 set
133 {
134 if (value == null)
135 {
136 // Initialise to defaults if no value
137 initializeSurfaceTouch();
138 }
139 else
140 {
141 // Set the values from the touch data provided by the client
142 touchST = new LSL_Types.Vector3(value.STCoord.X, value.STCoord.Y, value.STCoord.Z);
143 touchUV = new LSL_Types.Vector3(value.UVCoord.X, value.UVCoord.Y, value.UVCoord.Z);
144 touchNormal = new LSL_Types.Vector3(value.Normal.X, value.Normal.Y, value.Normal.Z);
145 touchBinormal = new LSL_Types.Vector3(value.Binormal.X, value.Binormal.Y, value.Binormal.Z);
146 touchPos = new LSL_Types.Vector3(value.Position.X, value.Position.Y, value.Position.Z);
147 touchFace = value.FaceIndex;
148 }
149 }
150 }
151
96 public void Populate(Scene scene) 152 public void Populate(Scene scene)
97 { 153 {
98 SceneObjectPart part = scene.GetSceneObjectPart(Key); 154 SceneObjectPart part = scene.GetSceneObjectPart(Key);
@@ -177,4 +233,4 @@ namespace OpenSim.Region.ScriptEngine.Shared
177 public Object[] Params; 233 public Object[] Params;
178 public DetectParams[] DetectParams; 234 public DetectParams[] DetectParams;
179 } 235 }
180} \ No newline at end of file 236}