diff options
author | MW | 2007-12-11 18:29:19 +0000 |
---|---|---|
committer | MW | 2007-12-11 18:29:19 +0000 |
commit | 60c96ab6878ce0d8d5c7325a83a104081c0673b6 (patch) | |
tree | 8d474ff4228517c6d3de2e7a8098eb4c25a019f7 /OpenSim/Region | |
parent | Minor cleanup/refactoring of ScenePresence. (diff) | |
download | opensim-SC-60c96ab6878ce0d8d5c7325a83a104081c0673b6.zip opensim-SC-60c96ab6878ce0d8d5c7325a83a104081c0673b6.tar.gz opensim-SC-60c96ab6878ce0d8d5c7325a83a104081c0673b6.tar.bz2 opensim-SC-60c96ab6878ce0d8d5c7325a83a104081c0673b6.tar.xz |
Couple of more small changes
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 24 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 5 |
2 files changed, 20 insertions, 9 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; |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 89e2f0d..a039015 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -1316,8 +1316,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
1316 | if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) | 1316 | if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) |
1317 | { | 1317 | { |
1318 | AbsolutePosition = pos; | 1318 | AbsolutePosition = pos; |
1319 | ScheduleGroupForTerseUpdate(); | 1319 | |
1320 | } | 1320 | } |
1321 | //we need to do a terse update even if the move wasn't allowed | ||
1322 | // so that the position is reset in the client (the object snaps back) | ||
1323 | ScheduleGroupForTerseUpdate(); | ||
1321 | } | 1324 | } |
1322 | 1325 | ||
1323 | /// <summary> | 1326 | /// <summary> |