// // kmRay2IntersectTriangle from 0xadfbf0 to 0xadfe20 (560 bytes) // // 1 xrefs: // > @ 0x53f58 // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // __int64 __fastcall kmRay2IntersectTriangle(float *a1, float *a2, float *a3, float *a4, _DWORD *a5, _DWORD *a6) { int v6; // s8 float v13; // s9 unsigned int v14; // w23 int v15; // w28 __int64 v17; // x0 __int64 v18; // x0 __int64 v19; // x0 float v20; // s4 int v21; // [xsp+70h] [xbp+70h] BYREF int v22; // [xsp+74h] [xbp+74h] int v23; // [xsp+78h] [xbp+78h] BYREF int v24; // [xsp+7Ch] [xbp+7Ch] _BYTE v25[8]; // [xsp+80h] [xbp+80h] BYREF v6 = 0; v23 = 0; v24 = 0; if ( !(unsigned __int8)kmRay2IntersectLineSegment(a1, a2, a3, (float *)&v21) ) { v13 = 10000.0; v14 = 0; v15 = 0; if ( !(unsigned __int8)kmRay2IntersectLineSegment(a1, a3, a4, (float *)&v21) ) goto LABEL_3; LABEL_13: v19 = kmVec2Subtract(v25, &v21, a1); v20 = kmVec2Length(v19); if ( v13 > v20 ) { v13 = v20; v6 = v22; v15 = v21; calculate_line_normal((__int64)&v23, *a3, a3[1], *a4, a4[1]); } if ( !(unsigned __int8)kmRay2IntersectLineSegment(a1, a4, a2, (float *)&v21) ) goto LABEL_8; goto LABEL_6; } v18 = kmVec2Subtract(v25, &v21, a1); v13 = kmVec2Length(v18); if ( v13 < 10000.0 ) { v14 = 1; v6 = v22; v15 = v21; calculate_line_normal((__int64)&v23, *a2, a2[1], *a3, a3[1]); } else { v13 = 10000.0; v14 = 1; v15 = 0; } if ( (unsigned __int8)kmRay2IntersectLineSegment(a1, a3, a4, (float *)&v21) ) goto LABEL_13; LABEL_3: if ( !(unsigned __int8)kmRay2IntersectLineSegment(a1, a4, a2, (float *)&v21) ) { if ( !v14 ) return v14; goto LABEL_8; } LABEL_6: v17 = kmVec2Subtract(v25, &v21, a1); if ( kmVec2Length(v17) < v13 ) { v6 = v22; v15 = v21; calculate_line_normal((__int64)&v23, *a4, a4[1], *a2, a2[1]); } LABEL_8: *a5 = v15; v14 = 1; a5[1] = v6; if ( a6 ) { *a6 = v23; a6[1] = v24; } return v14; }
GD Web Decomp Icon

GD Web Decomp

Raw Source