aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorSean Dague2008-05-07 19:34:06 +0000
committerSean Dague2008-05-07 19:34:06 +0000
commit30077bf717b9bb8412678006991194794851207f (patch)
treed92c8b2b98d31f95eada910b561e8a0da9accc43 /OpenSim
parentmake prims reliable to see how that effects this update path (diff)
downloadopensim-SC_OLD-30077bf717b9bb8412678006991194794851207f.zip
opensim-SC_OLD-30077bf717b9bb8412678006991194794851207f.tar.gz
opensim-SC_OLD-30077bf717b9bb8412678006991194794851207f.tar.bz2
opensim-SC_OLD-30077bf717b9bb8412678006991194794851207f.tar.xz
ok, reverting the bad packet fill in, going to try this again
slightly differently
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs90
1 files changed, 4 insertions, 86 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index f090682..6fe5cc9 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2069,7 +2069,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2069 2069
2070 public void SendPrimitiveToClient( 2070 public void SendPrimitiveToClient(
2071 ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, 2071 ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape,
2072 LLVector3 pos, LLVector3 velocity, LLVector3 acceleration, LLQuaternion rotation, LLVector3 rotationalvelocity, 2072 LLVector3 pos, LLVector3 vel, LLVector3 acc, LLQuaternion rotation, LLVector3 rvel,
2073 uint flags, 2073 uint flags,
2074 LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, 2074 LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem,
2075 byte clickAction, byte[] textureanim, bool attachment, uint AttachPoint, LLUUID AssetId) 2075 byte clickAction, byte[] textureanim, bool attachment, uint AttachPoint, LLUUID AssetId)
@@ -2085,7 +2085,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2085 outPacket.ObjectData[0].ID = localID; 2085 outPacket.ObjectData[0].ID = localID;
2086 outPacket.ObjectData[0].FullID = objectID; 2086 outPacket.ObjectData[0].FullID = objectID;
2087 outPacket.ObjectData[0].OwnerID = ownerID; 2087 outPacket.ObjectData[0].OwnerID = ownerID;
2088 outPacket.Header.Reliable = true;
2089 2088
2090 // Anything more than 255 will cause libsecondlife to barf 2089 // Anything more than 255 will cause libsecondlife to barf
2091 if (text.Length > 255) 2090 if (text.Length > 255)
@@ -2119,92 +2118,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2119 // Sound Radius 2118 // Sound Radius
2120 outPacket.ObjectData[0].Radius = 20; 2119 outPacket.ObjectData[0].Radius = 20;
2121 2120
2122 int i = 0;
2123 byte[] bytes = new byte[60];
2124 byte[] pb = pos.GetBytes(); 2121 byte[] pb = pos.GetBytes();
2125 Array.Copy(pb, 0, bytes, i, pb.Length); 2122 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
2126 i += 12;
2127 // TODO: this code sucks, and also exists in TerseUpdate.
2128 // Someone should clean it up.
2129
2130 ushort velx, vely, velz;
2131 Vector3 vel = new Vector3(velocity.X, velocity.Y, velocity.Z);
2132
2133 vel = vel / 128.0f;
2134 vel.x += 1;
2135 vel.y += 1;
2136 vel.z += 1;
2137 //vel
2138 velx = (ushort)(32768 * (vel.x));
2139 vely = (ushort)(32768 * (vel.y));
2140 velz = (ushort)(32768 * (vel.z));
2141
2142 bytes[i++] = (byte)(velx % 256);
2143 bytes[i++] = (byte)((velx >> 8) % 256);
2144 bytes[i++] = (byte)(vely % 256);
2145 bytes[i++] = (byte)((vely >> 8) % 256);
2146 bytes[i++] = (byte)(velz % 256);
2147 bytes[i++] = (byte)((velz >> 8) % 256);
2148
2149 //accel
2150 ushort accx, accy, accz;
2151 Vector3 acc = new Vector3(acceleration.X, acceleration.Y, acceleration.Z);
2152 acc = acc / 128.0f;
2153 acc.x += 1;
2154 acc.y += 1;
2155 acc.z += 1;
2156 accx = (ushort)(32768 * (acc.x));
2157 accy = (ushort)(32768 * (acc.y));
2158 accz = (ushort)(32768 * (acc.z));
2159
2160 bytes[i++] = (byte)(accx % 256);
2161 bytes[i++] = (byte)((accx >> 8) % 256);
2162 bytes[i++] = (byte)(accy % 256);
2163 bytes[i++] = (byte)((accy >> 8) % 256);
2164 bytes[i++] = (byte)(accz % 256);
2165 bytes[i++] = (byte)((accz >> 8) % 256);
2166
2167 ushort rw, rx, ry, rz;
2168 rw = (ushort)(32768 * (rotation.W + 1));
2169 rx = (ushort)(32768 * (rotation.X + 1));
2170 ry = (ushort)(32768 * (rotation.Y + 1));
2171 rz = (ushort)(32768 * (rotation.Z + 1));
2172
2173 //rot
2174 bytes[i++] = (byte)(rx % 256);
2175 bytes[i++] = (byte)((rx >> 8) % 256);
2176 bytes[i++] = (byte)(ry % 256);
2177 bytes[i++] = (byte)((ry >> 8) % 256);
2178 bytes[i++] = (byte)(rz % 256);
2179 bytes[i++] = (byte)((rz >> 8) % 256);
2180 bytes[i++] = (byte)(rw % 256);
2181 bytes[i++] = (byte)((rw >> 8) % 256);
2182
2183 //rotation vel
2184 ushort rvelx, rvely, rvelz;
2185 Vector3 rvel = new Vector3(rotationalvelocity.X, rotationalvelocity.Y, rotationalvelocity.Z);
2186
2187 rvel = rvel / 128.0f;
2188 rvel.x += 1;
2189 rvel.y += 1;
2190 rvel.z += 1;
2191 //vel
2192 rvelx = (ushort)(32768 * (rvel.x));
2193 rvely = (ushort)(32768 * (rvel.y));
2194 rvelz = (ushort)(32768 * (rvel.z));
2195
2196 bytes[i++] = (byte)(rvelx % 256);
2197 bytes[i++] = (byte)((rvelx >> 8) % 256);
2198 bytes[i++] = (byte)(rvely % 256);
2199 bytes[i++] = (byte)((rvely >> 8) % 256);
2200 bytes[i++] = (byte)(rvelz % 256);
2201 bytes[i++] = (byte)((rvelz >> 8) % 256);
2202
2203
2204 // byte[] rot = rotation.GetBytes();
2205 // Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 36, rot.Length);
2206 2123
2207 outPacket.ObjectData[0].ObjectData = bytes; 2124 byte[] rot = rotation.GetBytes();
2125 Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 36, rot.Length);
2208 2126
2209 if (textureanim.Length > 0) 2127 if (textureanim.Length > 0)
2210 { 2128 {