CG_Trace
So i'm having a small problem with CG_Trace when i'm ingame it just aims through everything here is what i'm currently using:
void (*CG_Trace)(cTrace_t *trace,vec3_t start,vec3_t mins,vec3_t maxs,vec3_t end,int skipNumber,int Mask) = (void(__cdecl *)(cTrace_t*, vec3_t,vec3_t,vec3_t,vec3_t,int, int))0x660980;
which can be found here:
this is how i'm using it:
and i think the trace struct that kingorgy posted is correct.
would someone kindly try this function and see if they get the same results?
many thanks.
credits:cardoow,raiders,kingorgy.
void (*CG_Trace)(cTrace_t *trace,vec3_t start,vec3_t mins,vec3_t maxs,vec3_t end,int skipNumber,int Mask) = (void(__cdecl *)(cTrace_t*, vec3_t,vec3_t,vec3_t,vec3_t,int, int))0x660980;
which can be found here:
Code:
00460BE0 8B4424 20 MOV EAX,DWORD PTR SS:[ESP+20] 00460BE4 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C] 00460BE8 8B5424 08 MOV EDX,DWORD PTR SS:[ESP+8] 00460BEC 81EC 84000000 SUB ESP,84 00460BF2 53 PUSH EBX 00460BF3 8B9C24 94000000 MOV EBX,DWORD PTR SS:[ESP+94] 00460BFA 55 PUSH EBP 00460BFB 8BAC24 A0000000 MOV EBP,DWORD PTR SS:[ESP+A0] 00460C02 56 PUSH ESI 00460C03 8BB424 A0000000 MOV ESI,DWORD PTR SS:[ESP+A0] 00460C0A 57 PUSH EDI 00460C0B 8BBC24 98000000 MOV EDI,DWORD PTR SS:[ESP+98] 00460C12 50 PUSH EAX 00460C13 51 PUSH ECX 00460C14 56 PUSH ESI 00460C15 53 PUSH EBX 00460C16 55 PUSH EBP 00460C17 52 PUSH EDX 00460C18 57 PUSH EDI 00460C19 E8 62FD1F00 CALL BlackOps.00660980 00460C1E F3:0F104F 10 MOVSS XMM1,DWORD PTR DS:[EDI+10] 00460C23 83C4 1C ADD ESP,1C
Code:
bool IsVisible( vec3_t vecpoint )
{
cTrace_t trace;
CG_Trace( &trace,refdef->vOrigin,vecpoint,cg->clientNum,0x803003);
return( trace.fraction == 1.0f );
}
would someone kindly try this function and see if they get the same results?
many thanks.
credits:cardoow,raiders,kingorgy.