diff options
author | Teravus Ovares | 2008-02-02 03:57:57 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-02-02 03:57:57 +0000 |
commit | d4f32649cd298168ec7645ac75f08455e8bed49e (patch) | |
tree | 9e843428a9f84ee88d574cd7b596b5e6d8beaa15 /OpenSim/Region | |
parent | Added header/footer of scripts to make C# and VB scripts much easier to write. (diff) | |
download | opensim-SC-d4f32649cd298168ec7645ac75f08455e8bed49e.zip opensim-SC-d4f32649cd298168ec7645ac75f08455e8bed49e.tar.gz opensim-SC-d4f32649cd298168ec7645ac75f08455e8bed49e.tar.bz2 opensim-SC-d4f32649cd298168ec7645ac75f08455e8bed49e.tar.xz |
* Committing some untested stuff regarding texture animations. This won't break anything, but the llSetTextureAnim function is completely untested.. (though it may be functional once the script engine works again)
Diffstat (limited to 'OpenSim/Region')
4 files changed, 45 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 370bdbb..c68c3c7 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -1588,13 +1588,24 @@ namespace OpenSim.Region.ClientStack | |||
1588 | OutPacket(attach, ThrottleOutPacketType.Task); | 1588 | OutPacket(attach, ThrottleOutPacketType.Task); |
1589 | } | 1589 | } |
1590 | 1590 | ||
1591 | |||
1592 | public void SendPrimitiveToClient( | 1591 | public void SendPrimitiveToClient( |
1593 | ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, | 1592 | ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, |
1594 | uint flags, | 1593 | uint flags, |
1595 | LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, | 1594 | LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, |
1596 | LLQuaternion rotation, byte clickAction) | 1595 | LLQuaternion rotation, byte clickAction) |
1597 | { | 1596 | { |
1597 | byte[] textureanim = new byte[0]; | ||
1598 | |||
1599 | SendPrimitiveToClient(regionHandle, timeDilation, localID, primShape, pos, flags, | ||
1600 | objectID, ownerID, text, color, parentID, particleSystem, | ||
1601 | rotation, clickAction, textureanim); | ||
1602 | } | ||
1603 | public void SendPrimitiveToClient( | ||
1604 | ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, | ||
1605 | uint flags, | ||
1606 | LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, | ||
1607 | LLQuaternion rotation, byte clickAction, byte[] textureanim) | ||
1608 | { | ||
1598 | ObjectUpdatePacket outPacket = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); | 1609 | ObjectUpdatePacket outPacket = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); |
1599 | // TODO: don't create new blocks if recycling an old packet | 1610 | // TODO: don't create new blocks if recycling an old packet |
1600 | outPacket.RegionData.RegionHandle = regionHandle; | 1611 | outPacket.RegionData.RegionHandle = regionHandle; |
@@ -1615,6 +1626,8 @@ namespace OpenSim.Region.ClientStack | |||
1615 | outPacket.ObjectData[0].PSBlock = particleSystem; | 1626 | outPacket.ObjectData[0].PSBlock = particleSystem; |
1616 | outPacket.ObjectData[0].ClickAction = clickAction; | 1627 | outPacket.ObjectData[0].ClickAction = clickAction; |
1617 | //outPacket.ObjectData[0].Flags = 0; | 1628 | //outPacket.ObjectData[0].Flags = 0; |
1629 | |||
1630 | // Sound Radius | ||
1618 | outPacket.ObjectData[0].Radius = 20; | 1631 | outPacket.ObjectData[0].Radius = 20; |
1619 | 1632 | ||
1620 | byte[] pb = pos.GetBytes(); | 1633 | byte[] pb = pos.GetBytes(); |
@@ -1623,6 +1636,10 @@ namespace OpenSim.Region.ClientStack | |||
1623 | byte[] rot = rotation.GetBytes(); | 1636 | byte[] rot = rotation.GetBytes(); |
1624 | Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 36, rot.Length); | 1637 | Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 36, rot.Length); |
1625 | 1638 | ||
1639 | if (textureanim.Length > 0) | ||
1640 | outPacket.ObjectData[0].TextureAnim = textureanim; | ||
1641 | |||
1642 | |||
1626 | OutPacket(outPacket, ThrottleOutPacketType.Task); | 1643 | OutPacket(outPacket, ThrottleOutPacketType.Task); |
1627 | } | 1644 | } |
1628 | 1645 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 452614c..9be75da 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -276,6 +276,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
276 | } | 276 | } |
277 | } | 277 | } |
278 | 278 | ||
279 | private byte[] m_TextureAnimation; | ||
280 | |||
279 | protected LLVector3 m_offsetPosition; | 281 | protected LLVector3 m_offsetPosition; |
280 | 282 | ||
281 | public LLVector3 OffsetPosition | 283 | public LLVector3 OffsetPosition |
@@ -600,6 +602,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
600 | { | 602 | { |
601 | // It's not necessary to persist this | 603 | // It's not necessary to persist this |
602 | m_inventoryFileName = "taskinventory" + LLUUID.Random().ToString(); | 604 | m_inventoryFileName = "taskinventory" + LLUUID.Random().ToString(); |
605 | m_TextureAnimation = new byte[0]; | ||
603 | } | 606 | } |
604 | 607 | ||
605 | public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, | 608 | public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, |
@@ -646,7 +649,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
646 | m_rotationalvelocity = new LLVector3(0, 0, 0); | 649 | m_rotationalvelocity = new LLVector3(0, 0, 0); |
647 | AngularVelocity = new LLVector3(0, 0, 0); | 650 | AngularVelocity = new LLVector3(0, 0, 0); |
648 | Acceleration = new LLVector3(0, 0, 0); | 651 | Acceleration = new LLVector3(0, 0, 0); |
649 | 652 | m_TextureAnimation = new byte[0]; | |
650 | m_inventoryFileName = "taskinventory" + LLUUID.Random().ToString(); | 653 | m_inventoryFileName = "taskinventory" + LLUUID.Random().ToString(); |
651 | m_folderID = LLUUID.Random(); | 654 | m_folderID = LLUUID.Random(); |
652 | 655 | ||
@@ -1364,6 +1367,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
1364 | UpdateTextureEntry(tex.ToBytes()); | 1367 | UpdateTextureEntry(tex.ToBytes()); |
1365 | } | 1368 | } |
1366 | 1369 | ||
1370 | public void AddTextureAnimation(Primitive.TextureAnimation pTexAnim) | ||
1371 | { | ||
1372 | m_TextureAnimation = pTexAnim.GetBytes(); | ||
1373 | } | ||
1374 | |||
1367 | #endregion | 1375 | #endregion |
1368 | 1376 | ||
1369 | #region ParticleSystem | 1377 | #region ParticleSystem |
@@ -1534,7 +1542,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1534 | byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; | 1542 | byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; |
1535 | remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalID, m_shape, lPos, clientFlags, m_uuid, | 1543 | remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalID, m_shape, lPos, clientFlags, m_uuid, |
1536 | OwnerID, | 1544 | OwnerID, |
1537 | m_text, color, ParentID, m_particleSystem, lRot, m_clickAction); | 1545 | m_text, color, ParentID, m_particleSystem, lRot, m_clickAction, m_TextureAnimation); |
1538 | } | 1546 | } |
1539 | 1547 | ||
1540 | /// Terse updates | 1548 | /// Terse updates |
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index ea1e28e..b5663de 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |||
@@ -327,7 +327,13 @@ namespace SimpleApp | |||
327 | byte[] particleSystem, LLQuaternion rotation, byte clickAction) | 327 | byte[] particleSystem, LLQuaternion rotation, byte clickAction) |
328 | { | 328 | { |
329 | } | 329 | } |
330 | 330 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, | |
331 | PrimitiveBaseShape primShape, LLVector3 pos, uint flags, | ||
332 | LLUUID objectID, LLUUID ownerID, string text, byte[] color, | ||
333 | uint parentID, | ||
334 | byte[] particleSystem, LLQuaternion rotation, byte clickAction, byte[] textureanimation) | ||
335 | { | ||
336 | } | ||
331 | public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, | 337 | public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, |
332 | LLVector3 position, LLQuaternion rotation) | 338 | LLVector3 position, LLQuaternion rotation) |
333 | { | 339 | { |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index bbf301d..3f719fb 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -2007,7 +2007,16 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2007 | 2007 | ||
2008 | public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) | 2008 | public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) |
2009 | { | 2009 | { |
2010 | NotImplemented("llSetTextureAnim"); | 2010 | Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation(); |
2011 | pTexAnim.Flags = (uint)mode; | ||
2012 | pTexAnim.Face = (uint)face; | ||
2013 | pTexAnim.Length = (float)length; | ||
2014 | pTexAnim.Rate = (float)rate; | ||
2015 | pTexAnim.SizeX = (uint)sizex; | ||
2016 | pTexAnim.SizeY = (uint)sizey; | ||
2017 | pTexAnim.Start = (float)start; | ||
2018 | m_host.AddTextureAnimation(pTexAnim); | ||
2019 | m_host.SendFullUpdateToAllClients(); | ||
2011 | } | 2020 | } |
2012 | 2021 | ||
2013 | public void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, | 2022 | public void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, |