aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/ClientView.API.cs
diff options
context:
space:
mode:
authorTeravus Ovares2007-11-08 00:10:40 +0000
committerTeravus Ovares2007-11-08 00:10:40 +0000
commit9e9dad1cde362de093d0d7e6c3e247ff00ceac96 (patch)
tree72b364a18532ee152cfbd72df0158b8a2e001464 /OpenSim/Region/ClientStack/ClientView.API.cs
parentset svn:eol-style (diff)
downloadopensim-SC-9e9dad1cde362de093d0d7e6c3e247ff00ceac96.zip
opensim-SC-9e9dad1cde362de093d0d7e6c3e247ff00ceac96.tar.gz
opensim-SC-9e9dad1cde362de093d0d7e6c3e247ff00ceac96.tar.bz2
opensim-SC-9e9dad1cde362de093d0d7e6c3e247ff00ceac96.tar.xz
* Added Rotational Velocity reporting for Client Interpolation to Terse Updates
* Added Angular Velocity reporting for smooth-ish rotations on object collisions
Diffstat (limited to 'OpenSim/Region/ClientStack/ClientView.API.cs')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs33
1 files changed, 23 insertions, 10 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index bbe07d2..14e1b39 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -1062,23 +1062,24 @@ namespace OpenSim.Region.ClientStack
1062 LLQuaternion rotation) 1062 LLQuaternion rotation)
1063 { 1063 {
1064 LLVector3 velocity = new LLVector3(0f,0f,0f); 1064 LLVector3 velocity = new LLVector3(0f,0f,0f);
1065 LLVector3 rotationalvelocity = new LLVector3(0f,0f,0f);
1065 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 1066 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
1066 terse.RegionData.RegionHandle = regionHandle; 1067 terse.RegionData.RegionHandle = regionHandle;
1067 terse.RegionData.TimeDilation = timeDilation; 1068 terse.RegionData.TimeDilation = timeDilation;
1068 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 1069 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
1069 terse.ObjectData[0] = CreatePrimImprovedBlock(localID, position, rotation, velocity); 1070 terse.ObjectData[0] = CreatePrimImprovedBlock(localID, position, rotation, velocity, rotationalvelocity);
1070 1071
1071 OutPacket(terse); 1072 OutPacket(terse);
1072 } 1073 }
1073 public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, 1074 public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
1074 LLQuaternion rotation, LLVector3 velocity) 1075 LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity)
1075 { 1076 {
1076 1077
1077 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 1078 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
1078 terse.RegionData.RegionHandle = regionHandle; 1079 terse.RegionData.RegionHandle = regionHandle;
1079 terse.RegionData.TimeDilation = timeDilation; 1080 terse.RegionData.TimeDilation = timeDilation;
1080 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 1081 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
1081 terse.ObjectData[0] = CreatePrimImprovedBlock(localID, position, rotation, velocity); 1082 terse.ObjectData[0] = CreatePrimImprovedBlock(localID, position, rotation, velocity, rotationalvelocity);
1082 1083
1083 OutPacket(terse); 1084 OutPacket(terse);
1084 } 1085 }
@@ -1184,7 +1185,7 @@ namespace OpenSim.Region.ClientStack
1184 /// <returns></returns> 1185 /// <returns></returns>
1185 protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreatePrimImprovedBlock(uint localID, 1186 protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreatePrimImprovedBlock(uint localID,
1186 LLVector3 position, 1187 LLVector3 position,
1187 LLQuaternion rotation, LLVector3 velocity) 1188 LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity)
1188 { 1189 {
1189 uint ID = localID; 1190 uint ID = localID;
1190 byte[] bytes = new byte[60]; 1191 byte[] bytes = new byte[60];
@@ -1248,12 +1249,24 @@ namespace OpenSim.Region.ClientStack
1248 bytes[i++] = (byte) ((rw >> 8)%256); 1249 bytes[i++] = (byte) ((rw >> 8)%256);
1249 1250
1250 //rotation vel 1251 //rotation vel
1251 bytes[i++] = (byte) (ac%256); 1252 ushort rvelx, rvely, rvelz;
1252 bytes[i++] = (byte) ((ac >> 8)%256); 1253 Vector3 rvel = new Vector3(rotationalvelocity.X, rotationalvelocity.Y, rotationalvelocity.Z);
1253 bytes[i++] = (byte) (ac%256); 1254
1254 bytes[i++] = (byte) ((ac >> 8)%256); 1255 rvel = rvel / 128.0f;
1255 bytes[i++] = (byte) (ac%256); 1256 rvel.x += 1;
1256 bytes[i++] = (byte) ((ac >> 8)%256); 1257 rvel.y += 1;
1258 rvel.z += 1;
1259 //vel
1260 rvelx = (ushort)(32768 * (rvel.x));
1261 rvely = (ushort)(32768 * (rvel.y));
1262 rvelz = (ushort)(32768 * (rvel.z));
1263
1264 bytes[i++] = (byte)(rvelx % 256);
1265 bytes[i++] = (byte)((rvelx >> 8) % 256);
1266 bytes[i++] = (byte)(rvely % 256);
1267 bytes[i++] = (byte)((rvely >> 8) % 256);
1268 bytes[i++] = (byte)(rvelz % 256);
1269 bytes[i++] = (byte)((rvelz >> 8) % 256);
1257 1270
1258 dat.Data = bytes; 1271 dat.Data = bytes;
1259 return dat; 1272 return dat;