diff options
author | Teravus Ovares | 2007-11-23 05:56:35 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-11-23 05:56:35 +0000 |
commit | 1ecd803e87119c0344b91798792130155a82859c (patch) | |
tree | 74cbd2102051d03acfa78f5763438fd0b0a19778 /OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |
parent | Fixed Terrain rescale command (diff) | |
download | opensim-SC-1ecd803e87119c0344b91798792130155a82859c.zip opensim-SC-1ecd803e87119c0344b91798792130155a82859c.tar.gz opensim-SC-1ecd803e87119c0344b91798792130155a82859c.tar.bz2 opensim-SC-1ecd803e87119c0344b91798792130155a82859c.tar.xz |
* added some functions for use in raytracing. They're kind of crappy now, so they only display 'guesses' on the console when you rez a prim.
* any math gurus who'd like to improve rezzing need only to make the raytracer in SceneObjectPart work :D
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 474d434..45581c5 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -353,6 +353,44 @@ namespace OpenSim.Region.Environment.Scenes | |||
353 | } | 353 | } |
354 | } | 354 | } |
355 | 355 | ||
356 | public EntityIntersection testIntersection(Ray hRay) | ||
357 | { | ||
358 | EntityIntersection returnresult = new EntityIntersection(); | ||
359 | bool gothit = false; | ||
360 | foreach (SceneObjectPart part in m_parts.Values) | ||
361 | { | ||
362 | SceneObjectPart returnThisPart = null; | ||
363 | Vector3 partPosition = new Vector3(part.AbsolutePosition.X,part.AbsolutePosition.Y,part.AbsolutePosition.Z); | ||
364 | Quaternion parentrotation = new Quaternion(GroupRotation.W,GroupRotation.X,GroupRotation.Y,GroupRotation.Z); | ||
365 | EntityIntersection inter = part.testIntersection(hRay,parentrotation); | ||
366 | |||
367 | float idist = 256f; | ||
368 | |||
369 | |||
370 | |||
371 | |||
372 | if (inter.HitTF) { | ||
373 | // We need to find the closest prim to return to the testcaller along the ray | ||
374 | if (inter.distance < idist) { | ||
375 | |||
376 | idist = inter.distance; | ||
377 | returnresult.HitTF = true; | ||
378 | returnresult.ipoint = inter.ipoint; | ||
379 | returnresult.obj = part; | ||
380 | returnresult.normal = inter.normal; | ||
381 | returnresult.distance = inter.distance; | ||
382 | gothit = true; | ||
383 | } | ||
384 | } | ||
385 | |||
386 | |||
387 | } | ||
388 | return returnresult; | ||
389 | |||
390 | } | ||
391 | |||
392 | |||
393 | |||
356 | /// <summary> | 394 | /// <summary> |
357 | /// | 395 | /// |
358 | /// </summary> | 396 | /// </summary> |