Mercurial > mm7
comparison stru10.cpp @ 678:35a97ce58790
fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
author | Nomad |
---|---|
date | Fri, 15 Mar 2013 15:58:18 +0200 |
parents | ecfb1b3c9a39 |
children | 0f25d026acfa |
comparison
equal
deleted
inserted
replaced
677:551f74425b17 | 678:35a97ce58790 |
---|---|
597 //_ECX = pFaceBounding; | 597 //_ECX = pFaceBounding; |
598 //__asm { fld 0.5 } | 598 //__asm { fld 0.5 } |
599 if (pFace->uAttributes & 0x0100) | 599 if (pFace->uAttributes & 0x0100) |
600 { | 600 { |
601 /*arg_4 = ([2].x + [0].x) * flt_4D84F0 | 601 /*arg_4 = ([2].x + [0].x) * flt_4D84F0 |
602 var_18 = ([3].y + [1].y) * flt_4D84F0 | 602 var_18 = ([3].y + [1].y) * flt_4D84F0 |
603 | 603 |
604 fld dword ptr [ecx+94h] | 604 fld dword ptr [ecx+94h] |
605 fadd dword ptr [ecx+34h] | 605 fadd dword ptr [ecx+34h] |
606 fmul st, st(1) | 606 fmul st, st(1) |
607 fstp [ebp+var_18] | 607 fstp [ebp+var_18] |
664 } | 664 } |
665 | 665 |
666 //_EBX = arg0; | 666 //_EBX = arg0; |
667 //v15 = v31; | 667 //v15 = v31; |
668 //v16 = arg0; | 668 //v16 = arg0; |
669 float var_20 = var_8 * var_24; | 669 //float var_20 = var_8 * var_24; |
670 var_8 = a3 * a1.z; | 670 //var_8 = a3 * a1.z; |
671 float arg_0 = var_8 + var_4; | 671 //float arg_0 = var_8 + var_4; |
672 | |
673 /* | |
674 | |
675 | |
676 | |
677 .text:0049CBB3 fld [ebp+var_8] 0 var8 | |
678 .text:0049CBB6 1 fmul ds:flt_4D84E8 0 var8 * flt_4D84E8 | |
679 | |
680 .text:0049CBBC 1 fld [ebp+var_8] 0 var8 | |
681 1 var8 * flt_4D84E8 | |
682 | |
683 .text:0049CBBF 2 fmul [ebp+var_28] 0 var8 * var28 | |
684 1 var8 * flt_4D84E8 | |
685 | |
686 .text:0049CBC2 2 fld [ebp+var_8] 0 var8 | |
687 1 var8 * var28 | |
688 2 var8 * flt_4D84E8 | |
689 | |
690 .text:0049CBC5 3 fmul [ebp+var_24] 0 var8 * var24 768 | |
691 1 var8 * var28 0 | |
692 2 var8 * flt_4D84E8 0 | |
693 | |
694 .text:0049CBD5 3 fst [ebp+var_20] 0 var8 * var24 768 | |
695 1 var8 * var28 0 | |
696 2 var8 * flt_4D84E8 0 | |
697 [var20] var8 * var24 768 | |
698 | |
699 .text:0049CBD8 3 fld [ebp+a3] 0 a3 -1984 | |
700 1 var8 * var24 768 | |
701 2 var8 * var28 0 | |
702 3 var8 * flt_4D84E8 0 | |
703 | |
704 .text:0049CBDB 4 fmul [ebp+a1.x] 0 a3 * a1.x 1984 | |
705 1 var8 * var24 768 | |
706 2 var8 * var28 0 | |
707 3 var8 * flt_4D84E8 0 | |
708 | |
709 .text:0049CBDE 4 fld [ebp+a3] 0 a3 | |
710 1 a3 * a1.x 1984 | |
711 2 var8 * var24 768 | |
712 3 var8 * var28 0 | |
713 4 var8 * flt_4D84E8 0 | |
714 | |
715 .text:0049CBE1 5 fmul [ebp+a1.y] 0 a3 * a1.y 0 | |
716 1 a3 * a1.x 1984 | |
717 2 var8 * var24 768 | |
718 3 var8 * var28 0 | |
719 4 var8 * flt_4D84E8 0 | |
720 .text:0049CBE4 5 fld [ebp+a3] | |
721 .text:0049CBE7 6 fmul [ebp+a1.z] 0 a3 * a1.z 0 | |
722 1 a3 * a1.y 0 | |
723 2 a3 * a1.x 1984 | |
724 3 var8 * var24 768 | |
725 4 var8 * var28 0 | |
726 5 var8 * flt_4D84E8 0 | |
727 | |
728 .text:0049CBEC 6 fstp [ebp+var_8] | |
729 var8 <- a3 * a1.z 0 | |
730 | |
731 .text:0049CBEF 5 fld [ebp+arg4] 0 arg4 -1700 | |
732 1 a3 * a1.y 0 | |
733 2 a3 * a1.x 1984 | |
734 3 var8 * var24 768 | |
735 4 var8 * var28 0 | |
736 5 var8 * flt_4D84E8 0 | |
737 | |
738 .text:0049CBF2 6 fsub st, st(2) 0 arg4 - a3 * a1.x -3684 | |
739 1 a3 * a1.y 0 | |
740 2 a3 * a1.x 1984 | |
741 3 var8 * var24 768 | |
742 4 var8 * var28 0 | |
743 5 var8 * flt_4D84E8 0 | |
744 | |
745 .text:0049CBF4 6 fld st 0 arg4 - a3 * a1.x -3684 | |
746 1 arg4 - a3 * a1.x -3684 | |
747 2 a3 * a1.y 0 | |
748 3 a3 * a1.x 1984 | |
749 4 var8 * var24 768 | |
750 5 var8 * var28 0 | |
751 6 var8 * flt_4D84E8 0 | |
752 | |
753 .text:0049CBF6 7 fadd st, st(6) 0 arg4 - a3 * a1.x + var8 * flt_4D84E8 -3684 | |
754 1 arg4 - a3 * a1.x -3684 | |
755 2 a3 * a1.y 0 | |
756 3 a3 * a1.x 1984 | |
757 4 var8 * var24 768 | |
758 5 var8 * var28 0 | |
759 6 var8 * flt_4D84E8 0 | |
760 .text:0049CBF8 7 fstp dword ptr [ebx] | |
761 [0].x <- arg4 - a3 * a1.x + var8 * flt_4D84E8 -3684 | |
762 | |
763 .text:0049CBFA 6 fld [ebp+var_18] 0 var18 1480 | |
764 1 arg4 - a3 * a1.x -3684 | |
765 2 a3 * a1.y 0 | |
766 3 a3 * a1.x 1984 | |
767 4 var8 * var24 768 | |
768 5 var8 * var28 0 | |
769 6 var8 * flt_4D84E8 0 | |
770 | |
771 .text:0049CBFD 7 fsub st, st(2) 0 var18 - a3 * a1.y 1480 | |
772 1 arg4 - a3 * a1.x -3684 | |
773 2 a3 * a1.y 0 | |
774 3 a3 * a1.x 1984 | |
775 4 var8 * var24 768 | |
776 5 var8 * var28 0 | |
777 6 var8 * flt_4D84E8 0 | |
778 | |
779 .text:0049CBFF 7 fld st 0 var18 - a3 * a1.y 1480 | |
780 1 var18 - a3 * a1.y 1480 | |
781 2 arg4 - a3 * a1.x -3684 | |
782 3 a3 * a1.y 0 | |
783 4 a3 * a1.x 1984 | |
784 5 var8 * var24 768 | |
785 6 var8 * var28 0 | |
786 7 var8 * flt_4D84E8 0 | |
787 | |
788 .text:0049CC01 8 fadd st, st(6) 0 var18 - a3 * a1.y + var8 * var28 1480 | |
789 1 var18 - a3 * a1.y 1480 | |
790 2 arg4 - a3 * a1.x -3684 | |
791 3 a3 * a1.y 0 | |
792 4 a3 * a1.x 1984 | |
793 5 var8 * var24 768 | |
794 6 var8 * var28 0 | |
795 7 var8 * flt_4D84E8 0 | |
796 | |
797 .text:0049CC03 8 fstp dword ptr [ebx+4] | |
798 [0].y <- var18 - a3 * a1.y + var8 * var28 1480 | |
799 | |
800 .text:0049CC06 7 fld [ebp+var_4] | |
801 .text:0049CC09 8 fsub [ebp+var_8] 0 var4 - a3 * a1.z 768 | |
802 1 var18 - a3 * a1.y 1480 | |
803 2 arg4 - a3 * a1.x -3684 | |
804 3 a3 * a1.y 0 | |
805 4 a3 * a1.x 1984 | |
806 5 var8 * var24 768 | |
807 6 var8 * var28 0 | |
808 7 var8 * flt_4D84E8 0 | |
809 .text:0049CC0C 8 fst [ebp+a3] | |
810 a3 <- var4 - a3 * a1.z 768 | |
811 | |
812 .text:0049CC0F 8 fadd st, st(5) | |
813 .text:0049CC11 8 fstp dword ptr [ebx+8] | |
814 [0].z <- var4 - a3 * a1.z + var8 * var24 1536 | |
815 | |
816 0 var18 - a3 * a1.y 1480 | |
817 1 arg4 - a3 * a1.x -3684 | |
818 2 a3 * a1.y 0 | |
819 3 a3 * a1.x 1984 | |
820 4 var8 * var24 768 | |
821 5 var8 * var28 0 | |
822 6 var8 * flt_4D84E8 0 | |
823 | |
824 | |
825 | |
826 | |
827 [var20] var8 * var24 768 | |
828 [var8] a3 * a1.z | |
829 [a3] var4 - a3 * a1.z 768 | |
830 | |
831 | |
832 .text:0049CC14 7 fld st(1) | |
833 .text:0049CC16 8 fsub st, st(7) 0 arg4 - a3 * a1.x - var8 * flt_4D84E8 -3684 | |
834 1 var18 - a3 * a1.y 1480 | |
835 2 arg4 - a3 * a1.x -3684 | |
836 3 a3 * a1.y 0 | |
837 4 a3 * a1.x 1984 | |
838 5 var8 * var24 768 | |
839 6 var8 * var28 0 | |
840 7 var8 * flt_4D84E8 0 | |
841 .text:0049CC18 8 fstp dword ptr [ebx+30h] | |
842 [1].x <- arg4 - a3 * a1.x - var8 * flt_4D84E8 -3684 | |
843 | |
844 0 var18 - a3 * a1.y 1480 | |
845 1 arg4 - a3 * a1.x -3684 | |
846 2 a3 * a1.y 0 | |
847 3 a3 * a1.x 1984 | |
848 4 var8 * var24 768 | |
849 5 var8 * var28 0 | |
850 6 var8 * flt_4D84E8 0 | |
851 .text:0049CC1B 7 fsub st, st(5) | |
852 .text:0049CC1D 7 fstp dword ptr [ebx+34h] | |
853 [1].y <- var18 - a3 * a1.y - var8 * var28 1480 | |
854 .text:0049CC20 6 fstp st | |
855 0 a3 * a1.y 0 | |
856 1 a3 * a1.x 1984 | |
857 2 var8 * var24 768 | |
858 3 var8 * var28 0 | |
859 4 var8 * flt_4D84E8 0 | |
860 | |
861 | |
862 [var20] var8 * var24 768 | |
863 [var8] a3 * a1.z | |
864 [a3] var4 - a3 * a1.z 768 | |
865 | |
866 .text:0049CC22 5 fld [ebp+a3] 0 var4 - a3 * a1.z 768 | |
867 1 a3 * a1.y 0 | |
868 2 a3 * a1.x 1984 | |
869 3 var8 * var24 768 | |
870 4 var8 * var28 0 | |
871 5 var8 * flt_4D84E8 0 | |
872 .text:0049CC25 6 fsub st, st(3) | |
873 .text:0049CC27 6 fstp dword ptr [ebx+38h] | |
874 [1].z <- var4 - a3 * a1.z - var8 * var24 768 - 768 = 0 | |
875 | |
876 0 a3 * a1.y 0 | |
877 1 a3 * a1.x 1984 | |
878 2 var8 * var24 768 | |
879 3 var8 * var28 0 | |
880 4 var8 * flt_4D84E8 0 | |
881 | |
882 | |
883 .text:0049CC2A fld st(1) | |
884 .text:0049CC2C 6 fadd [ebp+arg4] 0 arg4 + a3 * a1.x 284 | |
885 1 a3 * a1.y 0 | |
886 2 a3 * a1.x 1984 | |
887 3 var8 * var24 768 | |
888 4 var8 * var28 0 | |
889 5 var8 * flt_4D84E8 0 | |
890 .text:0049CC2F 6 fst [ebp+a3] | |
891 | |
892 [var20] var8 * var24 768 | |
893 [var8] a3 * a1.z | |
894 [a3] arg4 + a3 * a1.x 284 | |
895 .text:0049CC32 6 fsub st, st(5) | |
896 .text:0049CC34 6 fstp dword ptr [ebx+60h] | |
897 [2].x <- arg4 + a3 * a1.x - var8 * flt_4D84E8 284 | |
898 | |
899 0 a3 * a1.y 0 | |
900 1 a3 * a1.x 1984 | |
901 2 var8 * var24 768 | |
902 3 var8 * var28 0 | |
903 4 var8 * flt_4D84E8 0 | |
904 | |
905 .text:0049CC37 5 fadd [ebp+var_18] 0 var18 + a3 * a1.y 1480 | |
906 1 a3 * a1.x 1984 | |
907 2 var8 * var24 768 | |
908 3 var8 * var28 0 | |
909 4 var8 * flt_4D84E8 0 | |
910 | |
911 .text:0049CC3A 5 fstp st(2) 0 a3 * a1.x 1984 | |
912 1 var18 + a3 * a1.y 1480 | |
913 2 var8 * var28 0 | |
914 3 var8 * flt_4D84E8 0 | |
915 | |
916 .text:0049CC3C 4 fstp st 0 var18 + a3 * a1.y 1480 | |
917 1 var8 * var28 0 | |
918 2 var8 * flt_4D84E8 0 | |
919 | |
920 .text:0049CC3E 3 fld st 0 var18 + a3 * a1.y 1480 | |
921 1 var18 + a3 * a1.y 1480 | |
922 2 var8 * var28 0 | |
923 3 var8 * flt_4D84E8 0 | |
924 .text:0049CC40 4 fsub st, st(2) | |
925 .text:0049CC42 4 fstp dword ptr [ebx+64h] | |
926 [2].y <- var18 + a3 * a1.y - var8 * var28 1480 | |
927 | |
928 0 var18 + a3 * a1.y 1480 | |
929 1 var8 * var28 0 | |
930 2 var8 * flt_4D84E8 0 | |
931 | |
932 [var20] var8 * var24 768 | |
933 [var8] a3 * a1.z | |
934 [a3] arg4 + a3 * a1.x 284 | |
935 .text:0049CC45 3 fld [ebp+var_8] | |
936 .text:0049CC48 4 fadd [ebp+var_4] 0 var4 + a3 * a1.z 768 | |
937 1 var18 + a3 * a1.y 1480 | |
938 2 var8 * var28 0 | |
939 3 var8 * flt_4D84E8 0 | |
940 | |
941 .text:0049CC4B 4 fst [ebp+arg0] | |
942 [var20] var8 * var24 768 | |
943 [arg0] var4 + a3 * a1.z 768 | |
944 [var8] a3 * a1.z 0 | |
945 [a3] arg4 + a3 * a1.x 284 | |
946 | |
947 .text:0049CC4E 4 fsub [ebp+var_20] | |
948 .text:0049CC51 4 fstp dword ptr [ebx+68h] | |
949 [2].z <- var4 + a3 * a1.z - var8 * var24 0 | |
950 | |
951 | |
952 | |
953 [var20] var8 * var24 768 | |
954 [arg0] var4 + a3 * a1.z 768 | |
955 [var8] a3 * a1.z 0 | |
956 [a3] arg4 + a3 * a1.x 284 | |
957 | |
958 | |
959 0 var18 + a3 * a1.y 1480 | |
960 1 var8 * var28 0 | |
961 2 var8 * flt_4D84E8 0 | |
962 | |
963 .text:0049CC54 3 fld [ebp+a3] | |
964 .text:0049CC57 4 fadd st, st(3) | |
965 .text:0049CC59 4 fstp dword ptr [ebx+90h] | |
966 [3].x <- arg4 + a3 * a1.x + var8 * flt_4D84E8 284 | |
967 | |
968 .text:0049CC5F 3 fadd st, st(1) | |
969 .text:0049CC61 3 fstp dword ptr [ebx+94h] | |
970 [3].y <- var18 + a3 * a1.y + var8 * var28 1480 | |
971 | |
972 .text:0049CC67 2 fstp st | |
973 .text:0049CC69 1 fstp st | |
974 0 empty | |
975 .text:0049CC6B 0 fld [ebp+arg0] | |
976 .text:0049CC6E 1 fadd [ebp+var_20] | |
977 .text:0049CC71 1 fstp dword ptr [ebx+98h] | |
978 [3].z <- var4 + a3 * a1.z + var8 * var24 1536 | |
979 | |
980 0 empty | |
981 */ | |
672 | 982 |
673 arg0[0].vWorldPosition.x = arg_4 - a3 * a1.x + var_8 * flt_4D84E8; | 983 arg0[0].vWorldPosition.x = arg_4 - a3 * a1.x + var_8 * flt_4D84E8; |
674 arg0[0].vWorldPosition.y = var_18 - a3 * a1.y + var_8 * var_28; | 984 arg0[0].vWorldPosition.y = var_18 - a3 * a1.y + var_8 * var_28; |
675 arg0[0].vWorldPosition.z = var_4 - var_8 + var_8 * var_24; | 985 arg0[0].vWorldPosition.z = var_4 - a3 * a1.z + var_8 * var_24; |
986 | |
676 arg0[1].vWorldPosition.x = arg_4 - a3 * a1.x - var_8 * flt_4D84E8; | 987 arg0[1].vWorldPosition.x = arg_4 - a3 * a1.x - var_8 * flt_4D84E8; |
677 arg0[1].vWorldPosition.y = var_18 - a3 * a1.y - var_8 * var_28; | 988 arg0[1].vWorldPosition.y = var_18 - a3 * a1.y - var_8 * var_28; |
678 arg0[1].vWorldPosition.z = (var_4 - var_8) - var_8 * var_24; | 989 arg0[1].vWorldPosition.z = var_4 - a3 * a1.z - var_8 * var_24; |
679 arg0[2].vWorldPosition.x = a3 * a1.x + arg_4 - var_8 * flt_4D84E8; | 990 |
680 arg0[2].vWorldPosition.y = a3 * a1.y + var_18 - var_8 * var_28; | 991 arg0[2].vWorldPosition.x = arg_4 + a3 * a1.x - var_8 * flt_4D84E8; |
681 arg0[2].vWorldPosition.z = var_8 + var_4 - var_20; | 992 arg0[2].vWorldPosition.y = var_18 + a3 * a1.y - var_8 * var_28; |
682 arg0[3].vWorldPosition.x = (a3 * a1.x + arg_4) + var_8 * flt_4D84E8; | 993 arg0[2].vWorldPosition.z = var_4 + a3 * a1.z - var_8 * var_24; |
683 arg0[3].vWorldPosition.y = a3 * a1.y + var_18 + var_8 * var_28; | 994 |
684 arg0[3].vWorldPosition.z = arg_0 + var_20; | 995 arg0[3].vWorldPosition.x = arg_4 + a3 * a1.x + var_8 * flt_4D84E8; |
685 | 996 arg0[3].vWorldPosition.y = var_18 + a3 * a1.y + var_8 * var_28; |
686 a3 = (var_4 - var_8); | 997 arg0[3].vWorldPosition.z = var_4 + a3 * a1.z + var_8 * var_24; |
687 a3 = (a3 * a1.x + arg_4); | 998 |
688 | 999 |
689 a1.x = 0.0f; | 1000 a1.x = 0.0f; |
690 a1.y = 0.0f; | 1001 a1.y = 0.0f; |
691 a1.z = 0.0f; | 1002 a1.z = 0.0f; |
1003 a3 = arg_4 + a3 * a1.x; | |
692 | 1004 |
693 if (!_49C8DC(arg0, &a1, &a3)) | 1005 if (!_49C8DC(arg0, &a1, &a3)) |
694 return false; | 1006 return false; |
695 | 1007 |
696 | 1008 |