diff options
author | UbitUmarov | 2014-08-19 09:04:20 +0100 |
---|---|---|
committer | UbitUmarov | 2014-08-19 09:04:20 +0100 |
commit | 8f0d35e59a77ec44c7ee55296a02882b424b469f (patch) | |
tree | 302759f41f97efbed7c8861d6ada927c6092767c /OpenSim/Region | |
parent | test (diff) | |
download | opensim-SC-8f0d35e59a77ec44c7ee55296a02882b424b469f.zip opensim-SC-8f0d35e59a77ec44c7ee55296a02882b424b469f.tar.gz opensim-SC-8f0d35e59a77ec44c7ee55296a02882b424b469f.tar.bz2 opensim-SC-8f0d35e59a77ec44c7ee55296a02882b424b469f.tar.xz |
fix the encoding of rotation in updates, not just using the next field to
override w bytes. ( specially having it commented )
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 608b739..6eb0c5e 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -5291,16 +5291,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5291 | 5291 | ||
5292 | byte[] objectData = new byte[76]; | 5292 | byte[] objectData = new byte[76]; |
5293 | 5293 | ||
5294 | Vector3 velocity = data.Velocity; | ||
5295 | Vector3 acceleration = new Vector3(0, 0, 0); | ||
5296 | rotation.Normalize(); | ||
5297 | Vector3 vrot = new Vector3(rotation.X, rotation.Y, rotation.Z); | ||
5298 | |||
5294 | data.CollisionPlane.ToBytes(objectData, 0); | 5299 | data.CollisionPlane.ToBytes(objectData, 0); |
5295 | offsetPosition.ToBytes(objectData, 16); | 5300 | offsetPosition.ToBytes(objectData, 16); |
5296 | Vector3 velocity = new Vector3(0, 0, 0); | ||
5297 | Vector3 acceleration = new Vector3(0, 0, 0); | ||
5298 | velocity.ToBytes(objectData, 28); | 5301 | velocity.ToBytes(objectData, 28); |
5299 | acceleration.ToBytes(objectData, 40); | 5302 | acceleration.ToBytes(objectData, 40); |
5300 | // data.Velocity.ToBytes(objectData, 28); | 5303 | vrot.ToBytes(objectData, 52); |
5301 | // data.Acceleration.ToBytes(objectData, 40); | 5304 | data.AngularVelocity.ToBytes(objectData, 64); |
5302 | rotation.ToBytes(objectData, 52); | ||
5303 | //data.AngularVelocity.ToBytes(objectData, 64); | ||
5304 | 5305 | ||
5305 | ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock(); | 5306 | ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock(); |
5306 | 5307 | ||
@@ -5356,15 +5357,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5356 | data.RelativePosition.ToBytes(objectData, 0); | 5357 | data.RelativePosition.ToBytes(objectData, 0); |
5357 | data.Velocity.ToBytes(objectData, 12); | 5358 | data.Velocity.ToBytes(objectData, 12); |
5358 | data.Acceleration.ToBytes(objectData, 24); | 5359 | data.Acceleration.ToBytes(objectData, 24); |
5359 | try | 5360 | |
5360 | { | 5361 | Quaternion rotation = data.RotationOffset; |
5361 | data.RotationOffset.ToBytes(objectData, 36); | 5362 | rotation.Normalize(); |
5362 | } | 5363 | Vector3 vrot = new Vector3(rotation.X, rotation.Y, rotation.Z); |
5363 | catch (Exception e) | 5364 | vrot.ToBytes(objectData, 36); |
5364 | { | ||
5365 | m_log.Warn("[LLClientView]: exception converting quaternion to bytes, using Quaternion.Identity. Exception: " + e.ToString()); | ||
5366 | OpenMetaverse.Quaternion.Identity.ToBytes(objectData, 36); | ||
5367 | } | ||
5368 | data.AngularVelocity.ToBytes(objectData, 48); | 5365 | data.AngularVelocity.ToBytes(objectData, 48); |
5369 | 5366 | ||
5370 | ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock(); | 5367 | ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock(); |