aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorMW2007-12-11 18:29:19 +0000
committerMW2007-12-11 18:29:19 +0000
commit60c96ab6878ce0d8d5c7325a83a104081c0673b6 (patch)
tree8d474ff4228517c6d3de2e7a8098eb4c25a019f7 /OpenSim/Region/Environment/Scenes/Scene.cs
parentMinor cleanup/refactoring of ScenePresence. (diff)
downloadopensim-SC_OLD-60c96ab6878ce0d8d5c7325a83a104081c0673b6.zip
opensim-SC_OLD-60c96ab6878ce0d8d5c7325a83a104081c0673b6.tar.gz
opensim-SC_OLD-60c96ab6878ce0d8d5c7325a83a104081c0673b6.tar.bz2
opensim-SC_OLD-60c96ab6878ce0d8d5c7325a83a104081c0673b6.tar.xz
Couple of more small changes
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs24
1 files changed, 16 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index e4526b2..324b7d3 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -845,20 +845,27 @@ namespace OpenSim.Region.Environment.Scenes
845 845
846 if (PermissionsMngr.CanRezObject(ownerID, pos)) 846 if (PermissionsMngr.CanRezObject(ownerID, pos))
847 { 847 {
848 Vector3 CameraPosition = ((ScenePresence)GetScenePresence(ownerID)).CameraPosition;
849 Vector3 rayEnd = new Vector3(pos.X, pos.Y, pos.Z);
850 848
851 float raydistance = m_innerScene.Vector3Distance(CameraPosition, rayEnd); 849 EntityIntersection rayTracing = null;
850 ScenePresence presence = ((ScenePresence)GetScenePresence(ownerID));
851 if (presence != null)
852 {
853 Vector3 CameraPosition = presence.CameraPosition;
854 Vector3 rayEnd = new Vector3(pos.X, pos.Y, pos.Z);
852 855
853 Vector3 rayDirection = new Vector3(rayEnd.x / raydistance, rayEnd.y / raydistance, rayEnd.z / raydistance); 856 float raydistance = m_innerScene.Vector3Distance(CameraPosition, rayEnd);
854 857
855 Ray rezRay = new Ray(CameraPosition, rayDirection); 858 Vector3 rayDirection = new Vector3(rayEnd.x / raydistance, rayEnd.y / raydistance, rayEnd.z / raydistance);
856 859
857 Vector3 RezDirectionFromCamera = rezRay.Direction; 860 Ray rezRay = new Ray(CameraPosition, rayDirection);
858 861
859 EntityIntersection rayTracing = m_innerScene.GetClosestIntersectingPrim(rezRay); 862 Vector3 RezDirectionFromCamera = rezRay.Direction;
860 863
861 if (rayTracing.HitTF) 864 rayTracing = m_innerScene.GetClosestIntersectingPrim(rezRay);
865
866 }
867
868 if ((rayTracing != null) && ( rayTracing.HitTF))
862 { 869 {
863 // We raytraced and found a prim in the way of the ground.. so 870 // We raytraced and found a prim in the way of the ground.. so
864 // We will rez the object somewhere close to the prim. Better math needed. This is a Stub 871 // We will rez the object somewhere close to the prim. Better math needed. This is a Stub
@@ -918,6 +925,7 @@ namespace OpenSim.Region.Environment.Scenes
918 { 925 {
919 PrimitiveBaseShape treeShape = new PrimitiveBaseShape(); 926 PrimitiveBaseShape treeShape = new PrimitiveBaseShape();
920 treeShape.PathCurve = 16; 927 treeShape.PathCurve = 16;
928 treeShape.PathEnd = 49900;
921 treeShape.PCode = newTree ? (byte)libsecondlife.ObjectManager.PCode.NewTree : (byte)libsecondlife.ObjectManager.PCode.Tree; 929 treeShape.PCode = newTree ? (byte)libsecondlife.ObjectManager.PCode.NewTree : (byte)libsecondlife.ObjectManager.PCode.Tree;
922 treeShape.Scale = scale; 930 treeShape.Scale = scale;
923 treeShape.State = (byte)treeType; 931 treeShape.State = (byte)treeType;