aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSean Dague2008-05-07 15:01:02 +0000
committerSean Dague2008-05-07 15:01:02 +0000
commit3792827cf37a5136eedacdf0cee6f29896527025 (patch)
treefa263f5a5c4ee035e156990679fa56a1880fcc3c
parentattempted fix of http://opensimulator.org/mantis/view.php?id=1166. This (diff)
downloadopensim-SC_OLD-3792827cf37a5136eedacdf0cee6f29896527025.zip
opensim-SC_OLD-3792827cf37a5136eedacdf0cee6f29896527025.tar.gz
opensim-SC_OLD-3792827cf37a5136eedacdf0cee6f29896527025.tar.bz2
opensim-SC_OLD-3792827cf37a5136eedacdf0cee6f29896527025.tar.xz
revert 4546, I definitely didn't understand what I was doing here
and awebb says he's close to a functional patch for 1166
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs113
1 files changed, 47 insertions, 66 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 95801b9..d183f4a 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2601,50 +2601,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2601 bytes[i++] = state; 2601 bytes[i++] = state;
2602 bytes[i++] = 0; 2602 bytes[i++] = 0;
2603 2603
2604 byte[] buff = position.GetBytes(); 2604 byte[] pb = position.GetBytes();
2605 Array.Copy(buff, 0, bytes, i, buff.Length); 2605 Array.Copy(pb, 0, bytes, i, pb.Length);
2606 i += 12;
2607
2608 buff = velocity.GetBytes();
2609 Array.Copy(buff, 0, bytes, i, buff.Length);
2610 i += 12;
2611
2612 // this should be real value
2613 LLVector3 accel = new LLVector3(0, 0 ,0);
2614 buff = accel.GetBytes();
2615 Array.Copy(buff, 0, bytes, i, buff.Length);
2616 i += 12; 2606 i += 12;
2607 ushort ac = 32767;
2617 2608
2618 2609 ushort velx, vely, velz;
2610 Vector3 vel = new Vector3(velocity.X, velocity.Y, velocity.Z);
2611
2612 vel = vel / 128.0f;
2613 vel.x += 1;
2614 vel.y += 1;
2615 vel.z += 1;
2616 //vel
2617 velx = (ushort)(32768 * (vel.x));
2618 vely = (ushort)(32768 * (vel.y));
2619 velz = (ushort)(32768 * (vel.z));
2620
2621 bytes[i++] = (byte)(velx % 256);
2622 bytes[i++] = (byte)((velx >> 8) % 256);
2623 bytes[i++] = (byte)(vely % 256);
2624 bytes[i++] = (byte)((vely >> 8) % 256);
2625 bytes[i++] = (byte)(velz % 256);
2626 bytes[i++] = (byte)((velz >> 8) % 256);
2619 2627
2620 // ushort ac = 32767; 2628 //accel
2621 2629 bytes[i++] = (byte)(ac % 256);
2622 // ushort velx, vely, velz; 2630 bytes[i++] = (byte)((ac >> 8) % 256);
2623 // Vector3 vel = new Vector3(velocity.X, velocity.Y, velocity.Z); 2631 bytes[i++] = (byte)(ac % 256);
2624 2632 bytes[i++] = (byte)((ac >> 8) % 256);
2625 // vel = vel / 128.0f; 2633 bytes[i++] = (byte)(ac % 256);
2626 // vel.x += 1; 2634 bytes[i++] = (byte)((ac >> 8) % 256);
2627 // vel.y += 1;
2628 // vel.z += 1;
2629 // //vel
2630 // velx = (ushort)(32768 * (vel.x));
2631 // vely = (ushort)(32768 * (vel.y));
2632 // velz = (ushort)(32768 * (vel.z));
2633
2634 // bytes[i++] = (byte)(velx % 256);
2635 // bytes[i++] = (byte)((velx >> 8) % 256);
2636 // bytes[i++] = (byte)(vely % 256);
2637 // bytes[i++] = (byte)((vely >> 8) % 256);
2638 // bytes[i++] = (byte)(velz % 256);
2639 // bytes[i++] = (byte)((velz >> 8) % 256);
2640
2641 // //accel
2642 // bytes[i++] = (byte)(ac % 256);
2643 // bytes[i++] = (byte)((ac >> 8) % 256);
2644 // bytes[i++] = (byte)(ac % 256);
2645 // bytes[i++] = (byte)((ac >> 8) % 256);
2646 // bytes[i++] = (byte)(ac % 256);
2647 // bytes[i++] = (byte)((ac >> 8) % 256);
2648 2635
2649 ushort rw, rx, ry, rz; 2636 ushort rw, rx, ry, rz;
2650 rw = (ushort)(32768 * (rotation.W + 1)); 2637 rw = (ushort)(32768 * (rotation.W + 1));
@@ -2662,31 +2649,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2662 bytes[i++] = (byte)(rw % 256); 2649 bytes[i++] = (byte)(rw % 256);
2663 bytes[i++] = (byte)((rw >> 8) % 256); 2650 bytes[i++] = (byte)((rw >> 8) % 256);
2664 2651
2665 // //rotation vel 2652 //rotation vel
2666 // ushort rvelx, rvely, rvelz; 2653 ushort rvelx, rvely, rvelz;
2667 // Vector3 rvel = new Vector3(rotationalvelocity.X, rotationalvelocity.Y, rotationalvelocity.Z); 2654 Vector3 rvel = new Vector3(rotationalvelocity.X, rotationalvelocity.Y, rotationalvelocity.Z);
2668 2655
2669 // rvel = rvel / 128.0f; 2656 rvel = rvel / 128.0f;
2670 // rvel.x += 1; 2657 rvel.x += 1;
2671 // rvel.y += 1; 2658 rvel.y += 1;
2672 // rvel.z += 1; 2659 rvel.z += 1;
2673 // //vel 2660 //vel
2674 // rvelx = (ushort)(32768 * (rvel.x)); 2661 rvelx = (ushort)(32768 * (rvel.x));
2675 // rvely = (ushort)(32768 * (rvel.y)); 2662 rvely = (ushort)(32768 * (rvel.y));
2676 // rvelz = (ushort)(32768 * (rvel.z)); 2663 rvelz = (ushort)(32768 * (rvel.z));
2677 2664
2678 // bytes[i++] = (byte)(rvelx % 256); 2665 bytes[i++] = (byte)(rvelx % 256);
2679 // bytes[i++] = (byte)((rvelx >> 8) % 256); 2666 bytes[i++] = (byte)((rvelx >> 8) % 256);
2680 // bytes[i++] = (byte)(rvely % 256); 2667 bytes[i++] = (byte)(rvely % 256);
2681 // bytes[i++] = (byte)((rvely >> 8) % 256); 2668 bytes[i++] = (byte)((rvely >> 8) % 256);
2682 // bytes[i++] = (byte)(rvelz % 256); 2669 bytes[i++] = (byte)(rvelz % 256);
2683 // bytes[i++] = (byte)((rvelz >> 8) % 256); 2670 bytes[i++] = (byte)((rvelz >> 8) % 256);
2684
2685 buff = rotationalvelocity.GetBytes();
2686 Array.Copy(buff, 0, bytes, i, buff.Length);
2687 i += 12;
2688
2689
2690 dat.Data = bytes; 2671 dat.Data = bytes;
2691 2672
2692 2673