aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorlbsa712007-12-30 16:00:55 +0000
committerlbsa712007-12-30 16:00:55 +0000
commit14a191b285c7bf14a1aa46457fb5c9c3425510c1 (patch)
tree52c136474133609a79a2e8a5786311a31e5c399d /OpenSim/Region
parentSet svn:eol-style. (diff)
downloadopensim-SC-14a191b285c7bf14a1aa46457fb5c9c3425510c1.zip
opensim-SC-14a191b285c7bf14a1aa46457fb5c9c3425510c1.tar.gz
opensim-SC-14a191b285c7bf14a1aa46457fb5c9c3425510c1.tar.bz2
opensim-SC-14a191b285c7bf14a1aa46457fb5c9c3425510c1.tar.xz
* re-applied AddNewPrim refactoring... third time now...
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs70
1 files changed, 34 insertions, 36 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index d710e49..a0f19bd 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1008,13 +1008,7 @@ namespace OpenSim.Region.Environment.Scenes
1008 public virtual void AddNewPrim(LLUUID ownerID, LLVector3 RayEnd, LLQuaternion rot, PrimitiveBaseShape shape, 1008 public virtual void AddNewPrim(LLUUID ownerID, LLVector3 RayEnd, LLQuaternion rot, PrimitiveBaseShape shape,
1009 byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID, 1009 byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID,
1010 byte RayEndIsIntersection) 1010 byte RayEndIsIntersection)
1011 { 1011 {
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
1018 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection); 1012 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection);
1019 1013
1020 1014
@@ -1022,36 +1016,40 @@ namespace OpenSim.Region.Environment.Scenes
1022 1016
1023 if (PermissionsMngr.CanRezObject(ownerID, pos)) 1017 if (PermissionsMngr.CanRezObject(ownerID, pos))
1024 { 1018 {
1025 1019 // rez ON the ground, not IN the ground
1026 // rez ON the ground, not IN the ground
1027 pos.Z += 0.25F; 1020 pos.Z += 0.25F;
1028 1021
1029 1022
1030 SceneObjectGroup sceneOb = 1023 AddNewPrim(ownerID, pos, rot, shape);
1031 new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); 1024 }
1032 AddEntity(sceneOb); 1025 }
1033 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); 1026
1034 // if grass or tree, make phantom 1027 public virtual void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape)
1035 //rootPart.ApplySanePermissions(); 1028 {
1036 if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255) || (rootPart.Shape.PCode == 111)) 1029 SceneObjectGroup sceneOb =
1037 { 1030 new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape);
1038 rootPart.AddFlag(LLObject.ObjectFlags.Phantom); 1031 AddEntity(sceneOb);
1039 //rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom; 1032 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
1040 } 1033 // if grass or tree, make phantom
1041 // if not phantom, add to physics 1034 //rootPart.ApplySanePermissions();
1042 bool UsePhysics = (((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim); 1035 if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255) || (rootPart.Shape.PCode == 111))
1043 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) 1036 {
1044 { 1037 rootPart.AddFlag(LLObject.ObjectFlags.Phantom);
1045 rootPart.PhysActor = 1038 //rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom;
1046 PhysicsScene.AddPrimShape( 1039 }
1047 rootPart.Name, 1040 // if not phantom, add to physics
1048 rootPart.Shape, 1041 bool UsePhysics = (((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim);
1049 new PhysicsVector(pos.X, pos.Y, pos.Z), 1042 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
1050 new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), 1043 {
1051 new Quaternion(), UsePhysics); 1044 rootPart.PhysActor =
1052 // subscribe to physics events. 1045 PhysicsScene.AddPrimShape(
1053 rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); 1046 rootPart.Name,
1054 } 1047 rootPart.Shape,
1048 new PhysicsVector(pos.X, pos.Y, pos.Z),
1049 new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
1050 new Quaternion(), UsePhysics);
1051 // subscribe to physics events.
1052 rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
1055 } 1053 }
1056 } 1054 }
1057 1055