コード例 #1
0
ファイル: pm_debug.c プロジェクト: Avatarchik/cs16-client
/*
================
PM_DrawRectangle(vec3_t tl, vec3_t br)

================
*/
void PM_DrawRectangle(vec3_t tl, vec3_t bl, vec3_t tr, vec3_t br, int pcolor, float life)
{
	PM_ParticleLine(tl, bl, pcolor, life, 0);
	PM_ParticleLine(bl, br, pcolor, life, 0);
	PM_ParticleLine(br, tr, pcolor, life, 0);
	PM_ParticleLine(tr, tl, pcolor, life, 0);
}
コード例 #2
0
ファイル: view.cpp プロジェクト: Sh1ft0x0EF/HLSDKRevamp
void V_Move(int mx, int my)
{
	float  fov;
	float  fx, fy;
	float  dx, dy;
	float  c_x, c_y;
	float  dX, dY;
	vec3_t forward, up, right;
	vec3_t newangles;

	vec3_t    farpoint;
	pmtrace_t tr;

	fov = CalcFov(in_fov, (float)ScreenWidth, (float)ScreenHeight);

	c_x = (float)ScreenWidth / 2.0;
	c_y = (float)ScreenHeight / 2.0;

	dx = (float)mx - c_x;
	dy = (float)my - c_y;

	// Proportion we moved in each direction
	fx = dx / c_x;
	fy = dy / c_y;

	dX = fx * in_fov / 2.0;
	dY = fy * fov / 2.0;

	newangles = v_angles;

	newangles[YAW] -= dX;
	newangles[PITCH] += dY;

	// Now rotate v_forward around that point
	AngleVectors(newangles, forward, right, up);

	farpoint = v_origin + 8192 * forward;

	// Trace
	tr = *(gEngfuncs.PM_TraceLine((float *)&v_origin, (float *)&farpoint, PM_TRACELINE_PHYSENTSONLY, 2 /*point sized hull*/, -1));

	if(tr.fraction != 1.0 && tr.ent != 0)
	{
		hitent = PM_GetInfo(tr.ent);
		PM_ParticleLine((float *)&v_origin, (float *)&tr.endpos, 5, 1.0, 0.0);
	}
	else
	{
		hitent = -1;
	}
}
コード例 #3
0
ファイル: pm_debug.c プロジェクト: Avatarchik/cs16-client
void PM_ShowClipBox(void)
{
#if defined( _DEBUG )
	vec3_t org;
	vec3_t offset = { 0, 0, 0 };

	if ( !pmove->runfuncs )
		return;

	// More debugging, draw the particle bbox for player and for the entity we are looking directly at.
	//  aslo prints entity info to the console overlay.
	//if ( !pmove->server )
	//	return;

	// Draw entity in center of view
	// Also draws the normal to the clip plane that intersects our movement ray.  Leaves a particle
	//  trail at the intersection point.
	PM_ViewEntity();

	VectorCopy( pmove->origin, org );

	if ( pmove->server )
	{
		VectorAdd( org, offset, org );
	}
	else
	{
		VectorSubtract( org, offset, org );
	}

	// Show our BBOX in particles.
	PM_DrawBBox( pmove->player_mins[pmove->usehull], pmove->player_maxs[pmove->usehull], org, pmove->server ? 132 : 0, 0.1 );

	PM_ParticleLine( org, org, pmove->server ? 132 : 0, 0.1, 5.0 );
/*
	{
		int i;
		for ( i = 0; i < pmove->numphysent; i++ )
		{
			if ( pmove->physents[ i ].info >= 1 && pmove->physents[ i ].info <= 4 )
			{
			 	PM_DrawBBox( pmove->player_mins[pmove->usehull], pmove->player_maxs[pmove->usehull], pmove->physents[i].origin, 132, 0.1 );
			}
		}
	}
*/
#endif
}