diff options
author | Teravus Ovares | 2008-04-24 11:32:41 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-04-24 11:32:41 +0000 |
commit | aa8aee90a35458f1f601ca23e2298b212782d0a3 (patch) | |
tree | 37c2645867cba040a4ad7e32d1b5ccd56d155d87 /OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |
parent | * From: Alan M Webb <awebb.vnet.ibm.com> (diff) | |
download | opensim-SC-aa8aee90a35458f1f601ca23e2298b212782d0a3.zip opensim-SC-aa8aee90a35458f1f601ca23e2298b212782d0a3.tar.gz opensim-SC-aa8aee90a35458f1f601ca23e2298b212782d0a3.tar.bz2 opensim-SC-aa8aee90a35458f1f601ca23e2298b212782d0a3.tar.xz |
* Adds much better support for attachments that you right click on in world.
* Your friends can see your attachments now. People who appear in the sim after you've attached something can also see your attachments.
* You can position & rotate your attachments now. Positions do *not* save.
* You can detach attachments now the regular way.
* Attachments do not cross into other regions with you..(this isn't too far off)
* Updated ODE to not request terse updates on child prim.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index e2cb3ac..099d0f0 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -99,6 +99,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
99 | // TODO: This needs to be persisted in next XML version update! | 99 | // TODO: This needs to be persisted in next XML version update! |
100 | [XmlIgnore] public int[] PayPrice = {0,0,0,0,0}; | 100 | [XmlIgnore] public int[] PayPrice = {0,0,0,0,0}; |
101 | 101 | ||
102 | |||
103 | [XmlIgnore] public bool m_IsAttachment = false; | ||
104 | [XmlIgnore] public uint m_attachmentPoint = (byte)0; | ||
105 | [XmlIgnore] public LLUUID m_attachedAvatar = LLUUID.Zero; | ||
106 | |||
102 | public Int32 CreationDate; | 107 | public Int32 CreationDate; |
103 | public uint ParentID = 0; | 108 | public uint ParentID = 0; |
104 | 109 | ||
@@ -1271,7 +1276,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
1271 | } | 1276 | } |
1272 | return returnresult; | 1277 | return returnresult; |
1273 | } | 1278 | } |
1279 | |||
1280 | // Use this for attachments! LocalID should be avatar's localid | ||
1281 | public void SetParentLocalId(uint localID) | ||
1282 | { | ||
1283 | ParentID = localID; | ||
1284 | } | ||
1274 | 1285 | ||
1286 | public void SetAttachmentPoint(uint AttachmentPoint) | ||
1287 | { | ||
1288 | m_attachmentPoint = AttachmentPoint; | ||
1289 | } | ||
1275 | /// <summary> | 1290 | /// <summary> |
1276 | /// | 1291 | /// |
1277 | /// </summary> | 1292 | /// </summary> |
@@ -2212,7 +2227,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2212 | byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; | 2227 | byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; |
2213 | remoteClient.SendPrimitiveToClient(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape, lPos, clientFlags, m_uuid, | 2228 | remoteClient.SendPrimitiveToClient(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape, lPos, clientFlags, m_uuid, |
2214 | OwnerID, | 2229 | OwnerID, |
2215 | m_text, color, ParentID, m_particleSystem, lRot, m_clickAction, m_TextureAnimation); | 2230 | m_text, color, ParentID, m_particleSystem, lRot, m_clickAction, m_TextureAnimation, m_IsAttachment, m_attachmentPoint); |
2216 | } | 2231 | } |
2217 | 2232 | ||
2218 | /// Terse updates | 2233 | /// Terse updates |
@@ -2271,15 +2286,22 @@ namespace OpenSim.Region.Environment.Scenes | |||
2271 | public void SendTerseUpdateToClient(IClientAPI remoteClient, LLVector3 lPos) | 2286 | public void SendTerseUpdateToClient(IClientAPI remoteClient, LLVector3 lPos) |
2272 | { | 2287 | { |
2273 | LLQuaternion mRot = RotationOffset; | 2288 | LLQuaternion mRot = RotationOffset; |
2274 | if ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0) | 2289 | if (m_IsAttachment) |
2275 | { | 2290 | { |
2276 | remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Shape.State); | 2291 | remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, (byte)(((byte)m_attachmentPoint) << 4)); |
2277 | } | 2292 | } |
2278 | else | 2293 | else |
2279 | { | 2294 | { |
2280 | remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Velocity, | 2295 | if ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) == 0) |
2281 | RotationalVelocity); | 2296 | { |
2282 | //System.Console.WriteLine("LID: " + LocalID + "RVel:" + RotationalVelocity.ToString() + " TD: " + ((ushort)(m_parentGroup.Scene.TimeDilation * 500000f)).ToString() + ":" + m_parentGroup.Scene.TimeDilation.ToString()); | 2297 | remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Shape.State); |
2298 | } | ||
2299 | else | ||
2300 | { | ||
2301 | remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Velocity, | ||
2302 | RotationalVelocity); | ||
2303 | //System.Console.WriteLine("LID: " + LocalID + "RVel:" + RotationalVelocity.ToString() + " TD: " + ((ushort)(m_parentGroup.Scene.TimeDilation * 500000f)).ToString() + ":" + m_parentGroup.Scene.TimeDilation.ToString()); | ||
2304 | } | ||
2283 | } | 2305 | } |
2284 | } | 2306 | } |
2285 | 2307 | ||