fix the encoding of rotation in updates, not just using the next field to

override w bytes. ( specially having it commented )
avinationmerge
UbitUmarov 2014-08-19 09:04:20 +01:00
parent e883fb519b
commit 8f0d35e59a
1 changed files with 12 additions and 15 deletions

View File

@ -5291,16 +5291,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
byte[] objectData = new byte[76]; byte[] objectData = new byte[76];
Vector3 velocity = data.Velocity;
Vector3 acceleration = new Vector3(0, 0, 0);
rotation.Normalize();
Vector3 vrot = new Vector3(rotation.X, rotation.Y, rotation.Z);
data.CollisionPlane.ToBytes(objectData, 0); data.CollisionPlane.ToBytes(objectData, 0);
offsetPosition.ToBytes(objectData, 16); offsetPosition.ToBytes(objectData, 16);
Vector3 velocity = new Vector3(0, 0, 0);
Vector3 acceleration = new Vector3(0, 0, 0);
velocity.ToBytes(objectData, 28); velocity.ToBytes(objectData, 28);
acceleration.ToBytes(objectData, 40); acceleration.ToBytes(objectData, 40);
// data.Velocity.ToBytes(objectData, 28); vrot.ToBytes(objectData, 52);
// data.Acceleration.ToBytes(objectData, 40); data.AngularVelocity.ToBytes(objectData, 64);
rotation.ToBytes(objectData, 52);
//data.AngularVelocity.ToBytes(objectData, 64);
ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock(); ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock();
@ -5356,15 +5357,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
data.RelativePosition.ToBytes(objectData, 0); data.RelativePosition.ToBytes(objectData, 0);
data.Velocity.ToBytes(objectData, 12); data.Velocity.ToBytes(objectData, 12);
data.Acceleration.ToBytes(objectData, 24); data.Acceleration.ToBytes(objectData, 24);
try
{ Quaternion rotation = data.RotationOffset;
data.RotationOffset.ToBytes(objectData, 36); rotation.Normalize();
} Vector3 vrot = new Vector3(rotation.X, rotation.Y, rotation.Z);
catch (Exception e) vrot.ToBytes(objectData, 36);
{
m_log.Warn("[LLClientView]: exception converting quaternion to bytes, using Quaternion.Identity. Exception: " + e.ToString());
OpenMetaverse.Quaternion.Identity.ToBytes(objectData, 36);
}
data.AngularVelocity.ToBytes(objectData, 48); data.AngularVelocity.ToBytes(objectData, 48);
ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock(); ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock();