aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 9f38a99..31faeec 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -292,6 +292,42 @@ namespace OpenSim.Region.Framework.Scenes
292 292
293 return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates); 293 return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates);
294 } 294 }
295
296 /// <summary>
297 /// Add a newly created object to the scene.
298 /// </summary>
299 ///
300 /// This method does not send updates to the client - callers need to handle this themselves.
301 /// <param name="sceneObject"></param>
302 /// <param name="attachToBackup"></param>
303 /// <param name="pos">Position of the object</param>
304 /// <param name="rot">Rotation of the object</param>
305 /// <param name="vel">Velocity of the object. This parameter only has an effect if the object is physical</param>
306 /// <returns></returns>
307 public bool AddNewSceneObject(
308 SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel)
309 {
310 AddNewSceneObject(sceneObject, true, false);
311
312 // we set it's position in world.
313 sceneObject.AbsolutePosition = pos;
314
315 if (sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim)
316 {
317 sceneObject.ClearPartAttachmentData();
318 }
319
320 sceneObject.UpdateGroupRotationR(rot);
321
322 //group.ApplyPhysics(m_physicalPrim);
323 if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
324 {
325 sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false);
326 sceneObject.Velocity = vel;
327 }
328
329 return true;
330 }
295 331
296 /// <summary> 332 /// <summary>
297 /// Add an object to the scene. This will both update the scene, and send information about the 333 /// Add an object to the scene. This will both update the scene, and send information about the