diff options
author | Justin Clark-Casey (justincc) | 2011-05-21 00:02:53 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-05-21 00:02:53 +0100 |
commit | 90567a9eaac717ab86316c078e148f8fe13432ac (patch) | |
tree | 3a87213e6a946c25b6a029dbf911b75038b8a070 /OpenSim/Region/Framework/Scenes/SceneGraph.cs | |
parent | refactor TestRezObjectFromInventoryItem() (diff) | |
download | opensim-SC_OLD-90567a9eaac717ab86316c078e148f8fe13432ac.zip opensim-SC_OLD-90567a9eaac717ab86316c078e148f8fe13432ac.tar.gz opensim-SC_OLD-90567a9eaac717ab86316c078e148f8fe13432ac.tar.bz2 opensim-SC_OLD-90567a9eaac717ab86316c078e148f8fe13432ac.tar.xz |
refactor Scene.RezObject() to use AddNewSceneObject() rather than copy/pasting code with small differences
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 0cff011..cdb4e41 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -311,25 +311,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
311 | /// This method does not send updates to the client - callers need to handle this themselves. | 311 | /// This method does not send updates to the client - callers need to handle this themselves. |
312 | /// <param name="sceneObject"></param> | 312 | /// <param name="sceneObject"></param> |
313 | /// <param name="attachToBackup"></param> | 313 | /// <param name="attachToBackup"></param> |
314 | /// <param name="pos">Position of the object</param> | 314 | /// <param name="pos">Position of the object. If null then the position stored in the object is used.</param> |
315 | /// <param name="rot">Rotation of the object</param> | 315 | /// <param name="rot">Rotation of the object. If null then the rotation stored in the object is used.</param> |
316 | /// <param name="vel">Velocity of the object. This parameter only has an effect if the object is physical</param> | 316 | /// <param name="vel">Velocity of the object. This parameter only has an effect if the object is physical</param> |
317 | /// <returns></returns> | 317 | /// <returns></returns> |
318 | public bool AddNewSceneObject( | 318 | public bool AddNewSceneObject( |
319 | SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel) | 319 | SceneObjectGroup sceneObject, bool attachToBackup, Vector3? pos, Quaternion? rot, Vector3 vel) |
320 | { | 320 | { |
321 | AddNewSceneObject(sceneObject, true, false); | 321 | AddNewSceneObject(sceneObject, true, false); |
322 | 322 | ||
323 | // we set it's position in world. | 323 | if (pos != null) |
324 | sceneObject.AbsolutePosition = pos; | 324 | sceneObject.AbsolutePosition = (Vector3)pos; |
325 | 325 | ||
326 | if (sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) | 326 | if (sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) |
327 | { | 327 | { |
328 | sceneObject.ClearPartAttachmentData(); | 328 | sceneObject.ClearPartAttachmentData(); |
329 | } | 329 | } |
330 | 330 | ||
331 | sceneObject.UpdateGroupRotationR(rot); | 331 | if (rot != null) |
332 | 332 | sceneObject.UpdateGroupRotationR((Quaternion)rot); | |
333 | |||
333 | //group.ApplyPhysics(m_physicalPrim); | 334 | //group.ApplyPhysics(m_physicalPrim); |
334 | if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero) | 335 | if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero) |
335 | { | 336 | { |