diff options
author | Sean Dague | 2008-05-07 14:41:59 +0000 |
---|---|---|
committer | Sean Dague | 2008-05-07 14:41:59 +0000 |
commit | 4999b00294219ebdda7afd29b6d54ba2056cc161 (patch) | |
tree | 7636ed5affc95a026970a3df98a84e2f28934ba1 /OpenSim | |
parent | From: Alan M Webb <awebb@vnet.ibm.com> (diff) | |
download | opensim-SC-4999b00294219ebdda7afd29b6d54ba2056cc161.zip opensim-SC-4999b00294219ebdda7afd29b6d54ba2056cc161.tar.gz opensim-SC-4999b00294219ebdda7afd29b6d54ba2056cc161.tar.bz2 opensim-SC-4999b00294219ebdda7afd29b6d54ba2056cc161.tar.xz |
attempted fix of http://opensimulator.org/mantis/view.php?id=1166. This
is currently untested and may result in weirdness. Beware this changeset.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 113 |
1 files changed, 66 insertions, 47 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index d183f4a..95801b9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -2601,37 +2601,50 @@ 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[] pb = position.GetBytes(); | 2604 | byte[] buff = position.GetBytes(); |
2605 | Array.Copy(pb, 0, bytes, i, pb.Length); | 2605 | Array.Copy(buff, 0, bytes, i, buff.Length); |
2606 | i += 12; | 2606 | i += 12; |
2607 | ushort ac = 32767; | ||
2608 | 2607 | ||
2609 | ushort velx, vely, velz; | 2608 | buff = velocity.GetBytes(); |
2610 | Vector3 vel = new Vector3(velocity.X, velocity.Y, velocity.Z); | 2609 | Array.Copy(buff, 0, bytes, i, buff.Length); |
2611 | 2610 | i += 12; | |
2612 | vel = vel / 128.0f; | 2611 | |
2613 | vel.x += 1; | 2612 | // this should be real value |
2614 | vel.y += 1; | 2613 | LLVector3 accel = new LLVector3(0, 0 ,0); |
2615 | vel.z += 1; | 2614 | buff = accel.GetBytes(); |
2616 | //vel | 2615 | Array.Copy(buff, 0, bytes, i, buff.Length); |
2617 | velx = (ushort)(32768 * (vel.x)); | 2616 | i += 12; |
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); | ||
2627 | 2617 | ||
2628 | //accel | 2618 | |
2629 | bytes[i++] = (byte)(ac % 256); | 2619 | |
2630 | bytes[i++] = (byte)((ac >> 8) % 256); | 2620 | // ushort ac = 32767; |
2631 | bytes[i++] = (byte)(ac % 256); | 2621 | |
2632 | bytes[i++] = (byte)((ac >> 8) % 256); | 2622 | // ushort velx, vely, velz; |
2633 | bytes[i++] = (byte)(ac % 256); | 2623 | // Vector3 vel = new Vector3(velocity.X, velocity.Y, velocity.Z); |
2634 | bytes[i++] = (byte)((ac >> 8) % 256); | 2624 | |
2625 | // vel = vel / 128.0f; | ||
2626 | // vel.x += 1; | ||
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); | ||
2635 | 2648 | ||
2636 | ushort rw, rx, ry, rz; | 2649 | ushort rw, rx, ry, rz; |
2637 | rw = (ushort)(32768 * (rotation.W + 1)); | 2650 | rw = (ushort)(32768 * (rotation.W + 1)); |
@@ -2649,25 +2662,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2649 | bytes[i++] = (byte)(rw % 256); | 2662 | bytes[i++] = (byte)(rw % 256); |
2650 | bytes[i++] = (byte)((rw >> 8) % 256); | 2663 | bytes[i++] = (byte)((rw >> 8) % 256); |
2651 | 2664 | ||
2652 | //rotation vel | 2665 | // //rotation vel |
2653 | ushort rvelx, rvely, rvelz; | 2666 | // ushort rvelx, rvely, rvelz; |
2654 | Vector3 rvel = new Vector3(rotationalvelocity.X, rotationalvelocity.Y, rotationalvelocity.Z); | 2667 | // Vector3 rvel = new Vector3(rotationalvelocity.X, rotationalvelocity.Y, rotationalvelocity.Z); |
2655 | 2668 | ||
2656 | rvel = rvel / 128.0f; | 2669 | // rvel = rvel / 128.0f; |
2657 | rvel.x += 1; | 2670 | // rvel.x += 1; |
2658 | rvel.y += 1; | 2671 | // rvel.y += 1; |
2659 | rvel.z += 1; | 2672 | // rvel.z += 1; |
2660 | //vel | 2673 | // //vel |
2661 | rvelx = (ushort)(32768 * (rvel.x)); | 2674 | // rvelx = (ushort)(32768 * (rvel.x)); |
2662 | rvely = (ushort)(32768 * (rvel.y)); | 2675 | // rvely = (ushort)(32768 * (rvel.y)); |
2663 | rvelz = (ushort)(32768 * (rvel.z)); | 2676 | // rvelz = (ushort)(32768 * (rvel.z)); |
2664 | 2677 | ||
2665 | bytes[i++] = (byte)(rvelx % 256); | 2678 | // bytes[i++] = (byte)(rvelx % 256); |
2666 | bytes[i++] = (byte)((rvelx >> 8) % 256); | 2679 | // bytes[i++] = (byte)((rvelx >> 8) % 256); |
2667 | bytes[i++] = (byte)(rvely % 256); | 2680 | // bytes[i++] = (byte)(rvely % 256); |
2668 | bytes[i++] = (byte)((rvely >> 8) % 256); | 2681 | // bytes[i++] = (byte)((rvely >> 8) % 256); |
2669 | bytes[i++] = (byte)(rvelz % 256); | 2682 | // bytes[i++] = (byte)(rvelz % 256); |
2670 | bytes[i++] = (byte)((rvelz >> 8) % 256); | 2683 | // 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 | |||
2671 | dat.Data = bytes; | 2690 | dat.Data = bytes; |
2672 | 2691 | ||
2673 | 2692 | ||