diff options
author | gareth | 2007-03-04 19:12:07 +0000 |
---|---|---|
committer | gareth | 2007-03-04 19:12:07 +0000 |
commit | ea28985d05160127a96184c2c9ac0ed94101a20b (patch) | |
tree | c7459331a3dd43006c2ffe3d909b72fe30b384b4 /src | |
parent | Implemented chat (diff) | |
download | opensim-SC_OLD-ea28985d05160127a96184c2c9ac0ed94101a20b.zip opensim-SC_OLD-ea28985d05160127a96184c2c9ac0ed94101a20b.tar.gz opensim-SC_OLD-ea28985d05160127a96184c2c9ac0ed94101a20b.tar.bz2 opensim-SC_OLD-ea28985d05160127a96184c2c9ac0ed94101a20b.tar.xz |
Added MW's fix for smooth movement
Diffstat (limited to 'src')
-rw-r--r-- | src/world/Avatar.cs | 16 |
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); |