aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs76
1 files changed, 37 insertions, 39 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 89b68de..d710e49 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -931,7 +931,6 @@ namespace OpenSim.Region.Environment.Scenes
931 if (RayEndIsIntersection == (byte)1) 931 if (RayEndIsIntersection == (byte)1)
932 { 932 {
933 pos = RayEnd; 933 pos = RayEnd;
934 pos.Z += 0.25F;
935 return pos; 934 return pos;
936 } 935 }
937 if (RayTargetID != LLUUID.Zero) 936 if (RayTargetID != LLUUID.Zero)
@@ -987,14 +986,13 @@ namespace OpenSim.Region.Environment.Scenes
987 986
988 987
989 988
990 pos.Z += 0.25F; 989
991 return pos; 990 return pos;
992 } 991 }
993 else 992 else
994 { 993 {
995 // fall back to our stupid functionality 994 // fall back to our stupid functionality
996 pos = RayEnd; 995 pos = RayEnd;
997 pos.Z += 0.25F;
998 return pos; 996 return pos;
999 } 997 }
1000 } 998 }
@@ -1002,7 +1000,6 @@ namespace OpenSim.Region.Environment.Scenes
1002 { 1000 {
1003 // fall back to our stupid functionality 1001 // fall back to our stupid functionality
1004 pos = RayEnd; 1002 pos = RayEnd;
1005 pos.Z += 0.25F;
1006 return pos; 1003 return pos;
1007 } 1004 }
1008 1005
@@ -1012,7 +1009,12 @@ namespace OpenSim.Region.Environment.Scenes
1012 byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID, 1009 byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID,
1013 byte RayEndIsIntersection) 1010 byte RayEndIsIntersection)
1014 { 1011 {
1015 1012 // What we're *supposed* to do is raytrace from the camera position given by the client to the nearest collision
1013 // in the direction the client supplies (the ground level that we clicked)
1014 // This function is pretty crappy right now.. so we're not affecting where the newly rezzed objects go
1015 // Test it if you like. The console will write where it guesses a collision took place. if it thinks one did.
1016 // It's wrong many times though.
1017
1016 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection); 1018 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection);
1017 1019
1018 1020
@@ -1020,40 +1022,36 @@ namespace OpenSim.Region.Environment.Scenes
1020 1022
1021 if (PermissionsMngr.CanRezObject(ownerID, pos)) 1023 if (PermissionsMngr.CanRezObject(ownerID, pos))
1022 { 1024 {
1023 // rez ON the ground, not IN the ground
1024
1025
1026 1025
1027 AddNewPrim(ownerID, pos, rot, shape); 1026 // rez ON the ground, not IN the ground
1028 } 1027 pos.Z += 0.25F;
1029 } 1028
1030 1029
1031 public virtual void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape) 1030 SceneObjectGroup sceneOb =
1032 { 1031 new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape);
1033 SceneObjectGroup sceneOb = 1032 AddEntity(sceneOb);
1034 new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); 1033 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
1035 AddEntity(sceneOb); 1034 // if grass or tree, make phantom
1036 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); 1035 //rootPart.ApplySanePermissions();
1037 // if grass or tree, make phantom 1036 if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255) || (rootPart.Shape.PCode == 111))
1038 //rootPart.ApplySanePermissions(); 1037 {
1039 if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255) || (rootPart.Shape.PCode == 111)) 1038 rootPart.AddFlag(LLObject.ObjectFlags.Phantom);
1040 { 1039 //rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom;
1041 rootPart.AddFlag(LLObject.ObjectFlags.Phantom); 1040 }
1042 //rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom; 1041 // if not phantom, add to physics
1043 } 1042 bool UsePhysics = (((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim);
1044 // if not phantom, add to physics 1043 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
1045 bool UsePhysics = (((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim); 1044 {
1046 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) 1045 rootPart.PhysActor =
1047 { 1046 PhysicsScene.AddPrimShape(
1048 rootPart.PhysActor = 1047 rootPart.Name,
1049 PhysicsScene.AddPrimShape( 1048 rootPart.Shape,
1050 rootPart.Name, 1049 new PhysicsVector(pos.X, pos.Y, pos.Z),
1051 rootPart.Shape, 1050 new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
1052 new PhysicsVector(pos.X, pos.Y, pos.Z), 1051 new Quaternion(), UsePhysics);
1053 new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), 1052 // subscribe to physics events.
1054 new Quaternion(), UsePhysics); 1053 rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
1055 // subscribe to physics events. 1054 }
1056 rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
1057 } 1055 }
1058 } 1056 }
1059 1057
@@ -1500,7 +1498,7 @@ namespace OpenSim.Region.Environment.Scenes
1500 m_innerScene.removeUserCount(true); 1498 m_innerScene.removeUserCount(true);
1501 } 1499 }
1502 // Tell a single agent to disconnect from the region. 1500 // Tell a single agent to disconnect from the region.
1503 libsecondlife.Packets.DisableSimulatorPacket disable = (libsecondlife.Packets.DisableSimulatorPacket) PacketPool.Instance.GetPacket(libsecondlife.Packets.PacketType.DisableSimulator); 1501 DisableSimulatorPacket disable = new DisableSimulatorPacket();
1504 presence.ControllingClient.OutPacket(disable, ThrottleOutPacketType.Task); 1502 presence.ControllingClient.OutPacket(disable, ThrottleOutPacketType.Task);
1505 } 1503 }
1506 } 1504 }