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/InnerScene.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 'OpenSim/Region/Environment/Scenes/InnerScene.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 38a8a06..8f7cbee 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -253,6 +253,33 @@ namespace OpenSim.Region.Environment.Scenes | |||
253 | return null; | 253 | return null; |
254 | } | 254 | } |
255 | 255 | ||
256 | public EntityIntersection GetClosestIntersectingPrim(Ray hray) | ||
257 | { | ||
258 | // Primitive Ray Tracing | ||
259 | bool gothit = false; | ||
260 | float closestDistance = 280f; | ||
261 | EntityIntersection returnResult = new EntityIntersection(); | ||
262 | foreach (EntityBase ent in Entities.Values) | ||
263 | { | ||
264 | if (ent is SceneObjectGroup) | ||
265 | { | ||
266 | SceneObjectGroup reportingG = (SceneObjectGroup)ent; | ||
267 | EntityIntersection result = reportingG.testIntersection(hray); | ||
268 | if (result.HitTF) | ||
269 | { | ||
270 | if (result.distance < closestDistance) | ||
271 | { | ||
272 | gothit = true; | ||
273 | closestDistance = result.distance; | ||
274 | returnResult = result; | ||
275 | } | ||
276 | } | ||
277 | } | ||
278 | |||
279 | } | ||
280 | return returnResult; | ||
281 | } | ||
282 | |||
256 | public SceneObjectPart GetSceneObjectPart(uint localID) | 283 | public SceneObjectPart GetSceneObjectPart(uint localID) |
257 | { | 284 | { |
258 | SceneObjectGroup group = GetGroupByPrim(localID); | 285 | SceneObjectGroup group = GetGroupByPrim(localID); |