aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authorlbsa712007-12-28 08:34:38 +0000
committerlbsa712007-12-28 08:34:38 +0000
commit8cd72beb86d2a563bdaf88b20aa76d9bafa6b971 (patch)
tree8eaac3b70eb4b62db89cdfc7b854e85fa2430255 /OpenSim/Region/Environment/Scenes
parent* Patch from Melanie. Thanks Melanie! (diff)
downloadopensim-SC_OLD-8cd72beb86d2a563bdaf88b20aa76d9bafa6b971.zip
opensim-SC_OLD-8cd72beb86d2a563bdaf88b20aa76d9bafa6b971.tar.gz
opensim-SC_OLD-8cd72beb86d2a563bdaf88b20aa76d9bafa6b971.tar.bz2
opensim-SC_OLD-8cd72beb86d2a563bdaf88b20aa76d9bafa6b971.tar.xz
* Moved PrimitiveBaseShape subclasses into factory methods - the subclassing scheme won't hold for serialization
* Extracted out the 'old' AddNewPrimitive that places an object at an exact pos, without the raytracing
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs65
1 files changed, 33 insertions, 32 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 077157f..d8c5255 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1016,42 +1016,43 @@ namespace OpenSim.Region.Environment.Scenes
1016 // It's wrong many times though. 1016 // It's wrong many times though.
1017 1017
1018 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection); 1018 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection);
1019
1020
1021
1022 1019
1023 if (PermissionsMngr.CanRezObject(ownerID, pos)) 1020 if (PermissionsMngr.CanRezObject(ownerID, pos))
1024 { 1021 {
1025 1022 // rez ON the ground, not IN the ground
1026 // rez ON the ground, not IN the ground
1027 pos.Z += 0.25F; 1023 pos.Z += 0.25F;
1028 1024
1029 1025 AddNewPrim(ownerID, pos, rot, shape);
1030 SceneObjectGroup sceneOb = 1026 }
1031 new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); 1027 }
1032 AddEntity(sceneOb); 1028
1033 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); 1029 public virtual void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape)
1034 // if grass or tree, make phantom 1030 {
1035 //rootPart.ApplySanePermissions(); 1031 SceneObjectGroup sceneOb =
1036 if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255) || (rootPart.Shape.PCode == 111)) 1032 new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape);
1037 { 1033
1038 rootPart.AddFlag(LLObject.ObjectFlags.Phantom); 1034 AddEntity(sceneOb);
1039 //rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom; 1035 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
1040 } 1036 // if grass or tree, make phantom
1041 // if not phantom, add to physics 1037 //rootPart.ApplySanePermissions();
1042 bool UsePhysics = (((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim); 1038 if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255) || (rootPart.Shape.PCode == 111))
1043 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) 1039 {
1044 { 1040 rootPart.AddFlag(LLObject.ObjectFlags.Phantom);
1045 rootPart.PhysActor = 1041 //rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom;
1046 PhysicsScene.AddPrimShape( 1042 }
1047 rootPart.Name, 1043 // if not phantom, add to physics
1048 rootPart.Shape, 1044 bool UsePhysics = (((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim);
1049 new PhysicsVector(pos.X, pos.Y, pos.Z), 1045 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
1050 new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), 1046 {
1051 new Quaternion(), UsePhysics); 1047 rootPart.PhysActor =
1052 // subscribe to physics events. 1048 PhysicsScene.AddPrimShape(
1053 rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); 1049 rootPart.Name,
1054 } 1050 rootPart.Shape,
1051 new PhysicsVector(pos.X, pos.Y, pos.Z),
1052 new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
1053 new Quaternion(), UsePhysics);
1054 // subscribe to physics events.
1055 rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
1055 } 1056 }
1056 } 1057 }
1057 1058