Пример #1
0
        /// <summary>
        ///     Create a completely new SceneObjectPart (prim).  This will need to be added separately to a SceneObjectGroup
        /// </summary>
        /// <param name="ownerID"></param>
        /// <param name="shape"></param>
        /// <param name="groupPosition"></param>
        /// <param name="rotationOffset"></param>
        /// <param name="offsetPosition"></param>
        /// <param name="name"></param>
        public SceneObjectPart(
            UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition,
            Quaternion rotationOffset, Vector3 offsetPosition, string name)
        {
            m_name = name;

            CreationDate = (int) Utils.DateTimeToUnixTime(DateTime.Now);
            _ownerID = ownerID;
            _creatorID = _ownerID;
            LastOwnerID = UUID.Zero;
            UUID = UUID.Random();
            Shape = shape;
            CRC = 1;
            _ownershipCost = 0;
            _flags = 0;
            _groupID = UUID.Zero;
            _objectSaleType = 0;
            _salePrice = 0;
            _category = 0;
            LastOwnerID = _creatorID;
            m_groupPosition = groupPosition;
            m_offsetPosition = offsetPosition;
            RotationOffset = rotationOffset;
            Velocity = Vector3.Zero;
            AngularVelocity = Vector3.Zero;
            Acceleration = Vector3.Zero;
            SitTargetAvatar = new List<UUID>();
            StateSaves = new Dictionary<UUID, StateSave>();

            ValidpartOOB = false;

            // Prims currently only contain a single folder (Contents).  From looking at the Second Life protocol,
            // this appears to have the same UUID (!) as the prim.  If this isn't the case, one can't drag items from
            // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log

            Flags = 0;
            CreateSelected = true;

            TrimPermissions();
            //m_undo = new UndoStack<UndoState>(ParentGroup.GetSceneMaxUndo());

            m_inventory = new SceneObjectPartInventory(this);
            Material = (int) OpenMetaverse.Material.Wood;
        }
Пример #2
0
        /// <summary>
        ///     No arg constructor called by region restore db code
        /// </summary>
        public SceneObjectPart()
        {
            SitTargetAvatar = new List<UUID>();
            StateSaves = new Dictionary<UUID, StateSave>();

            m_inventory = new SceneObjectPartInventory(this);
            m_shape = new PrimitiveBaseShape();
            Material = (int) OpenMetaverse.Material.Wood;
        }