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