Copy() public method

Duplicates this part.
public Copy ( uint localID, UUID AgentID, UUID GroupID, int linkNum, bool userExposed ) : SceneObjectPart
localID uint
AgentID UUID
GroupID UUID
linkNum int
userExposed bool True if the duplicate will immediately be in the scene, false otherwise
return SceneObjectPart
Ejemplo n.º 1
0
 /// <summary>
 /// Copy the given part as the root part of this scene object.
 /// </summary>
 /// <param name="part"></param>
 /// <param name="cAgentID"></param>
 /// <param name="cGroupID"></param>
 public void CopyRootPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
 {
     SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, 0, userExposed));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Make a copy of the given part.
        /// </summary>
        /// <param name="part"></param>
        /// <param name="cAgentID"></param>
        /// <param name="cGroupID"></param>
        public SceneObjectPart CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
        {
            SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed);
            AddPart(newPart);

            SetPartAsNonRoot(newPart);
            return newPart;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Copy the given part as the root part of this scene object.
        /// </summary>
        /// <param name="part"></param>
        /// <param name="cAgentID"></param>
        /// <param name="cGroupID"></param>
        public void CopyRootPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
        {
            SceneObjectPart newpart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, 0, userExposed);
//            SceneObjectPart newpart = part.Copy(part.LocalId, OwnerID, GroupID, 0, userExposed);
//            newpart.LocalId = m_scene.AllocateLocalId();

            SetRootPart(newpart);
            if (userExposed)
                RootPart.Velocity = Vector3.Zero; // In case source is moving
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Make a copy of the given part.
        /// </summary>
        /// <param name="part"></param>
        /// <param name="cAgentID"></param>
        /// <param name="cGroupID"></param>
        public SceneObjectPart CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed, bool serializePhysicsState)
        {
            SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed, serializePhysicsState);

            if (userExposed)
            {
                newPart.SetParentAndUpdatePhysics(this);
            }
            else
            {
                newPart.SetParent(this);
            }

            lock (m_parts)
            {
                m_parts.Add(newPart.UUID, newPart);
                this.TrackLocalId(newPart, newPart.LocalId);
                // newPart.ParentGroup.ServerWeight is updated by the caller (Copy)
            }

            SetPartAsNonRoot(newPart);

            return newPart;
        }
Ejemplo n.º 5
0
 public void CopyRootPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed, bool serializePhysicsState)
 {
     SceneObjectPart dupe = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed, serializePhysicsState);
     SetRootPart(dupe);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Copy the given part as the root part of this scene object.
 /// </summary>
 /// <param name="part"></param>
 /// <param name="cAgentID"></param>
 /// <param name="cGroupID"></param>
 public void CopyRootPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed, bool ChangeScripts)
 {
     SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed, ChangeScripts));
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Make a copy of the given part.
        /// </summary>
        /// <param name="part"></param>
        /// <param name="cAgentID"></param>
        /// <param name="cGroupID"></param>
        public SceneObjectPart CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed, bool serializePhysicsState)
        {
            SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_childParts.Count, userExposed, serializePhysicsState);

            if (userExposed)
            {
                newPart.SetParentAndUpdatePhysics(this);
            }
            else
            {
                newPart.SetParent(this, true);
            }
            
            m_childParts.AddPart(newPart);

            SetPartAsNonRoot(newPart);

            return newPart;
        }