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 1268259..3a0532a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -312,6 +312,42 @@ namespace OpenSim.Region.Framework.Scenes
312 312
313 return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates); 313 return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates);
314 } 314 }
315
316 /// <summary>
317 /// Add a newly created object to the scene.
318 /// </summary>
319 ///
320 /// This method does not send updates to the client - callers need to handle this themselves.
321 /// <param name="sceneObject"></param>
322 /// <param name="attachToBackup"></param>
323 /// <param name="pos">Position of the object</param>
324 /// <param name="rot">Rotation of the object</param>
325 /// <param name="vel">Velocity of the object. This parameter only has an effect if the object is physical</param>
326 /// <returns></returns>
327 public bool AddNewSceneObject(
328 SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel)
329 {
330 AddNewSceneObject(sceneObject, true, false);
331
332 // we set it's position in world.
333 sceneObject.AbsolutePosition = pos;
334
335 if (sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim)
336 {
337 sceneObject.ClearPartAttachmentData();
338 }
339
340 sceneObject.UpdateGroupRotationR(rot);
341
342 //group.ApplyPhysics(m_physicalPrim);
343 if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
344 {
345 sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false);
346 sceneObject.Velocity = vel;
347 }
348
349 return true;
350 }
315 351
316 /// <summary> 352 /// <summary>
317 /// Add an object to the scene. This will both update the scene, and send information about the 353 /// Add an object to the scene. This will both update the scene, and send information about the