comparison Vis.cpp @ 1054:5520fdca7a74

m
author Ritor1
date Wed, 22 May 2013 22:22:36 +0600
parents e4383e6dfbef
children 010a844ef4a0
comparison
equal deleted inserted replaced
1003:9318dd3f3711 1054:5520fdca7a74
364 continue; 364 continue;
365 365
366 auto bmodel = &pOutdoor->pBModels[i]; 366 auto bmodel = &pOutdoor->pBModels[i];
367 for (uint j = 0; j < bmodel->uNumFaces; ++j) 367 for (uint j = 0; j < bmodel->uNumFaces; ++j)
368 { 368 {
369 if ( i == 77 && j == 17 )//
370 __debugbreak();//
369 auto face = &bmodel->pFaces[j]; 371 auto face = &bmodel->pFaces[j];
370 if (is_part_of_selection(face, filter)) 372 if (is_part_of_selection(face, filter))
371 { 373 {
372 BLVFace blv_face; 374 BLVFace blv_face;
373 blv_face.FromODM(face); 375 blv_face.FromODM(face);
543 //----- (004C1C0C) -------------------------------------------------------- 545 //----- (004C1C0C) --------------------------------------------------------
544 bool Vis::Intersect_Ray_Face(RenderVertexSoft *pRayStart, RenderVertexSoft *pRayEnd, float *pDepth, RenderVertexSoft *a4, BLVFace *a5, unsigned int a6) 546 bool Vis::Intersect_Ray_Face(RenderVertexSoft *pRayStart, RenderVertexSoft *pRayEnd, float *pDepth, RenderVertexSoft *a4, BLVFace *a5, unsigned int a6)
545 { 547 {
546 //BLVFace *v7; // ebx@1 548 //BLVFace *v7; // ebx@1
547 //bool result; // eax@1 549 //bool result; // eax@1
548 double v9; // st7@3 550 double c2; // st7@3
549 //__int16 v10; // fps@3 551 //__int16 v10; // fps@3
550 //char v11; // c0@3 552 //char v11; // c0@3
551 //char v12; // c2@3 553 //char v12; // c2@3
552 //char v13; // c3@3 554 //char v13; // c3@3
553 //__int16 v14; // fps@5 555 //__int16 v14; // fps@5
554 //char v15; // c0@5 556 //char v15; // c0@5
555 //char v16; // c2@5 557 //char v16; // c2@5
556 //char v17; // c3@5 558 //char v17; // c3@5
557 double v18; // st5@6 559 double c1; // st5@6
560 double v9;
558 //__int16 v19; // fps@6 561 //__int16 v19; // fps@6
559 //char v20; // c0@6 562 //char v20; // c0@6
560 //char v21; // c2@6 563 //char v21; // c2@6
561 //char v22; // c3@6 564 //char v22; // c3@6
562 //unsigned __int8 v23; // c0@6 565 //unsigned __int8 v23; // c0@6
563 //char v24; // c2@6 566 //char v24; // c2@6
564 //unsigned __int8 v25; // c3@6 567 //unsigned __int8 v25; // c3@6
565 //char v26; // zf@6 568 //char v26; // zf@6
566 double v27; // st6@10 569 double t2; // st6@10
567 //__int16 v28; // fps@10 570 //__int16 v28; // fps@10
568 //unsigned __int8 v29; // c0@10 571 //unsigned __int8 v29; // c0@10
569 //char v30; // c2@10 572 //char v30; // c2@10
570 //unsigned __int8 v31; // c3@10 573 //unsigned __int8 v31; // c3@10
571 //double v32; // st7@11 574 //double v32; // st7@11
572 Vec2_short_ v33; // ST1E_4@11 575 //Vec2_short_ v33; // ST1E_4@11
573 Vec3_short_ v34; // ST04_6@11 576 Vec3_short_ v34; // ST04_6@11
574 //float a5a; // [sp+30h] [bp+18h]@10 577 //float a5a; // [sp+30h] [bp+18h]@10
575 //float a5b; // [sp+30h] [bp+18h]@13 578 //float a5b; // [sp+30h] [bp+18h]@13
576 579
577 if (a5->Portal() || a5->Invisible()) 580 if (a5->Portal() || a5->Invisible())
578 return false; 581 return false;
579 582
580 583
581 int ray_dir_x = pRayEnd->vWorldPosition.x - pRayStart->vWorldPosition.x, 584 int ray_dir_x = pRayEnd->vWorldPosition.x - pRayStart->vWorldPosition.x,//вектор направления
582 ray_dir_y = pRayEnd->vWorldPosition.y - pRayStart->vWorldPosition.y, 585 ray_dir_y = pRayEnd->vWorldPosition.y - pRayStart->vWorldPosition.y,
583 ray_dir_z = pRayEnd->vWorldPosition.z - pRayStart->vWorldPosition.z; 586 ray_dir_z = pRayEnd->vWorldPosition.z - pRayStart->vWorldPosition.z;
584 587
585 v9 = ray_dir_z * a5->pFacePlane.vNormal.z 588 v9 = ray_dir_z * a5->pFacePlane.vNormal.z
586 + ray_dir_y * a5->pFacePlane.vNormal.y 589 + ray_dir_y * a5->pFacePlane.vNormal.y
598 //t = -------------------- 601 //t = --------------------
599 // dir norm 602 // dir norm
600 603
601 604
602 float dir_mag = sqrtf(ray_dir_x * ray_dir_x + ray_dir_y * ray_dir_y + ray_dir_z * ray_dir_z); 605 float dir_mag = sqrtf(ray_dir_x * ray_dir_x + ray_dir_y * ray_dir_y + ray_dir_z * ray_dir_z);
603 float ndir_x = ray_dir_x / dir_mag, 606 float ndir_x = ray_dir_x / dir_mag,//нормализованное направление
604 ndir_y = ray_dir_y / dir_mag, 607 ndir_y = ray_dir_y / dir_mag,
605 ndir_z = ray_dir_z / dir_mag; 608 ndir_z = ray_dir_z / dir_mag;
606 609
607 int face_center_x = (a5->pBounding.x1 + a5->pBounding.x2) / 2, 610 int face_center_x = (a5->pBounding.x1 + a5->pBounding.x2) / 2,//центр фейса
608 face_center_y = (a5->pBounding.y1 + a5->pBounding.y2) / 2, 611 face_center_y = (a5->pBounding.y1 + a5->pBounding.y2) / 2,
609 face_center_z = (a5->pBounding.z1 + a5->pBounding.z2) / 2; 612 face_center_z = (a5->pBounding.z1 + a5->pBounding.z2) / 2;
610 613
611 int to_plane_x = pRayStart->vWorldPosition.x - face_center_x, 614 int to_plane_x = pRayStart->vWorldPosition.x - face_center_x,
612 to_plane_y = pRayStart->vWorldPosition.y - face_center_y, 615 to_plane_y = pRayStart->vWorldPosition.y - face_center_y,
613 to_plane_z = pRayStart->vWorldPosition.z - face_center_z; 616 to_plane_z = pRayStart->vWorldPosition.z - face_center_z;
614 617
615 float t = /*-a5->pFacePlane.dist*/ - (to_plane_x * a5->pFacePlane.vNormal.x + to_plane_y * a5->pFacePlane.vNormal.y + to_plane_y * a5->pFacePlane.vNormal.z) / 618 float t = /*-a5->pFacePlane.dist*/ - (to_plane_x * a5->pFacePlane.vNormal.x + to_plane_y * a5->pFacePlane.vNormal.y + to_plane_y * a5->pFacePlane.vNormal.z) /
616 (ndir_x * a5->pFacePlane.vNormal.x + ndir_y * a5->pFacePlane.vNormal.y + ndir_z * a5->pFacePlane.vNormal.z); 619 (ndir_x * a5->pFacePlane.vNormal.x + ndir_y * a5->pFacePlane.vNormal.y + ndir_z * a5->pFacePlane.vNormal.z);
617 if (t <= *pDepth) 620 /*if (t <= *pDepth)
618 { 621 {
619 int intersection_x = pRayStart->vWorldPosition.x + ndir_x * t, 622 int intersection_x = pRayStart->vWorldPosition.x + ndir_x * t,
620 intersection_y = pRayStart->vWorldPosition.y + ndir_y * t, 623 intersection_y = pRayStart->vWorldPosition.y + ndir_y * t,
621 intersection_z = pRayStart->vWorldPosition.z + ndir_z * t; 624 intersection_z = pRayStart->vWorldPosition.z + ndir_z * t;
622 625
628 a5->uAttributes |= 0x80000000; 631 a5->uAttributes |= 0x80000000;
629 return true; 632 return true;
630 } 633 }
631 634
632 635
633 return false; 636 return false;*/
634 637
635 // v7 = a5; 638 // v7 = a5;
636 //result = a5->uAttributes; 639 //result = a5->uAttributes;
637 v9 = pRayEnd->vWorldPosition.z * a5->pFacePlane.vNormal.z 640
638 + pRayEnd->vWorldPosition.y * a5->pFacePlane.vNormal.y 641 //a5->uAttributes |= 0x80000000;
639 + pRayEnd->vWorldPosition.x * a5->pFacePlane.vNormal.x; 642 //return false;
640 if (v9 >= 0) // ray faces face's normal ( > 0) or parallel ( == 0) 643
644 c1 = -a5->pFacePlane.dist -(a5->pFacePlane.vNormal.x * pRayStart->vWorldPosition.x
645 + a5->pFacePlane.vNormal.y * pRayStart->vWorldPosition.y
646 + a5->pFacePlane.vNormal.z * pRayStart->vWorldPosition.z);
647 if (c1 > 0)
641 return false; 648 return false;
642 649
643 a5->uAttributes |= 0x80000000; 650 c2 = a5->pFacePlane.vNormal.x * ray_dir_x + a5->pFacePlane.vNormal.y *ray_dir_y + a5->pFacePlane.vNormal.z * ray_dir_z;
644 return false; 651 //if (v9 >= 0) // ray faces face's normal ( > 0) or parallel ( == 0)
645 652 //return false;
646 v18 = -(a5->pFacePlane.vNormal.y * pRayStart->vWorldPosition.y 653
647 + pRayStart->vWorldPosition.x * a5->pFacePlane.vNormal.x 654 //t = -d-(n * p0)/n * u
648 + pRayStart->vWorldPosition.z * a5->pFacePlane.vNormal.z 655 t2 = c1 / c2;
649 + a5->pFacePlane.dist); 656
650 if (v18 > 0) 657 if (t2 > *pDepth)
651 return false; 658 return false;
652 //UNDEF(v19); 659
653 //v20 = v9 < 0.0; 660 //a5->uAttributes |= 0x80000000;
654 //v21 = 0; 661
655 //v22 = v9 == 0.0; 662 a4->vWorldPosition.x = pRayStart->vWorldPosition.x + t2 * ray_dir_x;//12432 < X < 12656
656 //BYTE1(result) = HIBYTE(v19); 663 a4->vWorldPosition.y = pRayStart->vWorldPosition.y + t2 * ray_dir_y;//-96 < Y < 1088
657 /*v23 = v18 < 0.0; 664 a4->vWorldPosition.z = pRayStart->vWorldPosition.z + t2 * ray_dir_z;//Z == 192
658 v24 = 0; 665
659 v25 = v18 == 0.0; 666 v34.x = (signed __int64)a4->vWorldPosition.x;
660 v26 = (BYTE1(result) & 0x41) == 0; 667 v34.y = (signed __int64)a4->vWorldPosition.y;
661 BYTE1(result) = HIBYTE(v19);
662 if ( v26 )
663 {
664 if ( v18 < 0.0 )
665 goto LABEL_12;
666 }
667 else
668 {
669 if ( !(v23 | v25) )
670 {
671 LABEL_12:
672 LOBYTE(result) = 0;
673 return result;
674 }
675 }*/
676
677 //a5a = v18;
678 v27 = v18 / v9;
679 //HIWORD(result) = HIWORD(pDepth);
680 //UNDEF(v28);
681 //v29 = v27 < *pDepth;
682 //v30 = 0;
683 //v31 = v27 == *pDepth;
684 //BYTE1(result) = HIBYTE(v28);
685
686 if (v27 > *pDepth)
687 return false;
688
689 a5->uAttributes |= 0x80000000;
690
691 a4->vWorldPosition.x = v27 * pRayEnd->vWorldPosition.x + pRayStart->vWorldPosition.x;
692 a4->vWorldPosition.y = v27 * pRayEnd->vWorldPosition.y + pRayStart->vWorldPosition.y;
693 a4->vWorldPosition.z = v27 * pRayEnd->vWorldPosition.z + pRayStart->vWorldPosition.z;
694 v33.x = (signed __int64)a4->vWorldPosition.x;
695 v33.y = (signed __int64)a4->vWorldPosition.y;
696 v34.x = v33.x;
697 v34.y = 0;
698 v34.z = (signed __int64)a4->vWorldPosition.z; 668 v34.z = (signed __int64)a4->vWorldPosition.z;
699 669
700 if ( _4C1D2B(a5, v34, a6) == 0.0) 670 if ( !_4C1D2B(a5, v34, a6) )
701 return false; 671 return false;
702 672
703 //a5b = v27; 673 //a5b = v27;
704 *pDepth = v27; 674 //*pDepth = t2;
705 return true; 675 return true;
706 } 676 }
707 677
708 //----- (004C1D2B) -------------------------------------------------------- 678 //----- (004C1D2B) --------------------------------------------------------
709 int Vis::_4C1D2B(BLVFace *pFace, Vec3_short_ a2, unsigned int uModelID) 679 int Vis::_4C1D2B(BLVFace *pFace, Vec3_short_ a2, unsigned int uModelID)
721 signed int result; // eax@21 691 signed int result; // eax@21
722 int v15; // [sp+10h] [bp-Ch]@10 692 int v15; // [sp+10h] [bp-Ch]@10
723 signed int v16; // [sp+18h] [bp-4h]@10 693 signed int v16; // [sp+18h] [bp-4h]@10
724 694
725 v4 = pFace; 695 v4 = pFace;
726 if (a2.z < pFace->pBounding.z1 || a2.z > pFace->pBounding.z2 || 696 if (a2.x < pFace->pBounding.x1 || a2.x > pFace->pBounding.x2 ||
727 a2.x < pFace->pBounding.x1 || a2.x > pFace->pBounding.x2 || 697 a2.y < pFace->pBounding.y1 || a2.y > pFace->pBounding.y2 ||
728 a2.y < pFace->pBounding.y1 || a2.y > pFace->pBounding.y2) 698 a2.z < pFace->pBounding.z1 || a2.z > pFace->pBounding.z2)
729 return false; 699 return false;
730 700
701 pFace->uAttributes |= 0x80000000;
702 return true;
731 if (uModelID != -1) 703 if (uModelID != -1)
732 _4C2186_BLV_IntersectBModel((int *)&pFace, (int *)&uModelID, 704 _4C2186_BLV_IntersectBModel((int *)&pFace, (int *)&uModelID,
733 word_F8BC48_displaced_face_intersect_plane_coords_a, 705 word_F8BC48_displaced_face_intersect_plane_coords_a,
734 word_F8BD18_displaced_face_intersect_plane_coords_b, 706 word_F8BD18_displaced_face_intersect_plane_coords_b,
735 &a2, pFace, uModelID); 707 &a2, pFace, uModelID);
923 do 895 do
924 { 896 {
925 v12 = a1a; 897 v12 = a1a;
926 a3[2 * a1a] = a6->pXInterceptDisplacements[a1a] 898 a3[2 * a1a] = a6->pXInterceptDisplacements[a1a]
927 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v11] + 12 * a6->pVertexIDs[a1a]); 899 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v11] + 12 * a6->pVertexIDs[a1a]);
928 + pOutdoor->pBModels[v11].pVertices.pVertices[a6->pVertexIDs[a1a]].x; 900 + pOutdoor->pBModels[uModelID].pVertices.pVertices[a6->pVertexIDs[a1a]].x;
929 *(a5a - 1) = a6->pYInterceptDisplacements[v12] 901 *(a5a - 1) = a6->pYInterceptDisplacements[v12]
930 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v11] + 12 * a6->pVertexIDs[v12] + 4); 902 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v11] + 12 * a6->pVertexIDs[v12] + 4);
931 + pOutdoor->pBModels[v11].pVertices.pVertices[a6->pVertexIDs[v12]].y; 903 + pOutdoor->pBModels[uModelID].pVertices.pVertices[a6->pVertexIDs[v12]].y;
932 *(__int16 *)((char *)a5a + (int)(char *)a3 - (char *)a4) = a6->pXInterceptDisplacements[v12 + 1] 904 *(__int16 *)((char *)a5a + (int)(char *)a3 - (char *)a4) = a6->pXInterceptDisplacements[v12 + 1]
933 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v11] 905 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v11]
934 // + 12 * a6->pVertexIDs[v12 + 1]); 906 // + 12 * a6->pVertexIDs[v12 + 1]);
935 + pOutdoor->pBModels[v11].pVertices.pVertices[a6->pVertexIDs[v12+1]].x; 907 + pOutdoor->pBModels[uModelID].pVertices.pVertices[a6->pVertexIDs[v12+1]].x;
936 v13 = a6->pYInterceptDisplacements[v12 + 1] 908 v13 = a6->pYInterceptDisplacements[v12 + 1]
937 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v11] + 12 * a6->pVertexIDs[v12 + 1] + 4); 909 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v11] + 12 * a6->pVertexIDs[v12 + 1] + 4);
938 + pOutdoor->pBModels[v11].pVertices.pVertices[a6->pVertexIDs[v12 + 1]].y; 910 + pOutdoor->pBModels[uModelID].pVertices.pVertices[a6->pVertexIDs[v12 + 1]].y;
939 v14 = a5a; 911 v14 = a5a;
940 ++a1a; 912 ++a1a;
941 a5a += 2; 913 a5a += 2;
942 *v14 = v13; 914 *v14 = v13;
943 } 915 }
957 do 929 do
958 { 930 {
959 v16 = a1a; 931 v16 = a1a;
960 a3[2 * a1a] = a6->pXInterceptDisplacements[a1a] 932 a3[2 * a1a] = a6->pXInterceptDisplacements[a1a]
961 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v15] + 12 * a6->pVertexIDs[a1a]); 933 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v15] + 12 * a6->pVertexIDs[a1a]);
962 + pOutdoor->pBModels[v15].pVertices.pVertices[a6->pVertexIDs[a1a]].x; 934 + pOutdoor->pBModels[uModelID].pVertices.pVertices[a6->pVertexIDs[a1a]].x;
963 *(a5b - 1) = a6->pZInterceptDisplacements[v16] 935 *(a5b - 1) = a6->pZInterceptDisplacements[v16]
964 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v15] + 12 * a6->pVertexIDs[v16] + 8); 936 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v15] + 12 * a6->pVertexIDs[v16] + 8);
965 + pOutdoor->pBModels[v15].pVertices.pVertices[a6->pVertexIDs[v16]].y; 937 + pOutdoor->pBModels[uModelID].pVertices.pVertices[a6->pVertexIDs[v16]].y;
966 *(__int16 *)((char *)a5b + (int)a3 - (int)a4) = a6->pXInterceptDisplacements[v16 + 1] 938 *(__int16 *)((char *)a5b + (int)a3 - (int)a4) = a6->pXInterceptDisplacements[v16 + 1]
967 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v15] 939 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v15]
968 // + 12 * a6->pVertexIDs[v16 + 1]); 940 // + 12 * a6->pVertexIDs[v16 + 1]);
969 + pOutdoor->pBModels[v15].pVertices.pVertices[a6->pVertexIDs[v16+1]].x; 941 + pOutdoor->pBModels[uModelID].pVertices.pVertices[a6->pVertexIDs[v16+1]].x;
970 v17 = a6->pZInterceptDisplacements[v16 + 1] 942 v17 = a6->pZInterceptDisplacements[v16 + 1]
971 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v15] + 12 * a6->pVertexIDs[v16 + 1] + 8); 943 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v15] + 12 * a6->pVertexIDs[v16 + 1] + 8);
972 + pOutdoor->pBModels[v15].pVertices.pVertices[a6->pVertexIDs[v16+1]].z; 944 + pOutdoor->pBModels[uModelID].pVertices.pVertices[a6->pVertexIDs[v16+1]].z;
973 v18 = a5b; 945 v18 = a5b;
974 ++a1a; 946 ++a1a;
975 a5b += 2; 947 a5b += 2;
976 *v18 = v17; 948 *v18 = v17;
977 } 949 }
989 do 961 do
990 { 962 {
991 v20 = a1a; 963 v20 = a1a;
992 a3[2 * a1a] = a6->pYInterceptDisplacements[a1a] 964 a3[2 * a1a] = a6->pYInterceptDisplacements[a1a]
993 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v19] + 12 * a6->pVertexIDs[a1a] + 4); 965 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v19] + 12 * a6->pVertexIDs[a1a] + 4);
994 + pOutdoor->pBModels[v19].pVertices.pVertices[a6->pVertexIDs[a1a]].y; 966 + pOutdoor->pBModels[uModelID].pVertices.pVertices[a6->pVertexIDs[a1a]].y;
995 *(a5c - 1) = a6->pZInterceptDisplacements[v20] 967 *(a5c - 1) = a6->pZInterceptDisplacements[v20]
996 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v19] + 12 * a6->pVertexIDs[v20] + 8); 968 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v19] + 12 * a6->pVertexIDs[v20] + 8);
997 + pOutdoor->pBModels[v19].pVertices.pVertices[a6->pVertexIDs[a1a]].z; 969 + pOutdoor->pBModels[uModelID].pVertices.pVertices[a6->pVertexIDs[a1a]].z;
998 *(__int16 *)((char *)a5c + (int)(char *)a3 - (char *)a4) = a6->pYInterceptDisplacements[v20 + 1] 970 *(__int16 *)((char *)a5c + (int)(char *)a3 - (char *)a4) = a6->pYInterceptDisplacements[v20 + 1]
999 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v19] 971 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v19]
1000 // + 12 * a6->pVertexIDs[v20 + 1] 972 // + 12 * a6->pVertexIDs[v20 + 1]
1001 // + 4); 973 // + 4);
1002 + pOutdoor->pBModels[v19].pVertices.pVertices[a6->pVertexIDs[v20+1]].y; 974 + pOutdoor->pBModels[uModelID].pVertices.pVertices[a6->pVertexIDs[v20+1]].y;
1003 v21 = a6->pZInterceptDisplacements[v20 + 1] 975 v21 = a6->pZInterceptDisplacements[v20 + 1]
1004 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v19] + 12 * a6->pVertexIDs[v20 + 1] + 8); 976 // + *(short *)(*(int *)&pOutdoor->pBModels->pModelName[v19] + 12 * a6->pVertexIDs[v20 + 1] + 8);
1005 + pOutdoor->pBModels[v19].pVertices.pVertices[a6->pVertexIDs[v20+1]].z; 977 + pOutdoor->pBModels[uModelID].pVertices.pVertices[a6->pVertexIDs[v20+1]].z;
1006 v22 = a5c; 978 v22 = a5c;
1007 ++a1a; 979 ++a1a;
1008 a5c += 2; 980 a5c += 2;
1009 *v22 = v21; 981 *v22 = v21;
1010 } 982 }
1017 } 989 }
1018 990
1019 //----- (004C248E) -------------------------------------------------------- 991 //----- (004C248E) --------------------------------------------------------
1020 void Vis::CastPickRay(RenderVertexSoft *pRay, float fMouseX, float fMouseY, float fPickDepth) 992 void Vis::CastPickRay(RenderVertexSoft *pRay, float fMouseX, float fMouseY, float fPickDepth)
1021 { 993 {
1022 int v5; // ebx@1 994 int pRotX; // esi@1
1023 int v6; // edi@1
1024 int v7; // esi@1
1025 Vec3_int_ v8; // ST08_12@1 995 Vec3_int_ v8; // ST08_12@1
1026 int v9; // ST04_4@1 996 int pRotY; // ST04_4@1
1027 int v10; // eax@1 997 int pDepth; // eax@1
1028 RenderVertexSoft v11[2]; // [sp+2Ch] [bp-74h]@1 998 RenderVertexSoft v11[2]; // [sp+2Ch] [bp-74h]@1
1029 int v12; // [sp+8Ch] [bp-14h]@1 999 int outx;
1030 int v13; // [sp+90h] [bp-10h]@1
1031 int outz; // [sp+94h] [bp-Ch]@1 1000 int outz; // [sp+94h] [bp-Ch]@1
1032 int outy; // [sp+98h] [bp-8h]@1 1001 int outy; // [sp+98h] [bp-8h]@1
1033 int v16; // [sp+9Ch] [bp-4h]@1 1002
1034 1003 pRotX = pIndoorCamera->sRotationY + UnprojectX((signed __int64)fMouseX);
1035 v5 = pIndoorCamera->pos.y; 1004 v8.z = pIndoorCamera->pos.z;
1036 v6 = pIndoorCamera->pos.x; 1005 v8.x = pIndoorCamera->pos.x;
1037 v13 = pIndoorCamera->pos.x; 1006 v8.y = pIndoorCamera->pos.y;
1038 v12 = pIndoorCamera->pos.y; 1007 pRotY = pIndoorCamera->sRotationX + UnprojectY((signed __int64)fMouseY);
1039 v16 = pIndoorCamera->pos.z; 1008 pDepth = _48B561_mess_with_scaling_along_z(/*(int)&fMouseX, */fPickDepth);
1040 v7 = pIndoorCamera->sRotationY + UnprojectX((signed __int64)fMouseX); 1009 Vec3_int_::Rotate(pDepth, pRotX, pRotY, v8, &outx, &outy, &outz);
1041 v8.z = v16;
1042 v8.x = v6;
1043 v8.y = v5;
1044 v9 = pIndoorCamera->sRotationX + UnprojectY((signed __int64)fMouseY);
1045 v10 = _48B561_mess_with_scaling_along_z(/*(int)&fMouseX, */fPickDepth);
1046 Vec3_int_::Rotate(v10, v7, v9, v8, (int *)&fMouseX, &outy, &outz);
1047 v11[0].flt_2C = 0.0; 1010 v11[0].flt_2C = 0.0;
1048 v11[0].vWorldPosition.x = (double)SLODWORD(fMouseX); 1011 v11[0].vWorldPosition.x = (double)outx;
1049 v11[0].vWorldPosition.y = (double)outy; 1012 v11[0].vWorldPosition.y = (double)outy;
1050 v11[0].vWorldPosition.z = (double)outz; 1013 v11[0].vWorldPosition.z = (double)outz;
1051 v11[1].flt_2C = 0.0; 1014 v11[1].flt_2C = 0.0;
1052 v11[1].vWorldPosition.x = (double)v13; 1015 v11[1].vWorldPosition.x = (double)pIndoorCamera->pos.x;
1053 v11[1].vWorldPosition.y = (double)v12; 1016 v11[1].vWorldPosition.y = (double)pIndoorCamera->pos.y;
1054 v11[1].vWorldPosition.z = (double)v16; 1017 v11[1].vWorldPosition.z = (double)pIndoorCamera->pos.z;
1055 memcpy(pRay, &v11[1], 0x30u); 1018 memcpy(pRay, &v11[1], 0x30u);
1056 memcpy(&pRay[1], v11, sizeof(pRay[1])); 1019 memcpy(&pRay[1], v11, sizeof(pRay[1]));
1057 } 1020 }
1058 1021
1059 //----- (004C2551) -------------------------------------------------------- 1022 //----- (004C2551) --------------------------------------------------------