Added MW's fix for smooth movement

adam
gareth 2007-03-04 19:12:07 +00:00
parent c3d40feeb6
commit ea28985d05
1 changed files with 10 additions and 6 deletions

View File

@ -145,13 +145,17 @@ namespace OpenSim.world
Array.Copy(pb, 0, bytes, i, pb.Length); Array.Copy(pb, 0, bytes, i, pb.Length);
i += 12; i += 12;
ushort ac = 32767; ushort ac = 32767;
bytes[i++] = (byte)(ac % 256); // avatar.InternVelocityX bytes[i++] = (byte)((ushort)(((this.velocity.X/128f)+1)*32767) % 256 );
bytes[i++] = (byte)((ac>> 8) % 256); bytes[i++] = (byte)(((ushort)(((this.velocity.X/128f)+1)*32767) >> 8) % 256);
bytes[i++] = (byte)(ac % 256); // avatar.InternVelocityY bytes[i++] = (byte)((ushort)(((this.velocity.Y/128f)+1)*32767) % 256);
bytes[i++] = (byte)((ac >> 8) % 256); bytes[i++] = (byte)(((ushort)(((this.velocity.Y/128f)+1)*32767) >> 8) % 256);
bytes[i++] = (byte)(ac % 256); // avatar.InternVelocityZ bytes[i++] = (byte)((ushort)(((this.velocity.Z/128f)+1)*32767) % 256);
bytes[i++] = (byte)((ac >> 8) % 256); bytes[i++] = (byte)(((ushort)(((this.velocity.Z/128f)+1)*32767) >> 8) % 256);
//accel //accel
bytes[i++] = (byte)(ac % 256); bytes[i++] = (byte)(ac % 256);