aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs
diff options
context:
space:
mode:
authorSean Dague2007-12-05 18:45:05 +0000
committerSean Dague2007-12-05 18:45:05 +0000
commit9c81b8a430b7fc8b0181310132f4bc9de414f19d (patch)
treeba6b03695d1bfdebfbc3c81bd55bc8ac41eeac46 /OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs
parent* Applied MSSQL Patch from akokko, Thanks! akokko (diff)
downloadopensim-SC-9c81b8a430b7fc8b0181310132f4bc9de414f19d.zip
opensim-SC-9c81b8a430b7fc8b0181310132f4bc9de414f19d.tar.gz
opensim-SC-9c81b8a430b7fc8b0181310132f4bc9de414f19d.tar.bz2
opensim-SC-9c81b8a430b7fc8b0181310132f4bc9de414f19d.tar.xz
From Gary Chernega (IBM)
This patch adds x, y, and z offsets to the load-xml command. If you had a prim at 100,100,20 thats where it would get loaded everytime. This patch lets you place it at an offset from 100,100,20.. as such: load-xml <filespec> -newUI 3 1 2 Loading the prim at 103, 101, 22
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs b/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs
index ab8f835..9316989 100644
--- a/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs
@@ -23,7 +23,7 @@ namespace OpenSim.Region.Environment.Scenes
23 m_regInfo = regionInfo; 23 m_regInfo = regionInfo;
24 } 24 }
25 25
26 public void LoadPrimsFromXml(string fileName, bool newIDS) 26 public void LoadPrimsFromXml(string fileName, bool newIDS, LLVector3 loadOffset)
27 { 27 {
28 XmlDocument doc = new XmlDocument(); 28 XmlDocument doc = new XmlDocument();
29 XmlNode rootNode; 29 XmlNode rootNode;
@@ -48,14 +48,17 @@ namespace OpenSim.Region.Environment.Scenes
48 m_innerScene.AddEntity(obj); 48 m_innerScene.AddEntity(obj);
49 49
50 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); 50 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
51 // Apply loadOffsets for load/import and move combinations
52 rootPart.GroupPosition = rootPart.AbsolutePosition + loadOffset;
51 bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0) && m_parentScene.m_physicalPrim); 53 bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0) && m_parentScene.m_physicalPrim);
52 if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) 54 if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0)
53 { 55 {
54 rootPart.PhysActor = m_innerScene.PhysicsScene.AddPrimShape( 56 rootPart.PhysActor = m_innerScene.PhysicsScene.AddPrimShape(
55 rootPart.Name, 57 rootPart.Name,
56 rootPart.Shape, 58 rootPart.Shape,
57 new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, 59 new PhysicsVector(rootPart.AbsolutePosition.X + loadOffset.X,
58 rootPart.AbsolutePosition.Z), 60 rootPart.AbsolutePosition.Y + loadOffset.Y,
61 rootPart.AbsolutePosition.Z + loadOffset.Z),
59 new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), 62 new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
60 new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, 63 new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
61 rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics); 64 rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics);