02-02-2011, 10:34
Quote:with engine its quick simple no need math or anythinks the functions alreay have w2s and the maths
PHP Code:
void CEsp::Draw3D_Box( Entity* cent, vec3_t color )
{
vec3_t LerpPoint;
vec3_t HeadPoint;
vec3_t Box_Size;
CEngineMisc.GetTagOrigin( cent, "tag_origin", &LerpPoint );
CEngineMisc.GetTagOrigin( cent, "j_head", &HeadPoint );
vec3_t vec3_Box_Orination;
if ( cent->eFlag & EF_PRONE )
{
Box_Size[0] = 43;
Box_Size[1] = 37;
Box_Size[2] = 20;
vec3_Box_Orination[0] = -50;
vec3_Box_Orination[1] = -30;
vec3_Box_Orination[2] = 0;
}
else if ( cent->eFlag & EF_CROUCHING )
{
Box_Size[0] = 36;
Box_Size[1] = 31;
Box_Size[2] = 50;
vec3_Box_Orination[0] = -40;
vec3_Box_Orination[1] = -40;
vec3_Box_Orination[2] = 0;
}
else
{
Box_Size[0] = 30;
Box_Size[1] = 30;
Box_Size[2] = 60;
vec3_Box_Orination[0] = -22;
vec3_Box_Orination[1] = -22;
vec3_Box_Orination[2] = 0;
}
vec3_t Head_Box_Size;
Head_Box_Size[0] = 5;
Head_Box_Size[1] = 5;
Head_Box_Size[2] = 5;
vec3_t Head_origin = { -5, -5, -5 };
if (hookValue[VAR_HEAD_BOX] == 1 )
Draw3D_Debug_Line( HeadPoint, Head_Box_Size, Head_origin, 0, color, 0, 0);
if (hookValue[VAR_HEAD_BOX] == 2 )
Draw_Debug_Ring( HeadPoint, 8, color, 0, 0, 0 );
if (hookValue[VAR_BOX] )
Draw3D_Debug_Line( LerpPoint, Box_Size, vec3_Box_Orination, 0, color, 0, 0);
}
that's the exact same what the engine does
some more usefull shit
PHP Code:
void (*Draw2D_Debug_Line)(const vec3_t start, const vec3_t end, vec4_t Color, bool dontDrawTruhWalls ) = (void (__cdecl *)(const vec3_t , const vec3_t , vec4_t , bool ))0x402A50;
void (*Draw3D_Debug_Line)(const vec3_t start, const vec3_t BoxSize, const vec3_t VecTorSize , int noIdea, vec4_t color, bool dontDrawTruhWalls, int PredictEffect ) = (void (__cdecl *)( const vec3_t , const vec3_t , const vec3_t , int , vec4_t , bool , int ))0x6B19F0;
void (*DrawAxis_Debug_Line)(const vec3_t start, vec4_t color, bool dontDrawTruhWalls ) = (void (__cdecl *)(const vec3_t , vec4_t , bool ))0x55AA70;
void (*Draw_Debug_String)(const vec3_t Position, vec4_t color, float Size , char* string, int PredictEffect ) = (void (__cdecl *)( const vec3_t , vec4_t , float , char* , int ))0x4C4CD0;
void (*Draw_Debug_Ring)(const vec3_t start, float Size, vec4_t Color, bool dontDrawTruhWalls, int a2, int a3 ) = (void (__cdecl *)(const vec3_t , float , vec4_t , bool , int , int ))0x62A010;
void (*Draw_Debug_String2)(const vec3_t Position, vec4_t color, float Size , char* string, int PredictEffect ) = (void (__cdecl *)( const vec3_t , vec4_t , float , char* , int ))0x524C30;
//used for drawing/calculate Missile weapon trace
PHP Code:
void (*BG_EvaluateTrajectory)(const trajectory_t *tr, int atTime, vec3_t result ) = (void (__cdecl *)( const trajectory_t *, int , vec3_t ))0x5F2A50;
void (*BG_EvaluateTrajectoryDelta)(const trajectory_t *tr, int atTime, vec3_t result ) = (void (__cdecl *)( const trajectory_t *, int , vec3_t ))0x556B70;
PHP Code:
typedef enum {
TR_STATIONARY,
TR_INTERPOLATE,
TR_LINEAR,
TR_LINEAR_STOP,
TR_LINEAR_STOP_BACK,
TR_SINE,
TR_GRAVITY,
TR_GRAVITY_LOW,
TR_GRAVITY_FLOAT,
TR_GRAVITY_PAUSED,
TR_ACCELERATE,
TR_DECCELERATE,
TR_SPLINE,
TR_LINEAR_PATH
} trType_t;
typedef struct {
trType_t trType;
int trTime;
int trDuration;
vec3_t trBase;
vec3_t trDelta;
} trajectory_t;
Credits:
King-OrgY