diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 24 |
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; |