diff options
author | Dalien Talbot | 2007-09-08 16:30:39 +0000 |
---|---|---|
committer | Dalien Talbot | 2007-09-08 16:30:39 +0000 |
commit | 3433f3814acbed69b60f177576602a6cb6a3677c (patch) | |
tree | 2978745e09e36716b5948f2d956647b71803c75a /OpenSim/Region/ClientStack/ClientView.API.cs | |
parent | Another attempt at an i386 version of libode. If this doesn't test out for pe... (diff) | |
download | opensim-SC-3433f3814acbed69b60f177576602a6cb6a3677c.zip opensim-SC-3433f3814acbed69b60f177576602a6cb6a3677c.tar.gz opensim-SC-3433f3814acbed69b60f177576602a6cb6a3677c.tar.bz2 opensim-SC-3433f3814acbed69b60f177576602a6cb6a3677c.tar.xz |
Partial fix for the "avatars permanently facing east" - now the rotation
is set correctly, but only with the movement of the avatar.
The in-place rotation updates need a little bit of more thought,
and will be in a separate commit.
Diffstat (limited to 'OpenSim/Region/ClientStack/ClientView.API.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.API.cs | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index edc1268..c5a2284 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs | |||
@@ -929,9 +929,9 @@ namespace OpenSim.Region.ClientStack | |||
929 | /// <param name="localID"></param> | 929 | /// <param name="localID"></param> |
930 | /// <param name="position"></param> | 930 | /// <param name="position"></param> |
931 | /// <param name="velocity"></param> | 931 | /// <param name="velocity"></param> |
932 | public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity) | 932 | public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity, LLQuaternion rotation) |
933 | { | 933 | { |
934 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = this.CreateAvatarImprovedBlock(localID, position, velocity); | 934 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = this.CreateAvatarImprovedBlock(localID, position, velocity, rotation); |
935 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); | 935 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); |
936 | terse.RegionData.RegionHandle = regionHandle; | 936 | terse.RegionData.RegionHandle = regionHandle; |
937 | terse.RegionData.TimeDilation = timeDilation; | 937 | terse.RegionData.TimeDilation = timeDilation; |
@@ -1018,7 +1018,7 @@ namespace OpenSim.Region.ClientStack | |||
1018 | 1018 | ||
1019 | #region Helper Methods | 1019 | #region Helper Methods |
1020 | 1020 | ||
1021 | protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateAvatarImprovedBlock(uint localID, LLVector3 pos, LLVector3 velocity) | 1021 | protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateAvatarImprovedBlock(uint localID, LLVector3 pos, LLVector3 velocity, LLQuaternion rotation) |
1022 | { | 1022 | { |
1023 | byte[] bytes = new byte[60]; | 1023 | byte[] bytes = new byte[60]; |
1024 | int i = 0; | 1024 | int i = 0; |
@@ -1073,15 +1073,22 @@ namespace OpenSim.Region.ClientStack | |||
1073 | bytes[i++] = (byte)(ac % 256); | 1073 | bytes[i++] = (byte)(ac % 256); |
1074 | bytes[i++] = (byte)((ac >> 8) % 256); | 1074 | bytes[i++] = (byte)((ac >> 8) % 256); |
1075 | 1075 | ||
1076 | //rotation | ||
1077 | ushort rw, rx, ry, rz; | ||
1078 | rw = (ushort)(32768 * (rotation.W + 1)); | ||
1079 | rx = (ushort)(32768 * (rotation.X + 1)); | ||
1080 | ry = (ushort)(32768 * (rotation.Y + 1)); | ||
1081 | rz = (ushort)(32768 * (rotation.Z + 1)); | ||
1082 | |||
1076 | //rot | 1083 | //rot |
1077 | bytes[i++] = (byte)(ac % 256); | 1084 | bytes[i++] = (byte)(rx % 256); |
1078 | bytes[i++] = (byte)((ac >> 8) % 256); | 1085 | bytes[i++] = (byte)((rx >> 8) % 256); |
1079 | bytes[i++] = (byte)(ac % 256); | 1086 | bytes[i++] = (byte)(ry % 256); |
1080 | bytes[i++] = (byte)((ac >> 8) % 256); | 1087 | bytes[i++] = (byte)((ry >> 8) % 256); |
1081 | bytes[i++] = (byte)(ac % 256); | 1088 | bytes[i++] = (byte)(rz % 256); |
1082 | bytes[i++] = (byte)((ac >> 8) % 256); | 1089 | bytes[i++] = (byte)((rz >> 8) % 256); |
1083 | bytes[i++] = (byte)(ac % 256); | 1090 | bytes[i++] = (byte)(rw % 256); |
1084 | bytes[i++] = (byte)((ac >> 8) % 256); | 1091 | bytes[i++] = (byte)((rw >> 8) % 256); |
1085 | 1092 | ||
1086 | //rotation vel | 1093 | //rotation vel |
1087 | bytes[i++] = (byte)(ac % 256); | 1094 | bytes[i++] = (byte)(ac % 256); |