Merge branch 'master' into bulletsim
commit
648866b597
|
@ -304,9 +304,9 @@ namespace OpenSim.Data.Tests
|
||||||
regionInfo.RegionLocX = 0;
|
regionInfo.RegionLocX = 0;
|
||||||
regionInfo.RegionLocY = 0;
|
regionInfo.RegionLocY = 0;
|
||||||
|
|
||||||
// Scene scene = new Scene(regionInfo);
|
|
||||||
|
|
||||||
SceneObjectPart sop = new SceneObjectPart();
|
SceneObjectPart sop = new SceneObjectPart();
|
||||||
|
SceneObjectGroup sog = new SceneObjectGroup(sop);
|
||||||
|
|
||||||
sop.RegionHandle = regionh;
|
sop.RegionHandle = regionh;
|
||||||
sop.UUID = uuid;
|
sop.UUID = uuid;
|
||||||
sop.LocalId = localid;
|
sop.LocalId = localid;
|
||||||
|
@ -374,8 +374,6 @@ namespace OpenSim.Data.Tests
|
||||||
// This is necessary or object will not be inserted in DB
|
// This is necessary or object will not be inserted in DB
|
||||||
sop.Flags = PrimFlags.None;
|
sop.Flags = PrimFlags.None;
|
||||||
|
|
||||||
SceneObjectGroup sog = new SceneObjectGroup(sop);
|
|
||||||
|
|
||||||
// Inserts group in DB
|
// Inserts group in DB
|
||||||
db.StoreObject(sog,region3);
|
db.StoreObject(sog,region3);
|
||||||
List<SceneObjectGroup> sogs = db.LoadObjects(region3);
|
List<SceneObjectGroup> sogs = db.LoadObjects(region3);
|
||||||
|
|
|
@ -859,6 +859,67 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ulong GetMeshKey(Vector3 size, float lod)
|
||||||
|
{
|
||||||
|
ulong hash = 5381;
|
||||||
|
|
||||||
|
hash = djb2(hash, this.PathCurve);
|
||||||
|
hash = djb2(hash, (byte)((byte)this.HollowShape | (byte)this.ProfileShape));
|
||||||
|
hash = djb2(hash, this.PathBegin);
|
||||||
|
hash = djb2(hash, this.PathEnd);
|
||||||
|
hash = djb2(hash, this.PathScaleX);
|
||||||
|
hash = djb2(hash, this.PathScaleY);
|
||||||
|
hash = djb2(hash, this.PathShearX);
|
||||||
|
hash = djb2(hash, this.PathShearY);
|
||||||
|
hash = djb2(hash, (byte)this.PathTwist);
|
||||||
|
hash = djb2(hash, (byte)this.PathTwistBegin);
|
||||||
|
hash = djb2(hash, (byte)this.PathRadiusOffset);
|
||||||
|
hash = djb2(hash, (byte)this.PathTaperX);
|
||||||
|
hash = djb2(hash, (byte)this.PathTaperY);
|
||||||
|
hash = djb2(hash, this.PathRevolutions);
|
||||||
|
hash = djb2(hash, (byte)this.PathSkew);
|
||||||
|
hash = djb2(hash, this.ProfileBegin);
|
||||||
|
hash = djb2(hash, this.ProfileEnd);
|
||||||
|
hash = djb2(hash, this.ProfileHollow);
|
||||||
|
|
||||||
|
// TODO: Separate scale out from the primitive shape data (after
|
||||||
|
// scaling is supported at the physics engine level)
|
||||||
|
byte[] scaleBytes = size.GetBytes();
|
||||||
|
for (int i = 0; i < scaleBytes.Length; i++)
|
||||||
|
hash = djb2(hash, scaleBytes[i]);
|
||||||
|
|
||||||
|
// Include LOD in hash, accounting for endianness
|
||||||
|
byte[] lodBytes = new byte[4];
|
||||||
|
Buffer.BlockCopy(BitConverter.GetBytes(lod), 0, lodBytes, 0, 4);
|
||||||
|
if (!BitConverter.IsLittleEndian)
|
||||||
|
{
|
||||||
|
Array.Reverse(lodBytes, 0, 4);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < lodBytes.Length; i++)
|
||||||
|
hash = djb2(hash, lodBytes[i]);
|
||||||
|
|
||||||
|
// include sculpt UUID
|
||||||
|
if (this.SculptEntry)
|
||||||
|
{
|
||||||
|
scaleBytes = this.SculptTexture.GetBytes();
|
||||||
|
for (int i = 0; i < scaleBytes.Length; i++)
|
||||||
|
hash = djb2(hash, scaleBytes[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ulong djb2(ulong hash, byte c)
|
||||||
|
{
|
||||||
|
return ((hash << 5) + hash) + (ulong)c;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ulong djb2(ulong hash, ushort c)
|
||||||
|
{
|
||||||
|
hash = ((hash << 5) + hash) + (ulong)((byte)c);
|
||||||
|
return ((hash << 5) + hash) + (ulong)(c >> 8);
|
||||||
|
}
|
||||||
|
|
||||||
public byte[] ExtraParamsToBytes()
|
public byte[] ExtraParamsToBytes()
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[EXTRAPARAMS]: Called ExtraParamsToBytes()");
|
// m_log.DebugFormat("[EXTRAPARAMS]: Called ExtraParamsToBytes()");
|
||||||
|
|
|
@ -330,7 +330,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
grp.AbsolutePosition = obj.Position;
|
grp.AbsolutePosition = obj.Position;
|
||||||
prim.RotationOffset = obj.Rotation;
|
prim.RotationOffset = obj.Rotation;
|
||||||
|
|
||||||
grp.RootPart.IsAttachment = false;
|
grp.IsAttachment = false;
|
||||||
// Required for linking
|
// Required for linking
|
||||||
grp.RootPart.UpdateFlag = 0;
|
grp.RootPart.UpdateFlag = 0;
|
||||||
|
|
||||||
|
|
|
@ -4756,7 +4756,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
SceneObjectPart part = (SceneObjectPart)entity;
|
SceneObjectPart part = (SceneObjectPart)entity;
|
||||||
|
|
||||||
attachPoint = part.AttachmentPoint;
|
if (part.ParentGroup != null)
|
||||||
|
attachPoint = part.ParentGroup.AttachmentPoint;
|
||||||
|
else
|
||||||
|
attachPoint = 0;
|
||||||
|
|
||||||
collisionPlane = Vector4.Zero;
|
collisionPlane = Vector4.Zero;
|
||||||
position = part.RelativePosition;
|
position = part.RelativePosition;
|
||||||
velocity = part.Velocity;
|
velocity = part.Velocity;
|
||||||
|
@ -4913,10 +4917,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
//update.JointType = 0;
|
//update.JointType = 0;
|
||||||
update.Material = data.Material;
|
update.Material = data.Material;
|
||||||
update.MediaURL = Utils.EmptyBytes; // FIXME: Support this in OpenSim
|
update.MediaURL = Utils.EmptyBytes; // FIXME: Support this in OpenSim
|
||||||
if (data.IsAttachment)
|
if (data.ParentGroup != null && data.ParentGroup.IsAttachment)
|
||||||
{
|
{
|
||||||
update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + data.FromItemID);
|
update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + data.FromItemID);
|
||||||
update.State = (byte)((data.AttachmentPoint % 16) * 16 + (data.AttachmentPoint / 16));
|
update.State = (byte)((data.ParentGroup.AttachmentPoint % 16) * 16 + (data.ParentGroup.AttachmentPoint / 16));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -167,13 +167,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
return AttachObject(sp, group, AttachmentPt, silent);
|
return AttachObject(sp, group, AttachmentPt, silent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool AttachObject(ScenePresence sp, SceneObjectGroup group, uint AttachmentPt, bool silent)
|
private bool AttachObject(ScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[ATTACHMENTS MODULE]: Attaching object {0} {1} to {2} point {3} from ground (silent = {4})",
|
// "[ATTACHMENTS MODULE]: Attaching object {0} {1} to {2} point {3} from ground (silent = {4})",
|
||||||
// group.Name, group.LocalId, sp.Name, AttachmentPt, silent);
|
// group.Name, group.LocalId, sp.Name, AttachmentPt, silent);
|
||||||
|
|
||||||
if (sp.GetAttachments(AttachmentPt).Contains(group))
|
if (sp.GetAttachments(attachmentPt).Contains(group))
|
||||||
{
|
{
|
||||||
// m_log.WarnFormat(
|
// m_log.WarnFormat(
|
||||||
// "[ATTACHMENTS MODULE]: Ignoring request to attach {0} {1} to {2} on {3} since it's already attached",
|
// "[ATTACHMENTS MODULE]: Ignoring request to attach {0} {1} to {2} on {3} since it's already attached",
|
||||||
|
@ -186,39 +186,39 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
|
|
||||||
// TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should
|
// TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should
|
||||||
// be removed when that functionality is implemented in opensim
|
// be removed when that functionality is implemented in opensim
|
||||||
AttachmentPt &= 0x7f;
|
attachmentPt &= 0x7f;
|
||||||
|
|
||||||
// If the attachment point isn't the same as the one previously used
|
// If the attachment point isn't the same as the one previously used
|
||||||
// set it's offset position = 0 so that it appears on the attachment point
|
// set it's offset position = 0 so that it appears on the attachment point
|
||||||
// and not in a weird location somewhere unknown.
|
// and not in a weird location somewhere unknown.
|
||||||
if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint())
|
if (attachmentPt != 0 && attachmentPt != group.AttachmentPoint)
|
||||||
{
|
{
|
||||||
attachPos = Vector3.Zero;
|
attachPos = Vector3.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AttachmentPt 0 means the client chose to 'wear' the attachment.
|
// AttachmentPt 0 means the client chose to 'wear' the attachment.
|
||||||
if (AttachmentPt == 0)
|
if (attachmentPt == 0)
|
||||||
{
|
{
|
||||||
// Check object for stored attachment point
|
// Check object for stored attachment point
|
||||||
AttachmentPt = (uint)group.GetAttachmentPoint();
|
attachmentPt = group.AttachmentPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we still didn't find a suitable attachment point.......
|
// if we still didn't find a suitable attachment point.......
|
||||||
if (AttachmentPt == 0)
|
if (attachmentPt == 0)
|
||||||
{
|
{
|
||||||
// Stick it on left hand with Zero Offset from the attachment point.
|
// Stick it on left hand with Zero Offset from the attachment point.
|
||||||
AttachmentPt = (uint)AttachmentPoint.LeftHand;
|
attachmentPt = (uint)AttachmentPoint.LeftHand;
|
||||||
attachPos = Vector3.Zero;
|
attachPos = Vector3.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
group.SetAttachmentPoint((byte)AttachmentPt);
|
group.AttachmentPoint = attachmentPt;
|
||||||
group.AbsolutePosition = attachPos;
|
group.AbsolutePosition = attachPos;
|
||||||
|
|
||||||
// Remove any previous attachments
|
// Remove any previous attachments
|
||||||
UUID itemID = UUID.Zero;
|
UUID itemID = UUID.Zero;
|
||||||
foreach (SceneObjectGroup grp in sp.Attachments)
|
foreach (SceneObjectGroup grp in sp.Attachments)
|
||||||
{
|
{
|
||||||
if (grp.GetAttachmentPoint() == (byte)AttachmentPt)
|
if (grp.AttachmentPoint == attachmentPt)
|
||||||
{
|
{
|
||||||
itemID = grp.GetFromItemID();
|
itemID = grp.GetFromItemID();
|
||||||
break;
|
break;
|
||||||
|
@ -232,9 +232,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
if (itemID == UUID.Zero)
|
if (itemID == UUID.Zero)
|
||||||
itemID = AddSceneObjectAsAttachment(sp.ControllingClient, group).ID;
|
itemID = AddSceneObjectAsAttachment(sp.ControllingClient, group).ID;
|
||||||
|
|
||||||
ShowAttachInUserInventory(sp, AttachmentPt, itemID, group);
|
ShowAttachInUserInventory(sp, attachmentPt, itemID, group);
|
||||||
|
|
||||||
AttachToAgent(sp, group, AttachmentPt, attachPos, silent);
|
AttachToAgent(sp, group, attachmentPt, attachPos, silent);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -293,7 +293,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
}
|
}
|
||||||
|
|
||||||
private SceneObjectGroup RezSingleAttachmentFromInventoryInternal(
|
private SceneObjectGroup RezSingleAttachmentFromInventoryInternal(
|
||||||
ScenePresence sp, UUID itemID, uint AttachmentPt)
|
ScenePresence sp, UUID itemID, uint attachmentPt)
|
||||||
{
|
{
|
||||||
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
|
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
|
||||||
if (invAccess != null)
|
if (invAccess != null)
|
||||||
|
@ -313,13 +313,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
// since scripts aren't running yet. So, clear it here.
|
// since scripts aren't running yet. So, clear it here.
|
||||||
objatt.HasGroupChanged = false;
|
objatt.HasGroupChanged = false;
|
||||||
bool tainted = false;
|
bool tainted = false;
|
||||||
if (AttachmentPt != 0 && AttachmentPt != objatt.GetAttachmentPoint())
|
if (attachmentPt != 0 && attachmentPt != objatt.AttachmentPoint)
|
||||||
tainted = true;
|
tainted = true;
|
||||||
|
|
||||||
// This will throw if the attachment fails
|
// This will throw if the attachment fails
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
AttachObject(sp, objatt, AttachmentPt, false);
|
AttachObject(sp, objatt, attachmentPt, false);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -348,7 +348,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
{
|
{
|
||||||
m_log.WarnFormat(
|
m_log.WarnFormat(
|
||||||
"[ATTACHMENTS MODULE]: Could not retrieve item {0} for attaching to avatar {1} at point {2}",
|
"[ATTACHMENTS MODULE]: Could not retrieve item {0} for attaching to avatar {1} at point {2}",
|
||||||
itemID, sp.Name, AttachmentPt);
|
itemID, sp.Name, attachmentPt);
|
||||||
}
|
}
|
||||||
|
|
||||||
return objatt;
|
return objatt;
|
||||||
|
@ -363,22 +363,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
/// <param name="att"></param>
|
/// <param name="att"></param>
|
||||||
/// <param name="sp"></param>
|
/// <param name="sp"></param>
|
||||||
/// <param name="itemID"></param>
|
/// <param name="itemID"></param>
|
||||||
/// <param name="AttachmentPt"></param>
|
/// <param name="attachmentPoint"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private UUID ShowAttachInUserInventory(
|
private UUID ShowAttachInUserInventory(
|
||||||
SceneObjectGroup att, ScenePresence sp, UUID itemID, uint AttachmentPt)
|
SceneObjectGroup att, ScenePresence sp, UUID itemID, uint attachmentPoint)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[ATTACHMENTS MODULE]: Updating inventory of {0} to show attachment of {1} (item ID {2})",
|
// "[ATTACHMENTS MODULE]: Updating inventory of {0} to show attachment of {1} {2} (item ID {3}) at {4}",
|
||||||
// remoteClient.Name, att.Name, itemID);
|
// sp.Name, att.Name, att.LocalId, itemID, AttachmentPt);
|
||||||
|
|
||||||
if (!att.IsDeleted)
|
if (!att.IsDeleted)
|
||||||
AttachmentPt = att.RootPart.AttachmentPoint;
|
attachmentPoint = att.AttachmentPoint;
|
||||||
|
|
||||||
InventoryItemBase item = new InventoryItemBase(itemID, sp.UUID);
|
InventoryItemBase item = new InventoryItemBase(itemID, sp.UUID);
|
||||||
item = m_scene.InventoryService.GetItem(item);
|
item = m_scene.InventoryService.GetItem(item);
|
||||||
|
|
||||||
bool changed = sp.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID);
|
bool changed = sp.Appearance.SetAttachment((int)attachmentPoint, itemID, item.AssetID);
|
||||||
if (changed && m_scene.AvatarFactory != null)
|
if (changed && m_scene.AvatarFactory != null)
|
||||||
m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID);
|
m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID);
|
||||||
|
|
||||||
|
@ -547,7 +547,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
);
|
);
|
||||||
|
|
||||||
group.RootPart.SetParentLocalId(0);
|
group.RootPart.SetParentLocalId(0);
|
||||||
group.RootPart.IsAttachment = false;
|
group.IsAttachment = false;
|
||||||
group.AbsolutePosition = group.RootPart.AttachedPos;
|
group.AbsolutePosition = group.RootPart.AttachedPos;
|
||||||
|
|
||||||
UpdateKnownItem(sp.ControllingClient, group, group.GetFromItemID(), group.OwnerID);
|
UpdateKnownItem(sp.ControllingClient, group, group.GetFromItemID(), group.OwnerID);
|
||||||
|
@ -567,11 +567,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
// attachment. This is necessary in order to correctly save
|
// attachment. This is necessary in order to correctly save
|
||||||
// and retrieve GroupPosition information for the attachment.
|
// and retrieve GroupPosition information for the attachment.
|
||||||
// Finally, we restore the object's attachment status.
|
// Finally, we restore the object's attachment status.
|
||||||
byte attachmentPoint = sog.GetAttachmentPoint();
|
uint attachmentPoint = sog.AttachmentPoint;
|
||||||
sog.UpdateGroupPosition(pos);
|
sog.UpdateGroupPosition(pos);
|
||||||
sog.RootPart.IsAttachment = false;
|
sog.IsAttachment = false;
|
||||||
sog.AbsolutePosition = sog.RootPart.AttachedPos;
|
sog.AbsolutePosition = sog.RootPart.AttachedPos;
|
||||||
sog.SetAttachmentPoint(attachmentPoint);
|
sog.AttachmentPoint = attachmentPoint;
|
||||||
sog.HasGroupChanged = true;
|
sog.HasGroupChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -594,14 +594,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
{
|
{
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[ATTACHMENTS MODULE]: Don't need to update asset for unchanged attachment {0}, attachpoint {1}",
|
"[ATTACHMENTS MODULE]: Don't need to update asset for unchanged attachment {0}, attachpoint {1}",
|
||||||
grp.UUID, grp.GetAttachmentPoint());
|
grp.UUID, grp.AttachmentPoint);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}",
|
"[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}",
|
||||||
grp.UUID, grp.GetAttachmentPoint());
|
grp.UUID, grp.AttachmentPoint);
|
||||||
|
|
||||||
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp);
|
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp);
|
||||||
|
|
||||||
|
@ -666,10 +666,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
|
|
||||||
so.AbsolutePosition = attachOffset;
|
so.AbsolutePosition = attachOffset;
|
||||||
so.RootPart.AttachedPos = attachOffset;
|
so.RootPart.AttachedPos = attachOffset;
|
||||||
so.RootPart.IsAttachment = true;
|
so.IsAttachment = true;
|
||||||
|
|
||||||
so.RootPart.SetParentLocalId(avatar.LocalId);
|
so.RootPart.SetParentLocalId(avatar.LocalId);
|
||||||
so.SetAttachmentPoint(Convert.ToByte(attachmentpoint));
|
so.AttachmentPoint = attachmentpoint;
|
||||||
|
|
||||||
avatar.AddAttachment(so);
|
avatar.AddAttachment(so);
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||||
Assert.That(attachments.Count, Is.EqualTo(1));
|
Assert.That(attachments.Count, Is.EqualTo(1));
|
||||||
SceneObjectGroup attSo = attachments[0];
|
SceneObjectGroup attSo = attachments[0];
|
||||||
Assert.That(attSo.Name, Is.EqualTo(attName));
|
Assert.That(attSo.Name, Is.EqualTo(attName));
|
||||||
Assert.That(attSo.GetAttachmentPoint(), Is.EqualTo((byte)AttachmentPoint.Chest));
|
Assert.That(attSo.AttachmentPoint, Is.EqualTo((byte)AttachmentPoint.Chest));
|
||||||
Assert.That(attSo.IsAttachment);
|
Assert.That(attSo.IsAttachment);
|
||||||
Assert.That(attSo.UsesPhysics, Is.False);
|
Assert.That(attSo.UsesPhysics, Is.False);
|
||||||
Assert.That(attSo.IsTemporary, Is.False);
|
Assert.That(attSo.IsTemporary, Is.False);
|
||||||
|
@ -132,8 +132,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||||
UUID attAssetId = TestHelpers.ParseTail(0x3);
|
UUID attAssetId = TestHelpers.ParseTail(0x3);
|
||||||
string attName = "att";
|
string attName = "att";
|
||||||
|
|
||||||
InventoryItemBase attItem
|
UserInventoryHelpers.CreateInventoryItem(
|
||||||
= UserInventoryHelpers.CreateInventoryItem(
|
|
||||||
scene, attName, attItemId, attAssetId, m_presence.UUID, InventoryType.Object);
|
scene, attName, attItemId, attAssetId, m_presence.UUID, InventoryType.Object);
|
||||||
|
|
||||||
m_attMod.RezSingleAttachmentFromInventory(
|
m_attMod.RezSingleAttachmentFromInventory(
|
||||||
|
@ -145,7 +144,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||||
Assert.That(attachments.Count, Is.EqualTo(1));
|
Assert.That(attachments.Count, Is.EqualTo(1));
|
||||||
SceneObjectGroup attSo = attachments[0];
|
SceneObjectGroup attSo = attachments[0];
|
||||||
Assert.That(attSo.Name, Is.EqualTo(attName));
|
Assert.That(attSo.Name, Is.EqualTo(attName));
|
||||||
Assert.That(attSo.GetAttachmentPoint(), Is.EqualTo((byte)AttachmentPoint.Chest));
|
Assert.That(attSo.AttachmentPoint, Is.EqualTo((byte)AttachmentPoint.Chest));
|
||||||
Assert.That(attSo.IsAttachment);
|
Assert.That(attSo.IsAttachment);
|
||||||
Assert.That(attSo.UsesPhysics, Is.False);
|
Assert.That(attSo.UsesPhysics, Is.False);
|
||||||
Assert.That(attSo.IsTemporary, Is.False);
|
Assert.That(attSo.IsTemporary, Is.False);
|
||||||
|
@ -166,8 +165,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||||
UUID attAssetId = TestHelpers.ParseTail(0x3);
|
UUID attAssetId = TestHelpers.ParseTail(0x3);
|
||||||
string attName = "att";
|
string attName = "att";
|
||||||
|
|
||||||
InventoryItemBase attItem
|
UserInventoryHelpers.CreateInventoryItem(
|
||||||
= UserInventoryHelpers.CreateInventoryItem(
|
|
||||||
scene, attName, attItemId, attAssetId, m_presence.UUID, InventoryType.Object);
|
scene, attName, attItemId, attAssetId, m_presence.UUID, InventoryType.Object);
|
||||||
|
|
||||||
UUID attSoId = m_attMod.RezSingleAttachmentFromInventory(
|
UUID attSoId = m_attMod.RezSingleAttachmentFromInventory(
|
||||||
|
@ -198,8 +196,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||||
UUID attAssetId = TestHelpers.ParseTail(0x3);
|
UUID attAssetId = TestHelpers.ParseTail(0x3);
|
||||||
string attName = "att";
|
string attName = "att";
|
||||||
|
|
||||||
InventoryItemBase attItem
|
UserInventoryHelpers.CreateInventoryItem(
|
||||||
= UserInventoryHelpers.CreateInventoryItem(
|
|
||||||
scene, attName, attItemId, attAssetId, m_presence.UUID, InventoryType.Object);
|
scene, attName, attItemId, attAssetId, m_presence.UUID, InventoryType.Object);
|
||||||
|
|
||||||
m_attMod.RezSingleAttachmentFromInventory(
|
m_attMod.RezSingleAttachmentFromInventory(
|
||||||
|
@ -242,7 +239,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||||
Assert.That(attachments.Count, Is.EqualTo(1));
|
Assert.That(attachments.Count, Is.EqualTo(1));
|
||||||
SceneObjectGroup attSo = attachments[0];
|
SceneObjectGroup attSo = attachments[0];
|
||||||
Assert.That(attSo.Name, Is.EqualTo(attName));
|
Assert.That(attSo.Name, Is.EqualTo(attName));
|
||||||
Assert.That(attSo.GetAttachmentPoint(), Is.EqualTo((byte)AttachmentPoint.Chest));
|
Assert.That(attSo.AttachmentPoint, Is.EqualTo((byte)AttachmentPoint.Chest));
|
||||||
Assert.That(attSo.IsAttachment);
|
Assert.That(attSo.IsAttachment);
|
||||||
Assert.That(attSo.UsesPhysics, Is.False);
|
Assert.That(attSo.UsesPhysics, Is.False);
|
||||||
Assert.That(attSo.IsTemporary, Is.False);
|
Assert.That(attSo.IsTemporary, Is.False);
|
||||||
|
|
|
@ -1782,7 +1782,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
// Set the parent localID to 0 so it transfers over properly.
|
// Set the parent localID to 0 so it transfers over properly.
|
||||||
gobj.RootPart.SetParentLocalId(0);
|
gobj.RootPart.SetParentLocalId(0);
|
||||||
gobj.AbsolutePosition = gobj.RootPart.AttachedPos;
|
gobj.AbsolutePosition = gobj.RootPart.AttachedPos;
|
||||||
gobj.RootPart.IsAttachment = false;
|
gobj.IsAttachment = false;
|
||||||
//gobj.RootPart.LastOwnerID = gobj.GetFromAssetID();
|
//gobj.RootPart.LastOwnerID = gobj.GetFromAssetID();
|
||||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName);
|
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName);
|
||||||
CrossPrimGroupIntoNewRegion(destination, gobj, silent);
|
CrossPrimGroupIntoNewRegion(destination, gobj, silent);
|
||||||
|
|
|
@ -841,7 +841,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
if (attachment)
|
if (attachment)
|
||||||
{
|
{
|
||||||
group.RootPart.Flags |= PrimFlags.Phantom;
|
group.RootPart.Flags |= PrimFlags.Phantom;
|
||||||
group.RootPart.IsAttachment = true;
|
group.IsAttachment = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're rezzing an attachment then don't ask
|
// If we're rezzing an attachment then don't ask
|
||||||
|
|
|
@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||||
|
|
||||||
if (grp.IsAttachment)
|
if (grp.IsAttachment)
|
||||||
{
|
{
|
||||||
if (grp.GetAttachmentPoint() > 30) // HUD
|
if (grp.AttachmentPoint > 30) // HUD
|
||||||
{
|
{
|
||||||
if (sp.ControllingClient.AgentId != grp.OwnerID)
|
if (sp.ControllingClient.AgentId != grp.OwnerID)
|
||||||
return;
|
return;
|
||||||
|
@ -115,7 +115,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||||
{
|
{
|
||||||
SceneObjectGroup grp = part.ParentGroup;
|
SceneObjectGroup grp = part.ParentGroup;
|
||||||
|
|
||||||
if (grp.IsAttachment && grp.GetAttachmentPoint() > 30)
|
if (grp.IsAttachment && grp.AttachmentPoint > 30)
|
||||||
{
|
{
|
||||||
objectID = ownerID;
|
objectID = ownerID;
|
||||||
parentID = ownerID;
|
parentID = ownerID;
|
||||||
|
|
|
@ -122,7 +122,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (entity is SceneObjectPart)
|
if (entity is SceneObjectPart)
|
||||||
{
|
{
|
||||||
SceneObjectPart sop = (SceneObjectPart)entity;
|
SceneObjectPart sop = (SceneObjectPart)entity;
|
||||||
if (sop.ParentGroup.RootPart.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (entity is SceneObjectPart)
|
if (entity is SceneObjectPart)
|
||||||
{
|
{
|
||||||
SceneObjectPart sop = (SceneObjectPart)entity;
|
SceneObjectPart sop = (SceneObjectPart)entity;
|
||||||
if (sop.ParentGroup.RootPart.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (entity is SceneObjectPart)
|
if (entity is SceneObjectPart)
|
||||||
{
|
{
|
||||||
SceneObjectPart sop = (SceneObjectPart)entity;
|
SceneObjectPart sop = (SceneObjectPart)entity;
|
||||||
if (sop.ParentGroup.RootPart.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (entity is SceneObjectPart)
|
if (entity is SceneObjectPart)
|
||||||
{
|
{
|
||||||
// Attachments are high priority,
|
// Attachments are high priority,
|
||||||
if (((SceneObjectPart)entity).ParentGroup.RootPart.IsAttachment)
|
if (((SceneObjectPart)entity).ParentGroup.IsAttachment)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
// Non physical prims are lower priority than physical prims
|
// Non physical prims are lower priority than physical prims
|
||||||
|
|
|
@ -223,6 +223,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
// Retrieve group
|
// Retrieve group
|
||||||
SceneObjectPart part = GetSceneObjectPart(primId);
|
SceneObjectPart part = GetSceneObjectPart(primId);
|
||||||
|
if (part == null)
|
||||||
|
return new ArrayList();
|
||||||
SceneObjectGroup group = part.ParentGroup;
|
SceneObjectGroup group = part.ParentGroup;
|
||||||
if (null == group)
|
if (null == group)
|
||||||
{
|
{
|
||||||
|
@ -967,6 +969,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
|
public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||||
|
if (part == null)
|
||||||
|
return;
|
||||||
SceneObjectGroup group = part.ParentGroup;
|
SceneObjectGroup group = part.ParentGroup;
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
|
@ -2028,6 +2032,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
foreach (uint localID in localIDs)
|
foreach (uint localID in localIDs)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||||
|
if (part == null)
|
||||||
|
continue;
|
||||||
if (!groups.Contains(part.ParentGroup))
|
if (!groups.Contains(part.ParentGroup))
|
||||||
groups.Add(part.ParentGroup);
|
groups.Add(part.ParentGroup);
|
||||||
}
|
}
|
||||||
|
@ -2073,6 +2079,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
foreach (uint localID in localIDs)
|
foreach (uint localID in localIDs)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||||
|
if (part == null)
|
||||||
|
continue;
|
||||||
part.GetProperties(remoteClient);
|
part.GetProperties(remoteClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4223,7 +4223,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// their scripts will actually run.
|
// their scripts will actually run.
|
||||||
// -- Leaf, Tue Aug 12 14:17:05 EDT 2008
|
// -- Leaf, Tue Aug 12 14:17:05 EDT 2008
|
||||||
SceneObjectPart parent = part.ParentGroup.RootPart;
|
SceneObjectPart parent = part.ParentGroup.RootPart;
|
||||||
if (parent != null && parent.IsAttachment)
|
if (parent != null && part.ParentGroup.IsAttachment)
|
||||||
return ScriptDanger(parent, parent.GetWorldPosition());
|
return ScriptDanger(parent, parent.GetWorldPosition());
|
||||||
else
|
else
|
||||||
return ScriptDanger(part, part.GetWorldPosition());
|
return ScriptDanger(part, part.GetWorldPosition());
|
||||||
|
@ -5030,7 +5030,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
delete = true;
|
delete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (delete && !rootPart.IsAttachment && !deletes.Contains(g))
|
if (delete && !g.IsAttachment && !deletes.Contains(g))
|
||||||
deletes.Add(g);
|
deletes.Add(g);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1546,11 +1546,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
|
if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
|
||||||
{
|
{
|
||||||
SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID);
|
SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID);
|
||||||
|
if (part != null)
|
||||||
|
{
|
||||||
part.ClickAction = Convert.ToByte(clickAction);
|
part.ClickAction = Convert.ToByte(clickAction);
|
||||||
group.HasGroupChanged = true;
|
group.HasGroupChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected internal void PrimMaterial(IClientAPI remoteClient, uint primLocalID, string material)
|
protected internal void PrimMaterial(IClientAPI remoteClient, uint primLocalID, string material)
|
||||||
{
|
{
|
||||||
|
@ -1560,11 +1563,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
|
if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
|
||||||
{
|
{
|
||||||
SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID);
|
SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID);
|
||||||
|
if (part != null)
|
||||||
|
{
|
||||||
part.Material = Convert.ToByte(material);
|
part.Material = Convert.ToByte(material);
|
||||||
group.HasGroupChanged = true;
|
group.HasGroupChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected internal void UpdateExtraParam(UUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data)
|
protected internal void UpdateExtraParam(UUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -150,23 +150,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Is this scene object acting as an attachment?
|
/// Is this scene object acting as an attachment?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
public bool IsAttachment { get; set; }
|
||||||
/// We return false if the group has already been deleted.
|
|
||||||
///
|
|
||||||
/// TODO: At the moment set must be done on the part itself. There may be a case for doing it here since I
|
|
||||||
/// presume either all or no parts in a linkset can be part of an attachment (in which
|
|
||||||
/// case the value would get proprogated down into all the descendent parts).
|
|
||||||
/// </remarks>
|
|
||||||
public bool IsAttachment
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (!IsDeleted)
|
|
||||||
return m_rootPart.IsAttachment;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The avatar to which this scene object is attached.
|
/// The avatar to which this scene object is attached.
|
||||||
|
@ -176,6 +160,31 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public UUID AttachedAvatar { get; set; }
|
public UUID AttachedAvatar { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Attachment point of this scene object to an avatar.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 0 if we're not attached to anything
|
||||||
|
/// </remarks>
|
||||||
|
public uint AttachmentPoint
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_rootPart.Shape.State;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
IsAttachment = value != 0;
|
||||||
|
m_rootPart.Shape.State = (byte)value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ClearPartAttachmentData()
|
||||||
|
{
|
||||||
|
AttachmentPoint = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Is this scene object phantom?
|
/// Is this scene object phantom?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -354,11 +363,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check both the attachment property and the relevant properties of the underlying root part.
|
/// Check both the attachment property and the relevant properties of the underlying root part.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
/// This is necessary in some cases, particularly when a scene object has just crossed into a region and doesn't
|
/// This is necessary in some cases, particularly when a scene object has just crossed into a region and doesn't
|
||||||
/// have the IsAttachment property yet checked.
|
/// have the IsAttachment property yet checked.
|
||||||
///
|
///
|
||||||
/// FIXME: However, this should be fixed so that this property
|
/// FIXME: However, this should be fixed so that this property
|
||||||
/// propertly reflects the underlying status.
|
/// propertly reflects the underlying status.
|
||||||
|
/// </remarks>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool IsAttachmentCheckFull()
|
public bool IsAttachmentCheckFull()
|
||||||
{
|
{
|
||||||
|
@ -982,23 +993,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte GetAttachmentPoint()
|
|
||||||
{
|
|
||||||
return m_rootPart.Shape.State;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetAttachmentPoint(byte point)
|
|
||||||
{
|
|
||||||
SceneObjectPart[] parts = m_parts.GetArray();
|
|
||||||
for (int i = 0; i < parts.Length; i++)
|
|
||||||
parts[i].SetAttachmentPoint(point);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ClearPartAttachmentData()
|
|
||||||
{
|
|
||||||
SetAttachmentPoint((Byte)0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1424,16 +1418,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
// This is only necessary when userExposed is false!
|
// This is only necessary when userExposed is false!
|
||||||
|
|
||||||
bool previousAttachmentStatus = dupe.RootPart.IsAttachment;
|
bool previousAttachmentStatus = dupe.IsAttachment;
|
||||||
|
|
||||||
if (!userExposed)
|
if (!userExposed)
|
||||||
dupe.RootPart.IsAttachment = true;
|
dupe.IsAttachment = true;
|
||||||
|
|
||||||
dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
|
dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
|
||||||
|
|
||||||
if (!userExposed)
|
if (!userExposed)
|
||||||
{
|
{
|
||||||
dupe.RootPart.IsAttachment = previousAttachmentStatus;
|
dupe.IsAttachment = previousAttachmentStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
|
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
|
||||||
|
|
|
@ -215,18 +215,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public bool IsAttachment;
|
|
||||||
|
|
||||||
|
|
||||||
public scriptEvents AggregateScriptEvents;
|
public scriptEvents AggregateScriptEvents;
|
||||||
|
|
||||||
|
|
||||||
public Vector3 AttachedPos;
|
public Vector3 AttachedPos;
|
||||||
|
|
||||||
|
|
||||||
public uint AttachmentPoint;
|
|
||||||
|
|
||||||
|
|
||||||
public Vector3 RotationAxis = Vector3.One;
|
public Vector3 RotationAxis = Vector3.One;
|
||||||
|
|
||||||
|
|
||||||
|
@ -723,7 +717,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_groupPosition = actor.Position;
|
m_groupPosition = actor.Position;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsAttachment)
|
if (m_parentGroup.IsAttachment)
|
||||||
{
|
{
|
||||||
ScenePresence sp = m_parentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar);
|
ScenePresence sp = m_parentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar);
|
||||||
if (sp != null)
|
if (sp != null)
|
||||||
|
@ -807,7 +801,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
if (IsRoot)
|
if (IsRoot)
|
||||||
{
|
{
|
||||||
if (IsAttachment)
|
if (m_parentGroup.IsAttachment)
|
||||||
return AttachedPos;
|
return AttachedPos;
|
||||||
else
|
else
|
||||||
return AbsolutePosition;
|
return AbsolutePosition;
|
||||||
|
@ -1090,7 +1084,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (IsAttachment)
|
if (m_parentGroup.IsAttachment)
|
||||||
return GroupPosition;
|
return GroupPosition;
|
||||||
|
|
||||||
return m_offsetPosition + m_groupPosition;
|
return m_offsetPosition + m_groupPosition;
|
||||||
|
@ -1588,7 +1582,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
// The only time the physics scene shouldn't know about the prim is if it's phantom or an attachment, which is phantom by definition
|
// The only time the physics scene shouldn't know about the prim is if it's phantom or an attachment, which is phantom by definition
|
||||||
// or flexible
|
// or flexible
|
||||||
if (!isPhantom && !IsAttachment && !(Shape.PathCurve == (byte) Extrusion.Flexible))
|
if (!isPhantom && !m_parentGroup.IsAttachment && !(Shape.PathCurve == (byte) Extrusion.Flexible))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -2880,7 +2874,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public void rotLookAt(Quaternion target, float strength, float damping)
|
public void rotLookAt(Quaternion target, float strength, float damping)
|
||||||
{
|
{
|
||||||
if (IsAttachment)
|
if (m_parentGroup.IsAttachment)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
|
ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
|
||||||
|
@ -3014,7 +3008,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
if (IsRoot)
|
if (IsRoot)
|
||||||
{
|
{
|
||||||
if (IsAttachment)
|
if (m_parentGroup.IsAttachment)
|
||||||
{
|
{
|
||||||
SendFullUpdateToClient(remoteClient, AttachedPos, clientFlags);
|
SendFullUpdateToClient(remoteClient, AttachedPos, clientFlags);
|
||||||
}
|
}
|
||||||
|
@ -3076,7 +3070,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
// Suppress full updates during attachment editing
|
// Suppress full updates during attachment editing
|
||||||
//
|
//
|
||||||
if (ParentGroup.IsSelected && IsAttachment)
|
if (ParentGroup.IsSelected && ParentGroup.IsAttachment)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ParentGroup.IsDeleted)
|
if (ParentGroup.IsDeleted)
|
||||||
|
@ -3254,26 +3248,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetAttachmentPoint(uint AttachmentPoint)
|
|
||||||
{
|
|
||||||
this.AttachmentPoint = AttachmentPoint;
|
|
||||||
|
|
||||||
if (AttachmentPoint != 0)
|
|
||||||
{
|
|
||||||
IsAttachment = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
IsAttachment = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// save the attachment point.
|
|
||||||
//if (AttachmentPoint != 0)
|
|
||||||
//{
|
|
||||||
m_shape.State = (byte)AttachmentPoint;
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetAxisRotation(int axis, int rotate)
|
public void SetAxisRotation(int axis, int rotate)
|
||||||
{
|
{
|
||||||
if (m_parentGroup != null)
|
if (m_parentGroup != null)
|
||||||
|
@ -4497,7 +4471,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SetPhantom || IsAttachment || (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints
|
if (SetPhantom
|
||||||
|
|| ParentGroup.IsAttachment
|
||||||
|
|| (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints
|
||||||
{
|
{
|
||||||
AddFlag(PrimFlags.Phantom);
|
AddFlag(PrimFlags.Phantom);
|
||||||
if (PhysActor != null)
|
if (PhysActor != null)
|
||||||
|
@ -4928,7 +4904,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (ParentGroup == null || ParentGroup.IsDeleted)
|
if (ParentGroup == null || ParentGroup.IsDeleted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (IsAttachment && ParentGroup.RootPart != this)
|
if (ParentGroup.IsAttachment && ParentGroup.RootPart != this)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Causes this thread to dig into the Client Thread Data.
|
// Causes this thread to dig into the Client Thread Data.
|
||||||
|
|
|
@ -201,7 +201,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// Don't let this set the HasGroupChanged flag for attachments
|
// Don't let this set the HasGroupChanged flag for attachments
|
||||||
// as this happens during rez and we don't want a new asset
|
// as this happens during rez and we don't want a new asset
|
||||||
// for each attachment each time
|
// for each attachment each time
|
||||||
if (!m_part.ParentGroup.RootPart.IsAttachment)
|
if (!m_part.ParentGroup.IsAttachment)
|
||||||
{
|
{
|
||||||
HasInventoryChanged = true;
|
HasInventoryChanged = true;
|
||||||
m_part.ParentGroup.HasGroupChanged = true;
|
m_part.ParentGroup.HasGroupChanged = true;
|
||||||
|
|
|
@ -965,6 +965,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
presence.Animator.SendAnimPackToClient(ControllingClient);
|
presence.Animator.SendAnimPackToClient(ControllingClient);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// If we don't reset the movement flag here, an avatar that crosses to a neighbouring sim and returns will
|
||||||
|
// stall on the border crossing since the existing child agent will still have the last movement
|
||||||
|
// recorded, which stops the input from being processed.
|
||||||
|
m_movementflag = 0;
|
||||||
|
|
||||||
m_scene.EventManager.TriggerOnMakeRootAgent(this);
|
m_scene.EventManager.TriggerOnMakeRootAgent(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1247,6 +1252,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData)
|
public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat("[SCENE PRESENCE]: Received agent update from {0}", remoteClient.Name);
|
||||||
|
|
||||||
//if (m_isChildAgent)
|
//if (m_isChildAgent)
|
||||||
//{
|
//{
|
||||||
// // m_log.Debug("DEBUG: HandleAgentUpdate: child agent");
|
// // m_log.Debug("DEBUG: HandleAgentUpdate: child agent");
|
||||||
|
@ -1445,6 +1452,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
m_movementflag |= (byte)nudgehack;
|
m_movementflag |= (byte)nudgehack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// m_log.DebugFormat("[SCENE PRESENCE]: Updating m_movementflag for {0} with {1}", Name, DCF);
|
||||||
m_movementflag += (byte)(uint)DCF;
|
m_movementflag += (byte)(uint)DCF;
|
||||||
update_movementflag = true;
|
update_movementflag = true;
|
||||||
}
|
}
|
||||||
|
@ -1456,6 +1465,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
&& ((m_movementflag & (byte)nudgehack) == nudgehack))
|
&& ((m_movementflag & (byte)nudgehack) == nudgehack))
|
||||||
) // This or is for Nudge forward
|
) // This or is for Nudge forward
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat("[SCENE PRESENCE]: Updating m_movementflag for {0} with lack of {1}", Name, DCF);
|
||||||
m_movementflag -= ((byte)(uint)DCF);
|
m_movementflag -= ((byte)(uint)DCF);
|
||||||
update_movementflag = true;
|
update_movementflag = true;
|
||||||
|
|
||||||
|
@ -1520,12 +1530,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// which occurs later in the main scene loop
|
// which occurs later in the main scene loop
|
||||||
if (update_movementflag || (update_rotation && DCFlagKeyPressed))
|
if (update_movementflag || (update_rotation && DCFlagKeyPressed))
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed));
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3);
|
// "[SCENE PRESENCE]: In {0} adding velocity of {1} to {2}, umf = {3}, ur = {4}",
|
||||||
|
// m_scene.RegionInfo.RegionName, agent_control_v3, Name, update_movementflag, update_rotation);
|
||||||
|
|
||||||
AddNewMovement(agent_control_v3);
|
AddNewMovement(agent_control_v3);
|
||||||
}
|
}
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// if (!update_movementflag)
|
||||||
|
// {
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[SCENE PRESENCE]: In {0} ignoring requested update of {1} for {2} as update_movementflag = false",
|
||||||
|
// m_scene.RegionInfo.RegionName, agent_control_v3, Name);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
if (update_movementflag && m_parentID == 0)
|
if (update_movementflag && m_parentID == 0)
|
||||||
Animator.UpdateMovementAnimations();
|
Animator.UpdateMovementAnimations();
|
||||||
|
@ -3178,7 +3197,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
ISceneObject clone = sog.CloneForNewScene();
|
ISceneObject clone = sog.CloneForNewScene();
|
||||||
// Attachment module assumes that GroupPosition holds the offsets...!
|
// Attachment module assumes that GroupPosition holds the offsets...!
|
||||||
((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos;
|
((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos;
|
||||||
((SceneObjectGroup)clone).RootPart.IsAttachment = false;
|
((SceneObjectGroup)clone).IsAttachment = false;
|
||||||
cAgent.AttachmentObjects.Add(clone);
|
cAgent.AttachmentObjects.Add(clone);
|
||||||
string state = sog.GetStateSnapshot();
|
string state = sog.GetStateSnapshot();
|
||||||
cAgent.AttachmentObjectStates.Add(state);
|
cAgent.AttachmentObjectStates.Add(state);
|
||||||
|
@ -3477,7 +3496,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
foreach (SceneObjectGroup so in m_attachments)
|
foreach (SceneObjectGroup so in m_attachments)
|
||||||
{
|
{
|
||||||
if (attachmentPoint == so.RootPart.AttachmentPoint)
|
if (attachmentPoint == so.AttachmentPoint)
|
||||||
attachments.Add(so);
|
attachments.Add(so);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3869,12 +3888,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
if (grp.HasGroupChanged) // Resizer scripts?
|
if (grp.HasGroupChanged) // Resizer scripts?
|
||||||
{
|
{
|
||||||
grp.RootPart.IsAttachment = false;
|
grp.IsAttachment = false;
|
||||||
grp.AbsolutePosition = grp.RootPart.AttachedPos;
|
grp.AbsolutePosition = grp.RootPart.AttachedPos;
|
||||||
// grp.DetachToInventoryPrep();
|
// grp.DetachToInventoryPrep();
|
||||||
attachmentsModule.UpdateKnownItem(ControllingClient,
|
attachmentsModule.UpdateKnownItem(ControllingClient,
|
||||||
grp, grp.GetFromItemID(), grp.OwnerID);
|
grp, grp.GetFromItemID(), grp.OwnerID);
|
||||||
grp.RootPart.IsAttachment = true;
|
grp.IsAttachment = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,8 +120,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// We deal with the possibility that two updates occur at
|
// We deal with the possibility that two updates occur at
|
||||||
// the same unix time at the update point itself.
|
// the same unix time at the update point itself.
|
||||||
|
|
||||||
if ((update.LastFullUpdateTime < part.TimeStampFull) ||
|
if ((update.LastFullUpdateTime < part.TimeStampFull) || part.ParentGroup.IsAttachment)
|
||||||
part.IsAttachment)
|
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}",
|
// "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}",
|
||||||
|
|
|
@ -38,6 +38,17 @@ namespace OpenSim.Region.Physics.Manager
|
||||||
IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical);
|
IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Values for level of detail to be passed to the mesher.
|
||||||
|
// Values origionally chosen for the LOD of sculpties (the sqrt(width*heigth) of sculpt texture)
|
||||||
|
// Lower level of detail reduces the number of vertices used to represent the meshed shape.
|
||||||
|
public enum LevelOfDetail
|
||||||
|
{
|
||||||
|
High = 32,
|
||||||
|
Medium = 16,
|
||||||
|
Low = 8,
|
||||||
|
VeryLow = 4
|
||||||
|
}
|
||||||
|
|
||||||
public interface IVertex
|
public interface IVertex
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,67 +193,6 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
m_log.Error("****** PrimMesh Parameters ******\n" + primMesh.ParamsToDisplayString());
|
m_log.Error("****** PrimMesh Parameters ******\n" + primMesh.ParamsToDisplayString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private ulong GetMeshKey(PrimitiveBaseShape pbs, Vector3 size, float lod)
|
|
||||||
{
|
|
||||||
ulong hash = 5381;
|
|
||||||
|
|
||||||
hash = djb2(hash, pbs.PathCurve);
|
|
||||||
hash = djb2(hash, (byte)((byte)pbs.HollowShape | (byte)pbs.ProfileShape));
|
|
||||||
hash = djb2(hash, pbs.PathBegin);
|
|
||||||
hash = djb2(hash, pbs.PathEnd);
|
|
||||||
hash = djb2(hash, pbs.PathScaleX);
|
|
||||||
hash = djb2(hash, pbs.PathScaleY);
|
|
||||||
hash = djb2(hash, pbs.PathShearX);
|
|
||||||
hash = djb2(hash, pbs.PathShearY);
|
|
||||||
hash = djb2(hash, (byte)pbs.PathTwist);
|
|
||||||
hash = djb2(hash, (byte)pbs.PathTwistBegin);
|
|
||||||
hash = djb2(hash, (byte)pbs.PathRadiusOffset);
|
|
||||||
hash = djb2(hash, (byte)pbs.PathTaperX);
|
|
||||||
hash = djb2(hash, (byte)pbs.PathTaperY);
|
|
||||||
hash = djb2(hash, pbs.PathRevolutions);
|
|
||||||
hash = djb2(hash, (byte)pbs.PathSkew);
|
|
||||||
hash = djb2(hash, pbs.ProfileBegin);
|
|
||||||
hash = djb2(hash, pbs.ProfileEnd);
|
|
||||||
hash = djb2(hash, pbs.ProfileHollow);
|
|
||||||
|
|
||||||
// TODO: Separate scale out from the primitive shape data (after
|
|
||||||
// scaling is supported at the physics engine level)
|
|
||||||
byte[] scaleBytes = size.GetBytes();
|
|
||||||
for (int i = 0; i < scaleBytes.Length; i++)
|
|
||||||
hash = djb2(hash, scaleBytes[i]);
|
|
||||||
|
|
||||||
// Include LOD in hash, accounting for endianness
|
|
||||||
byte[] lodBytes = new byte[4];
|
|
||||||
Buffer.BlockCopy(BitConverter.GetBytes(lod), 0, lodBytes, 0, 4);
|
|
||||||
if (!BitConverter.IsLittleEndian)
|
|
||||||
{
|
|
||||||
Array.Reverse(lodBytes, 0, 4);
|
|
||||||
}
|
|
||||||
for (int i = 0; i < lodBytes.Length; i++)
|
|
||||||
hash = djb2(hash, lodBytes[i]);
|
|
||||||
|
|
||||||
// include sculpt UUID
|
|
||||||
if (pbs.SculptEntry)
|
|
||||||
{
|
|
||||||
scaleBytes = pbs.SculptTexture.GetBytes();
|
|
||||||
for (int i = 0; i < scaleBytes.Length; i++)
|
|
||||||
hash = djb2(hash, scaleBytes[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ulong djb2(ulong hash, byte c)
|
|
||||||
{
|
|
||||||
return ((hash << 5) + hash) + (ulong)c;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ulong djb2(ulong hash, ushort c)
|
|
||||||
{
|
|
||||||
hash = ((hash << 5) + hash) + (ulong)((byte)c);
|
|
||||||
return ((hash << 5) + hash) + (ulong)(c >> 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add a submesh to an existing list of coords and faces.
|
/// Add a submesh to an existing list of coords and faces.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -336,7 +275,7 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!GenerateCoordsAndFacesFromPrimShapeData(primName, primShape, size, out coords, out faces))
|
if (!GenerateCoordsAndFacesFromPrimShapeData(primName, primShape, size, lod, out coords, out faces))
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -616,7 +555,7 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
/// <param name="faces">Faces are added to this list by the method.</param>
|
/// <param name="faces">Faces are added to this list by the method.</param>
|
||||||
/// <returns>true if coords and faces were successfully generated, false if not</returns>
|
/// <returns>true if coords and faces were successfully generated, false if not</returns>
|
||||||
private bool GenerateCoordsAndFacesFromPrimShapeData(
|
private bool GenerateCoordsAndFacesFromPrimShapeData(
|
||||||
string primName, PrimitiveBaseShape primShape, Vector3 size, out List<Coord> coords, out List<Face> faces)
|
string primName, PrimitiveBaseShape primShape, Vector3 size, float lod, out List<Coord> coords, out List<Face> faces)
|
||||||
{
|
{
|
||||||
PrimMesh primMesh;
|
PrimMesh primMesh;
|
||||||
coords = new List<Coord>();
|
coords = new List<Coord>();
|
||||||
|
@ -636,13 +575,30 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
profileHollow = 0.95f;
|
profileHollow = 0.95f;
|
||||||
|
|
||||||
int sides = 4;
|
int sides = 4;
|
||||||
|
LevelOfDetail iLOD = (LevelOfDetail)lod;
|
||||||
if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.EquilateralTriangle)
|
if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.EquilateralTriangle)
|
||||||
sides = 3;
|
sides = 3;
|
||||||
else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.Circle)
|
else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.Circle)
|
||||||
sides = 24;
|
{
|
||||||
|
switch (iLOD)
|
||||||
|
{
|
||||||
|
case LevelOfDetail.High: sides = 24; break;
|
||||||
|
case LevelOfDetail.Medium: sides = 12; break;
|
||||||
|
case LevelOfDetail.Low: sides = 6; break;
|
||||||
|
case LevelOfDetail.VeryLow: sides = 3; break;
|
||||||
|
default: sides = 24; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.HalfCircle)
|
else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.HalfCircle)
|
||||||
{ // half circle, prim is a sphere
|
{ // half circle, prim is a sphere
|
||||||
sides = 24;
|
switch (iLOD)
|
||||||
|
{
|
||||||
|
case LevelOfDetail.High: sides = 24; break;
|
||||||
|
case LevelOfDetail.Medium: sides = 12; break;
|
||||||
|
case LevelOfDetail.Low: sides = 6; break;
|
||||||
|
case LevelOfDetail.VeryLow: sides = 3; break;
|
||||||
|
default: sides = 24; break;
|
||||||
|
}
|
||||||
|
|
||||||
profileBegin = 0.5f * profileBegin + 0.5f;
|
profileBegin = 0.5f * profileBegin + 0.5f;
|
||||||
profileEnd = 0.5f * profileEnd + 0.5f;
|
profileEnd = 0.5f * profileEnd + 0.5f;
|
||||||
|
@ -650,7 +606,16 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
|
|
||||||
int hollowSides = sides;
|
int hollowSides = sides;
|
||||||
if (primShape.HollowShape == HollowShape.Circle)
|
if (primShape.HollowShape == HollowShape.Circle)
|
||||||
hollowSides = 24;
|
{
|
||||||
|
switch (iLOD)
|
||||||
|
{
|
||||||
|
case LevelOfDetail.High: hollowSides = 24; break;
|
||||||
|
case LevelOfDetail.Medium: hollowSides = 12; break;
|
||||||
|
case LevelOfDetail.Low: hollowSides = 6; break;
|
||||||
|
case LevelOfDetail.VeryLow: hollowSides = 3; break;
|
||||||
|
default: hollowSides = 24; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (primShape.HollowShape == HollowShape.Square)
|
else if (primShape.HollowShape == HollowShape.Square)
|
||||||
hollowSides = 4;
|
hollowSides = 4;
|
||||||
else if (primShape.HollowShape == HollowShape.Triangle)
|
else if (primShape.HollowShape == HollowShape.Triangle)
|
||||||
|
@ -751,7 +716,7 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
|
|
||||||
// If this mesh has been created already, return it instead of creating another copy
|
// If this mesh has been created already, return it instead of creating another copy
|
||||||
// For large regions with 100k+ prims and hundreds of copies of each, this can save a GB or more of memory
|
// For large regions with 100k+ prims and hundreds of copies of each, this can save a GB or more of memory
|
||||||
key = GetMeshKey(primShape, size, lod);
|
key = primShape.GetMeshKey(size, lod);
|
||||||
if (m_uniqueMeshes.TryGetValue(key, out mesh))
|
if (m_uniqueMeshes.TryGetValue(key, out mesh))
|
||||||
return mesh;
|
return mesh;
|
||||||
|
|
||||||
|
|
|
@ -1965,7 +1965,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
if (part.ParentGroup.RootPart == part)
|
if (part.ParentGroup.RootPart == part)
|
||||||
{
|
{
|
||||||
if ((targetPos.z < ground) && disable_underground_movement && m_host.AttachmentPoint == 0)
|
if ((targetPos.z < ground) && disable_underground_movement && m_host.ParentGroup.AttachmentPoint == 0)
|
||||||
targetPos.z = ground;
|
targetPos.z = ground;
|
||||||
SceneObjectGroup parent = part.ParentGroup;
|
SceneObjectGroup parent = part.ParentGroup;
|
||||||
LSL_Vector real_vec = SetPosAdjust(currentPos, targetPos);
|
LSL_Vector real_vec = SetPosAdjust(currentPos, targetPos);
|
||||||
|
@ -2097,7 +2097,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
Quaternion q;
|
Quaternion q;
|
||||||
if (part.LinkNum == 0 || part.LinkNum == 1) // unlinked or root prim
|
if (part.LinkNum == 0 || part.LinkNum == 1) // unlinked or root prim
|
||||||
{
|
{
|
||||||
if (part.ParentGroup.RootPart.AttachmentPoint != 0)
|
if (part.ParentGroup.AttachmentPoint != 0)
|
||||||
{
|
{
|
||||||
ScenePresence avatar = World.GetScenePresence(part.ParentGroup.AttachedAvatar);
|
ScenePresence avatar = World.GetScenePresence(part.ParentGroup.AttachedAvatar);
|
||||||
if (avatar != null)
|
if (avatar != null)
|
||||||
|
@ -2241,7 +2241,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
Vector3 vel;
|
Vector3 vel;
|
||||||
|
|
||||||
if (m_host.IsAttachment)
|
if (m_host.ParentGroup.IsAttachment)
|
||||||
{
|
{
|
||||||
ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.AttachedAvatar);
|
ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.AttachedAvatar);
|
||||||
vel = avatar.Velocity;
|
vel = avatar.Velocity;
|
||||||
|
@ -2997,7 +2997,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
if (m_host.ParentGroup.RootPart.AttachmentPoint == 0)
|
if (m_host.ParentGroup.AttachmentPoint == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TaskInventoryItem item;
|
TaskInventoryItem item;
|
||||||
|
@ -3587,7 +3587,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)targetID);
|
SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)targetID);
|
||||||
|
|
||||||
if (targetPart.ParentGroup.RootPart.AttachmentPoint != 0)
|
if (targetPart.ParentGroup.AttachmentPoint != 0)
|
||||||
return; // Fail silently if attached
|
return; // Fail silently if attached
|
||||||
SceneObjectGroup parentPrim = null, childPrim = null;
|
SceneObjectGroup parentPrim = null, childPrim = null;
|
||||||
|
|
||||||
|
@ -3640,7 +3640,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
SceneObjectGroup parentPrim = m_host.ParentGroup;
|
SceneObjectGroup parentPrim = m_host.ParentGroup;
|
||||||
|
|
||||||
if (parentPrim.RootPart.AttachmentPoint != 0)
|
if (parentPrim.AttachmentPoint != 0)
|
||||||
return; // Fail silently if attached
|
return; // Fail silently if attached
|
||||||
SceneObjectPart childPrim = null;
|
SceneObjectPart childPrim = null;
|
||||||
|
|
||||||
|
@ -3710,7 +3710,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
SceneObjectGroup parentPrim = m_host.ParentGroup;
|
SceneObjectGroup parentPrim = m_host.ParentGroup;
|
||||||
if (parentPrim.RootPart.AttachmentPoint != 0)
|
if (parentPrim.AttachmentPoint != 0)
|
||||||
return; // Fail silently if attached
|
return; // Fail silently if attached
|
||||||
|
|
||||||
List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Parts);
|
List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Parts);
|
||||||
|
@ -4349,7 +4349,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Object not pushable. Not an attachment and has no physics component
|
// Object not pushable. Not an attachment and has no physics component
|
||||||
if (!pusheeob.IsAttachment && pusheeob.PhysActor == null)
|
if (!pusheeob.ParentGroup.IsAttachment && pusheeob.PhysActor == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PusheePos = pusheeob.AbsolutePosition;
|
PusheePos = pusheeob.AbsolutePosition;
|
||||||
|
@ -5857,7 +5857,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
public LSL_Integer llGetAttached()
|
public LSL_Integer llGetAttached()
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
return m_host.ParentGroup.RootPart.AttachmentPoint;
|
return m_host.ParentGroup.AttachmentPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Integer llGetFreeMemory()
|
public LSL_Integer llGetFreeMemory()
|
||||||
|
@ -7458,7 +7458,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
Quaternion q;
|
Quaternion q;
|
||||||
if (m_host.ParentGroup.RootPart.AttachmentPoint != 0)
|
if (m_host.ParentGroup.AttachmentPoint != 0)
|
||||||
{
|
{
|
||||||
ScenePresence avatar = World.GetScenePresence(m_host.ParentGroup.AttachedAvatar);
|
ScenePresence avatar = World.GetScenePresence(m_host.ParentGroup.AttachedAvatar);
|
||||||
if (avatar != null)
|
if (avatar != null)
|
||||||
|
|
|
@ -303,7 +303,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||||
float dz;
|
float dz;
|
||||||
|
|
||||||
Quaternion q = SensePoint.RotationOffset;
|
Quaternion q = SensePoint.RotationOffset;
|
||||||
if (SensePoint.ParentGroup.RootPart.IsAttachment)
|
if (SensePoint.ParentGroup.IsAttachment)
|
||||||
{
|
{
|
||||||
// In attachments, the sensor cone always orients with the
|
// In attachments, the sensor cone always orients with the
|
||||||
// avatar rotation. This may include a nonzero elevation if
|
// avatar rotation. This may include a nonzero elevation if
|
||||||
|
@ -352,7 +352,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||||
objtype = 0;
|
objtype = 0;
|
||||||
|
|
||||||
part = ((SceneObjectGroup)ent).RootPart;
|
part = ((SceneObjectGroup)ent).RootPart;
|
||||||
if (part.AttachmentPoint != 0) // Attached so ignore
|
if (part.ParentGroup.AttachmentPoint != 0) // Attached so ignore
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (part.Inventory.ContainsScripts())
|
if (part.Inventory.ContainsScripts())
|
||||||
|
@ -423,7 +423,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||||
Vector3 fromRegionPos = SensePoint.AbsolutePosition;
|
Vector3 fromRegionPos = SensePoint.AbsolutePosition;
|
||||||
|
|
||||||
Quaternion q = SensePoint.RotationOffset;
|
Quaternion q = SensePoint.RotationOffset;
|
||||||
if (SensePoint.ParentGroup.RootPart.IsAttachment)
|
if (SensePoint.ParentGroup.IsAttachment)
|
||||||
{
|
{
|
||||||
// In attachments, the sensor cone always orients with the
|
// In attachments, the sensor cone always orients with the
|
||||||
// avatar rotation. This may include a nonzero elevation if
|
// avatar rotation. This may include a nonzero elevation if
|
||||||
|
@ -435,7 +435,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||||
LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
|
LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
|
||||||
LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r);
|
LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r);
|
||||||
double mag_fwd = LSL_Types.Vector3.Mag(forward_dir);
|
double mag_fwd = LSL_Types.Vector3.Mag(forward_dir);
|
||||||
bool attached = (SensePoint.AttachmentPoint != 0);
|
bool attached = (SensePoint.ParentGroup.AttachmentPoint != 0);
|
||||||
Vector3 toRegionPos;
|
Vector3 toRegionPos;
|
||||||
double dis;
|
double dis;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue