/// <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="position"></param> /// <param name="rotationOffset"></param> /// <param name="offsetPosition"></param> public SceneObjectPart( UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition, Quaternion rotationOffset, Vector3 offsetPosition) { m_name = "Primitive"; Rezzed = DateTime.UtcNow; _creationDate = (int)Utils.DateTimeToUnixTime(Rezzed); _ownerID = ownerID; _creatorID = _ownerID; _lastOwnerID = UUID.Zero; UUID = UUID.Random(); Shape = shape; // Todo: Add More Object Parameter from above! _ownershipCost = 0; _objectSaleType = 0; _salePrice = 0; _category = 0; _lastOwnerID = _creatorID; // End Todo: /// GroupPosition = groupPosition; OffsetPosition = offsetPosition; RotationOffset = rotationOffset; Velocity = Vector3.Zero; AngularVelocity = Vector3.Zero; Acceleration = Vector3.Zero; m_TextureAnimation = Utils.EmptyBytes; m_particleSystem = Utils.EmptyBytes; // 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; _flags |= PrimFlags.CreateSelected; TrimPermissions(); //m_undo = new UndoStack<UndoState>(ParentGroup.GetSceneMaxUndo()); m_inventory = new SceneObjectPartInventory(this); }
// ~SceneObjectPart() // { // m_log.DebugFormat( // "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}", // Name, LocalId, ParentGroup.Name, ParentGroup.LocalId); // } #region Constructors /// <summary> /// No arg constructor called by region restore db code /// </summary> public SceneObjectPart() { m_TextureAnimation = Utils.EmptyBytes; m_particleSystem = Utils.EmptyBytes; Rezzed = DateTime.UtcNow; Description = String.Empty; // 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 m_inventory = new SceneObjectPartInventory(this); }
/// <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="position"></param> /// <param name="rotationOffset"></param> /// <param name="offsetPosition"></param> public SceneObjectPart( UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition, Quaternion rotationOffset, Vector3 offsetPosition, Scene scene) { m_name = scene.DefaultObjectName; m_initialScene = scene; Rezzed = DateTime.UtcNow; _creationDate = (int)Utils.DateTimeToUnixTime(Rezzed); _ownerID = ownerID; _creatorID = _ownerID; _lastOwnerID = UUID.Zero; UUID = UUID.Random(); Shape = shape; CRC = 0; _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; // 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); }
/// <summary> /// No arg constructor called by region restore db code /// </summary> public SceneObjectPart() { // It's not necessary to persist this m_TextureAnimation = Utils.EmptyBytes; m_particleSystem = Utils.EmptyBytes; Rezzed = DateTime.UtcNow; m_inventory = new SceneObjectPartInventory(this); }
/// <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="position"></param> /// <param name="rotationOffset"></param> /// <param name="offsetPosition"></param> public SceneObjectPart( UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition, Quaternion rotationOffset, Vector3 offsetPosition, bool rezSelected) { m_name = "Primitive"; Rezzed = DateTime.Now; _creationDate = (Int32) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; _ownerID = ownerID; _creatorID = _ownerID; _lastOwnerID = UUID.Zero; UUID = UUID.Random(); Shape = shape; // Todo: Add More Object Parameter from above! _ownershipCost = 0; _objectSaleType = (byte) 0; _salePrice = 0; _category = (uint) 0; _lastOwnerID = _creatorID; // End Todo: /// GroupPosition = groupPosition; OffsetPosition = offsetPosition; RotationOffset = rotationOffset; Velocity = new Vector3(0, 0, 0); AngularVelocity = new Vector3(0, 0, 0); m_TextureAnimation = new byte[0]; m_particleSystem = new byte[0]; for (int x = 0; x < 5; x++) PayPrice[x] = PAY_DEFAULT; // 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 if (rezSelected) _flags |= PrimFlags.CreateSelected; else _flags = 0; TrimPermissions(); //m_undo = new UndoStack<UndoState>(ParentGroup.GetSceneMaxUndo()); m_inventory = new SceneObjectPartInventory(this); }
public SceneObjectPart(IRegistryCore scene) { // It's not necessary to persist this m_initialScene = scene; Rezzed = DateTime.UtcNow; m_inventory = new SceneObjectPartInventory(this); }
/// <summary> /// No arg constructor called by region restore db code /// </summary> public SceneObjectPart() { if (m_TextureAnimation == null) { m_TextureAnimation = new byte[0]; } if (m_particleSystem == null) { m_particleSystem = new byte[0]; } Rezzed = DateTime.Now; m_inventory = new SceneObjectPartInventory(this); }
public SceneObjectPartInventory CloneForPartCopy(SceneObjectPart part, bool userExposed) { SceneObjectPartInventory newInventory = new SceneObjectPartInventory(part); //also copy the delete list newInventory._removedItems = new List<UUID>(_removedItems); // Duplicate the Contents now, skipping no-copy items. foreach (KeyValuePair<UUID, TaskInventoryItem> pair in Items) { TaskInventoryItem item = pair.Value; if (!userExposed) { TaskInventoryItem dupeitem = (TaskInventoryItem)item.Clone(); newInventory.AddInventoryItem(dupeitem, false, userExposed); } else if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy) { TaskInventoryItem dupeitem = (TaskInventoryItem)item.Clone(); newInventory.AddInventoryItem(dupeitem, false, userExposed); } } return newInventory; }
/// <summary> /// No arg constructor called by region restore db code /// </summary> public SceneObjectPart() { // It's not necessary to persist this m_TextureAnimation = new byte[0]; m_particleSystem = new byte[0]; Rezzed = DateTime.Now; m_inventory = new SceneObjectPartInventory(this); }
/// <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="position"></param> /// <param name="rotationOffset"></param> /// <param name="offsetPosition"></param> public SceneObjectPart( UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition, Quaternion rotationOffset, Vector3 offsetPosition, string name, IScene scene) { m_name = name; m_initialScene = scene; _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; // use the basic box for now m_partOOBoffset = Vector3.Zero; m_partOOBsize.X = shape.Scale.X * 0.5f; m_partOOBsize.Y = shape.Scale.Y * 0.5f; m_partOOBsize.Z = shape.Scale.Z * 0.5f; m_partBSphereRadiusSQ = m_partOOBsize.X; if (m_partBSphereRadiusSQ < m_partOOBsize.Y) m_partBSphereRadiusSQ = m_partOOBsize.Y; if (m_partBSphereRadiusSQ < m_partOOBsize.Z) m_partBSphereRadiusSQ = m_partOOBsize.Z; m_partBSphereRadiusSQ *= m_partBSphereRadiusSQ; // square it for faster compare with squared distances // 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); }
public SceneObjectPart(IRegistryCore scene) { // It's not necessary to persist this m_initialScene = scene; m_inventory = new SceneObjectPartInventory(this); SitTargetAvatar = new List<UUID>(); }