Exemplo n.º 1
0
/*
* CG_LaserGunPolyBeam
*/
void CG_LaserGunPolyBeam( vec3_t start, vec3_t end, vec4_t color, int tag )
{
	cpoly_t *cgpoly;
	vec4_t tcolor = { 0, 0, 0, 0.35f };
	vec_t total;
	vec_t min;
	vec4_t min_team_color;

	// learn0more: this kinda looks best
	if( color )
	{
		// dmh: if teamcolor is too dark set color to default brighter
		VectorCopy( color, tcolor );
		min = 90 * ( 1.0f/255.0f );
		min_team_color[0] = min_team_color[1] = min_team_color[2] = min;
		total = tcolor[0] + tcolor[1] + tcolor[2];
		if( total < min )
			VectorCopy( min_team_color, tcolor );
	}

	if( cg_lgbeam_old->integer ) {
		cgpoly = CG_SpawnPolyBeam( start, end, color ? tcolor : NULL, 12, 1, 0, CG_MediaShader( cgs.media.shaderLaserGunBeamOld ), 64, tag );

		// since autosprite doesn't work, spawn a second and rotate it 90 degrees
		cgpoly = CG_SpawnPolyBeam( start, end, color ? tcolor : NULL, 12, 1, 0, CG_MediaShader( cgs.media.shaderLaserGunBeamOld ), 64, tag );
		cgpoly->angles[ROLL] += 90;
	} else {
		cgpoly = CG_SpawnPolyBeam( start, end, color ? tcolor : NULL, 12, 1, 0, CG_MediaShader( cgs.media.shaderLaserGunBeam ), 64, tag );

		// since autosprite doesn't work, spawn a second and rotate it 90 degrees
		cgpoly = CG_SpawnPolyBeam( start, end, color ? tcolor : NULL, 12, 1, 0, CG_MediaShader( cgs.media.shaderLaserGunBeam ), 64, tag );
		cgpoly->angles[ROLL] += 90;
	}
}
Exemplo n.º 2
0
/*
* CG_QuickPolyBeam
*/
void CG_QuickPolyBeam( vec3_t start, vec3_t end, int width, struct shader_s *shader )
{
	cpoly_t *cgpoly;

	if( !shader )
		shader = CG_MediaShader( cgs.media.shaderLaser );

	cgpoly = CG_SpawnPolyBeam( start, end, NULL, width, 1, 0, shader, 64, 0 );

	// since autosprite doesn't work, spawn a second and rotate it 90 degrees
	cgpoly = CG_SpawnPolyBeam( start, end, NULL, width, 1, 0, shader, 64, 0 );
	cgpoly->angles[ROLL] += 90;
}
Exemplo n.º 3
0
/*
* CG_InstaPolyBeam
*/
void CG_InstaPolyBeam( const vec3_t start, const vec3_t end, int team )
{
	vec4_t tcolor = { 1, 1, 1, 0.35f };
	vec_t total;
	vec_t min;
	vec4_t min_team_color;

	if( cg_instabeam_time->value <= 0.0f || cg_instabeam_width->integer <= 0 )
		return;

	if( cg_teamColoredBeams->integer && ( team == TEAM_ALPHA || team == TEAM_BETA ) )
	{
		CG_TeamColor( team, tcolor );
		min = 90 * ( 1.0f/255.0f );
		min_team_color[0] = min_team_color[1] = min_team_color[2] = min;
		total = tcolor[0] + tcolor[1] + tcolor[2];
		if( total < min )
			VectorCopy( min_team_color, tcolor );
	}
	else
	{
		tcolor[0] = 1.0f;
		tcolor[1] = 0.0f;
		tcolor[2] = 0.4f;
	}

	tcolor[3] = min( cg_instabeam_alpha->value, 1 );
	if( !tcolor[3] )
		return;

	CG_SpawnPolyBeam( start, end, tcolor, cg_instabeam_width->integer, cg_instabeam_time->value * 1000, cg_instabeam_time->value * 1000 * 0.4f, CG_MediaShader( cgs.media.shaderInstaBeam ), 128, 0 );
}
Exemplo n.º 4
0
/*
* CG_QuickPolyBeam
*/
void CG_QuickPolyBeam( const vec3_t start, const vec3_t end, int width, struct shader_s *shader )
{
	if( !shader )
		shader = CG_MediaShader( cgs.media.shaderLaser );

	CG_SpawnPolyBeam( start, end, NULL, width, 1, 0, shader, 64, 0 );
}
Exemplo n.º 5
0
/*
* CG_ElectroPolyBeam
*/
void CG_ElectroPolyBeam( const vec3_t start, const vec3_t end, int team )
{
	struct shader_s *shader;

	if( cg_ebbeam_time->value <= 0.0f || cg_ebbeam_width->integer <= 0 )
		return;

	if( cg_ebbeam_old->integer )
	{
		if( cg_teamColoredBeams->integer && ( team == TEAM_ALPHA || team == TEAM_BETA ) )
		{
			if( team == TEAM_ALPHA )
				shader = CG_MediaShader( cgs.media.shaderElectroBeamOldAlpha );
			else
				shader = CG_MediaShader( cgs.media.shaderElectroBeamOldBeta );
		}
		else
		{
			shader = CG_MediaShader( cgs.media.shaderElectroBeamOld );
		}

		CG_SpawnPolyBeam( start, end, NULL, cg_ebbeam_width->integer, cg_ebbeam_time->value * 1000, cg_ebbeam_time->value * 1000 * 0.4f, shader, 128, 0 );
	}
	else
	{
		if( cg_teamColoredBeams->integer && ( team == TEAM_ALPHA || team == TEAM_BETA ) )
		{
			if( team == TEAM_ALPHA )
				shader = CG_MediaShader( cgs.media.shaderElectroBeamAAlpha );
			else
				shader = CG_MediaShader( cgs.media.shaderElectroBeamABeta );
		}
		else
		{
			shader = CG_MediaShader( cgs.media.shaderElectroBeamA );
		}

		CG_SpawnPolyBeam( start, end, NULL, cg_ebbeam_width->integer, cg_ebbeam_time->value * 1000, cg_ebbeam_time->value * 1000 * 0.4f, shader, 128, 0 );
	}
}
Exemplo n.º 6
0
/*
* CG_InstaPolyBeam
*/
void CG_InstaPolyBeam( vec3_t start, vec3_t end, int team )
{
	cpoly_t *cgpoly;
	vec4_t tcolor = { 1, 1, 1, 0.35f };
	vec_t total;
	vec_t min;
	vec4_t min_team_color;

	if( cg_instabeam_time->value <= 0.0f || cg_instabeam_width->integer <= 0 )
		return;

	if( cg_teamColoredBeams->integer && ( team == TEAM_ALPHA || team == TEAM_BETA ) )
	{
		CG_TeamColor( team, tcolor );
		min = 90 * ( 1.0f/255.0f );
		min_team_color[0] = min_team_color[1] = min_team_color[2] = min;
		total = tcolor[0] + tcolor[1] + tcolor[2];
		if( total < min )
			VectorCopy( min_team_color, tcolor );
	}
	else
	{
		tcolor[0] = 1.0f;
		tcolor[1] = 0.0f;
		tcolor[2] = 0.4f;
	}

	tcolor[3] = min( cg_instabeam_alpha->value, 1 );
	if( !tcolor[3] )
		return;

	cgpoly = CG_SpawnPolyBeam( start, end, tcolor, cg_instabeam_width->integer, cg_instabeam_time->value * 1000, cg_instabeam_time->value * 1000 * 0.4f, CG_MediaShader( cgs.media.shaderInstaBeam ), 128, 0 );

	// since autosprite doesn't work, spawn a second and rotate it 90 degrees
	cgpoly = CG_SpawnPolyBeam( start, end, tcolor, cg_instabeam_width->integer, cg_instabeam_time->value * 1000, cg_instabeam_time->value * 1000 * 0.4f, CG_MediaShader( cgs.media.shaderInstaBeam ), 128, 0 );
	cgpoly->angles[ROLL] += 90;
}
Exemplo n.º 7
0
/*
* CG_LaserGunPolyBeam
*/
void CG_LaserGunPolyBeam( const vec3_t start, const vec3_t end, const vec4_t color, int tag )
{
	vec4_t tcolor = { 0, 0, 0, 0.35f };
	vec_t total;
	vec_t min;
	vec4_t min_team_color;

	// learn0more: this kinda looks best
	if( color )
	{
		// dmh: if teamcolor is too dark set color to default brighter
		VectorCopy( color, tcolor );
		min = 90 * ( 1.0f/255.0f );
		min_team_color[0] = min_team_color[1] = min_team_color[2] = min;
		total = tcolor[0] + tcolor[1] + tcolor[2];
		if( total < min )
			VectorCopy( min_team_color, tcolor );
	}

	CG_SpawnPolyBeam( start, end, color ? tcolor : NULL, 12, 1, 0, CG_MediaShader( cgs.media.shaderLaserGunBeam ), 64, tag );
}
Exemplo n.º 8
0
/*
* CG_PLink
*/
void CG_PLink( const vec3_t start, const vec3_t end, const vec4_t color, int flags )
{
	CG_SpawnPolyBeam( start, end, color, 4, 2000.0f, 0.0f, CG_MediaShader( cgs.media.shaderLaser ), 64, 0 );
}
Exemplo n.º 9
0
/*
* CG_ElectroPolyBeam
*/
void CG_ElectroPolyBeam( vec3_t start, vec3_t end, int team )
{
	cpoly_t *cgpoly;
	struct shader_s *shader;

	if( cg_ebbeam_time->value <= 0.0f || cg_ebbeam_width->integer <= 0 )
		return;

	if( cg_ebbeam_old->integer )
	{
		if( cg_teamColoredBeams->integer && ( team == TEAM_ALPHA || team == TEAM_BETA ) )
		{
			if( team == TEAM_ALPHA )
				shader = CG_MediaShader( cgs.media.shaderElectroBeamOldAlpha );
			else
				shader = CG_MediaShader( cgs.media.shaderElectroBeamOldBeta );
		}
		else
		{
			shader = CG_MediaShader( cgs.media.shaderElectroBeamOld );
		}

		cgpoly = CG_SpawnPolyBeam( start, end, NULL, cg_ebbeam_width->integer, cg_ebbeam_time->value * 1000, cg_ebbeam_time->value * 1000 * 0.4f, shader, 128, 0 );
		cgpoly->angles[ROLL] += 45;

		cgpoly = CG_SpawnPolyBeam( start, end, NULL, cg_ebbeam_width->integer, cg_ebbeam_time->value * 1000, cg_ebbeam_time->value * 1000 * 0.4f, shader, 128, 0 );
		cgpoly->angles[ROLL] += 135;
	}
	else
	{
		if( cg_teamColoredBeams->integer && ( team == TEAM_ALPHA || team == TEAM_BETA ) )
		{
			if( team == TEAM_ALPHA )
				shader = CG_MediaShader( cgs.media.shaderElectroBeamAAlpha );
			else
				shader = CG_MediaShader( cgs.media.shaderElectroBeamABeta );
		}
		else
		{
			shader = CG_MediaShader( cgs.media.shaderElectroBeamA );
		}

		cgpoly = CG_SpawnPolyBeam( start, end, NULL, cg_ebbeam_width->integer, cg_ebbeam_time->value * 1000, cg_ebbeam_time->value * 1000 * 0.4f, shader, 128, 0 );
		cgpoly->angles[ROLL] += 45;

		if( cg_teamColoredBeams->integer && ( team == TEAM_ALPHA || team == TEAM_BETA ) )
		{
			if( team == TEAM_ALPHA )
				shader = CG_MediaShader( cgs.media.shaderElectroBeamBAlpha );
			else
				shader = CG_MediaShader( cgs.media.shaderElectroBeamBBeta );
		}
		else
		{
			shader = CG_MediaShader( cgs.media.shaderElectroBeamB );
		}

		cgpoly = CG_SpawnPolyBeam( start, end, NULL, cg_ebbeam_width->integer, cg_ebbeam_time->value * 1000, cg_ebbeam_time->value * 1000 * 0.4f, shader, 128, 0 );
		cgpoly->angles[ROLL] += 135;
	}
}