Esempio n. 1
0
        /// <summary>
        ///     Create a New SceneObjectGroup/Part by raycasting
        /// </summary>
        /// <param name="ownerID"></param>
        /// <param name="groupID"></param>
        /// <param name="pos"></param>
        /// <param name="rot"></param>
        /// <param name="shape"></param>
        public virtual ISceneEntity AddNewPrim(
            UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
        {
            SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape, m_DefaultObjectName,
                                                                m_parentScene);

            // If an entity creator has been registered for this prim type then use that
            if (m_entityCreators.ContainsKey((PCode) shape.PCode))
            {
                sceneObject =
                    (SceneObjectGroup)
                    m_entityCreators[(PCode) shape.PCode].CreateEntity(sceneObject, ownerID, groupID, pos, rot, shape);
            }
            else
            {
                // Otherwise, use this default creation code;
                sceneObject.SetGroup(groupID, ownerID, false);
                AddPrimToScene(sceneObject);
                sceneObject.ScheduleGroupUpdate(PrimUpdateFlags.ForcedFullUpdate);
            }

            return sceneObject;
        }