aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/world/Avatar.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/world/Avatar.cs')
-rw-r--r--src/world/Avatar.cs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/world/Avatar.cs b/src/world/Avatar.cs
index fbd78b7..6dcc1dd 100644
--- a/src/world/Avatar.cs
+++ b/src/world/Avatar.cs
@@ -145,13 +145,17 @@ namespace OpenSim.world
145 Array.Copy(pb, 0, bytes, i, pb.Length); 145 Array.Copy(pb, 0, bytes, i, pb.Length);
146 i += 12; 146 i += 12;
147 147
148
148 ushort ac = 32767; 149 ushort ac = 32767;
149 bytes[i++] = (byte)(ac % 256); // avatar.InternVelocityX 150 bytes[i++] = (byte)((ushort)(((this.velocity.X/128f)+1)*32767) % 256 );
150 bytes[i++] = (byte)((ac>> 8) % 256); 151 bytes[i++] = (byte)(((ushort)(((this.velocity.X/128f)+1)*32767) >> 8) % 256);
151 bytes[i++] = (byte)(ac % 256); // avatar.InternVelocityY 152 bytes[i++] = (byte)((ushort)(((this.velocity.Y/128f)+1)*32767) % 256);
152 bytes[i++] = (byte)((ac >> 8) % 256); 153 bytes[i++] = (byte)(((ushort)(((this.velocity.Y/128f)+1)*32767) >> 8) % 256);
153 bytes[i++] = (byte)(ac % 256); // avatar.InternVelocityZ 154 bytes[i++] = (byte)((ushort)(((this.velocity.Z/128f)+1)*32767) % 256);
154 bytes[i++] = (byte)((ac >> 8) % 256); 155 bytes[i++] = (byte)(((ushort)(((this.velocity.Z/128f)+1)*32767) >> 8) % 256);
156
157
158
155 159
156 //accel 160 //accel
157 bytes[i++] = (byte)(ac % 256); 161 bytes[i++] = (byte)(ac % 256);