aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-01 06:31:12 +0000
committerTeravus Ovares2008-05-01 06:31:12 +0000
commit1c697ef0d206445c6819e338626169fc6ef56432 (patch)
tree88d6b26b5982eb73f75a5f051c2f068c1d8d8f27 /OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
parent* Fix OBB raycaster to respond properly to rays cast from any direction. (diff)
downloadopensim-SC-1c697ef0d206445c6819e338626169fc6ef56432.zip
opensim-SC-1c697ef0d206445c6819e338626169fc6ef56432.tar.gz
opensim-SC-1c697ef0d206445c6819e338626169fc6ef56432.tar.bz2
opensim-SC-1c697ef0d206445c6819e338626169fc6ef56432.tar.xz
* You can now rez objects out of inventory at the correct offset from prim you rez it on. Including multi prim groups and prim that have different X/Y/Z scales.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs31
1 files changed, 29 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 863146c..5164d30 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -516,8 +516,35 @@ namespace OpenSim.Region.Environment.Scenes
516 m_scene.EventManager.OnBackup += ProcessBackup; 516 m_scene.EventManager.OnBackup += ProcessBackup;
517 } 517 }
518 } 518 }
519 public LLVector3 GroupScale()
520 {
521 LLVector3 minScale = new LLVector3(Constants.RegionSize,Constants.RegionSize,Constants.RegionSize);
522 LLVector3 maxScale = new LLVector3(0f,0f,0f);
523 LLVector3 finalScale = new LLVector3(0.5f, 0.5f, 0.5f);
524
525 lock (m_parts)
526 {
527 foreach (SceneObjectPart part in m_parts.Values)
528 {
529 LLVector3 partscale = part.Scale;
530 LLVector3 partoffset = part.OffsetPosition;
519 531
520 public EntityIntersection TestIntersection(Ray hRay) 532 minScale.X = (partscale.X + partoffset.X < minScale.X) ? partscale.X + partoffset.X : minScale.X;
533 minScale.Y = (partscale.Y + partoffset.Y < minScale.Y) ? partscale.X + partoffset.Y : minScale.Y;
534 minScale.Z = (partscale.Z + partoffset.Z < minScale.Z) ? partscale.X + partoffset.Z : minScale.Z;
535
536 maxScale.X = (partscale.X + partoffset.X > maxScale.X) ? partscale.X + partoffset.X : maxScale.X;
537 maxScale.Y = (partscale.Y + partoffset.Y > maxScale.Y) ? partscale.Y + partoffset.Y : maxScale.Y;
538 maxScale.Z = (partscale.Z + partoffset.Z > maxScale.Z) ? partscale.Z + partoffset.Z : maxScale.Z;
539 }
540 }
541 finalScale.X = (minScale.X > maxScale.X) ? minScale.X : maxScale.X;
542 finalScale.Y = (minScale.Y > maxScale.Y) ? minScale.Y : maxScale.Y;
543 finalScale.Z = (minScale.Z > maxScale.Z) ? minScale.Z : maxScale.Z;
544 return finalScale;
545
546 }
547 public EntityIntersection TestIntersection(Ray hRay, bool frontFacesOnly)
521 { 548 {
522 // We got a request from the inner_scene to raytrace along the Ray hRay 549 // We got a request from the inner_scene to raytrace along the Ray hRay
523 // We're going to check all of the prim in this group for intersection with the ray 550 // We're going to check all of the prim in this group for intersection with the ray
@@ -539,7 +566,7 @@ namespace OpenSim.Region.Environment.Scenes
539 // Telling the prim to raytrace. 566 // Telling the prim to raytrace.
540 //EntityIntersection inter = part.TestIntersection(hRay, parentrotation); 567 //EntityIntersection inter = part.TestIntersection(hRay, parentrotation);
541 568
542 EntityIntersection inter = part.TestIntersectionOBB(hRay, parentrotation); 569 EntityIntersection inter = part.TestIntersectionOBB(hRay, parentrotation,frontFacesOnly);
543 570
544 // This may need to be updated to the maximum draw distance possible.. 571 // This may need to be updated to the maximum draw distance possible..
545 // We might (and probably will) be checking for prim creation from other sims 572 // We might (and probably will) be checking for prim creation from other sims