IZ QUATERNION NORMALIZE TO 0? NOWAI! KTHXBYE

0.6.0-stable
Teravus Ovares 2008-05-21 17:29:03 +00:00
parent aa348c4804
commit 0b719286a4
1 changed files with 10 additions and 0 deletions

View File

@ -2057,6 +2057,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
LLVector3 velocity, LLQuaternion rotation)
{
if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == rotation.X)
rotation = LLQuaternion.Identity;
ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock =
CreateAvatarImprovedBlock(localID, position, velocity, rotation);
ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate);
@ -2145,6 +2148,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem,
byte clickAction, byte[] textureanim, bool attachment, uint AttachPoint, LLUUID AssetId)
{
if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == rotation.X)
rotation = LLQuaternion.Identity;
ObjectUpdatePacket outPacket = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
// TODO: don't create new blocks if recycling an old packet
outPacket.RegionData.RegionHandle = regionHandle;
@ -2220,6 +2226,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity, byte state, LLUUID AssetId)
{
if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == rotation.X)
rotation = LLQuaternion.Identity;
ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate);
// TODO: don't create new blocks if recycling an old packet
terse.RegionData.RegionHandle = regionHandle;
@ -2234,6 +2242,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity)
{
if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == rotation.X)
rotation = LLQuaternion.Identity;
ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate);
// TODO: don't create new blocks if recycling an old packet
terse.RegionData.RegionHandle = regionHandle;