Merge branch 'master' into careminster-presence-refactor

This commit is contained in:
Melanie
2011-05-22 20:23:25 +01:00
37 changed files with 331 additions and 144 deletions

View File

@@ -352,25 +352,26 @@ namespace OpenSim.Region.Framework.Scenes
/// This method does not send updates to the client - callers need to handle this themselves.
/// <param name="sceneObject"></param>
/// <param name="attachToBackup"></param>
/// <param name="pos">Position of the object</param>
/// <param name="rot">Rotation of the object</param>
/// <param name="pos">Position of the object. If null then the position stored in the object is used.</param>
/// <param name="rot">Rotation of the object. If null then the rotation stored in the object is used.</param>
/// <param name="vel">Velocity of the object. This parameter only has an effect if the object is physical</param>
/// <returns></returns>
public bool AddNewSceneObject(
SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel)
SceneObjectGroup sceneObject, bool attachToBackup, Vector3? pos, Quaternion? rot, Vector3 vel)
{
AddNewSceneObject(sceneObject, true, false);
// we set it's position in world.
sceneObject.AbsolutePosition = pos;
if (pos != null)
sceneObject.AbsolutePosition = (Vector3)pos;
if (sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim)
{
sceneObject.ClearPartAttachmentData();
}
sceneObject.UpdateGroupRotationR(rot);
if (rot != null)
sceneObject.UpdateGroupRotationR((Quaternion)rot);
//group.ApplyPhysics(m_physicalPrim);
if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
{
@@ -385,6 +386,9 @@ namespace OpenSim.Region.Framework.Scenes
/// Add an object to the scene. This will both update the scene, and send information about the
/// new object to all clients interested in the scene.
/// </summary>
/// <remarks>
/// The object's stored position, rotation and velocity are used.
/// </remarks>
/// <param name="sceneObject"></param>
/// <param name="attachToBackup">
/// If true, the object is made persistent into the scene.
@@ -1047,6 +1051,51 @@ namespace OpenSim.Region.Framework.Scenes
return result;
}
/// <summary>
/// Get a group in the scene
/// </summary>
/// <param name="fullID">UUID of the group</param>
/// <returns>null if no such group was found</returns>
protected internal SceneObjectGroup GetSceneObjectGroup(UUID fullID)
{
lock (SceneObjectGroupsByFullID)
{
if (SceneObjectGroupsByFullID.ContainsKey(fullID))
return SceneObjectGroupsByFullID[fullID];
}
return null;
}
/// <summary>
/// Get a group by name from the scene (will return the first
/// found, if there are more than one prim with the same name)
/// </summary>
/// <param name="name"></param>
/// <returns>null if the part was not found</returns>
protected internal SceneObjectGroup GetSceneObjectGroup(string name)
{
SceneObjectGroup so = null;
Entities.Find(
delegate(EntityBase entity)
{
if (entity is SceneObjectGroup)
{
if (entity.Name == name)
{
so = (SceneObjectGroup)entity;
return true;
}
}
return false;
}
);
return so;
}
/// <summary>
/// Get a part contained in this scene.
/// </summary>
@@ -1061,7 +1110,7 @@ namespace OpenSim.Region.Framework.Scenes
}
/// <summary>
/// Get a named prim contained in this scene (will return the first
/// Get a prim by name from the scene (will return the first
/// found, if there are more than one prim with the same name)
/// </summary>
/// <param name="name"></param>