Ejemplo n.º 1
0
void V_GetChasePos(int target, float * cl_angles, float * origin, float * angles)
{
	cl_entity_t	 *	ent = NULL;
	cl_entity_t *local = gEngfuncs.GetLocalPlayer();

	if ( target )
	{
		ent = gEngfuncs.GetEntityByIndex( target );
	}

	if (!ent)
	{
		// just copy a save in-map position
		VectorCopy ( vJumpAngles, angles );
		VectorCopy ( vJumpOrigin, origin );
		return;
	}


	if( ent->index == local->index )
	{
		if ( g_iUser3 && g_iUser3 != 1 )
			V_GetDeathCam( ent, gEngfuncs.GetEntityByIndex( g_iUser3 ),
						   angles, origin );
		else
			V_GetDeathCam( ent, NULL,
						   angles, origin );
	}
	else if ( gHUD.m_Spectator.m_autoDirector->value )
	{
		if ( g_iUser3 && g_iUser3 != 1 )
			V_GetDirectedChasePosition( ent, gEngfuncs.GetEntityByIndex( g_iUser3 ),
										angles, origin );
		else
			V_GetDirectedChasePosition( ent, (cl_entity_t*)0xFFFFFFFF,
										angles, origin );
	}
	else
	{
		if ( cl_angles == NULL )	// no mouse angles given, use entity angles ( locked mode )
		{
			VectorCopy ( ent->angles, angles);
			angles[0]*=-1;
		}
		else
			VectorCopy ( cl_angles, angles);


		VectorCopy ( ent->origin, origin);

		origin[2]+= 28; // DEFAULT_VIEWHEIGHT - some offset

		V_GetChaseOrigin( angles, origin, cl_chasedist->value, origin );
	}

	v_resetCamera = false;
}
Ejemplo n.º 2
0
void V_GetChasePos(int target, const Vector* cl_angles, Vector& origin, Vector& angles)
{
	cl_entity_t	 *	ent = NULL;
	
	if ( target ) 
	{
		ent = gEngfuncs.GetEntityByIndex( target );
	};
	
	if (!ent)
	{
		// just copy a save in-map position
		angles = vJumpAngles;
		origin = vJumpOrigin;
		return;
	}
	
	
	
	if ( gHUD.m_Spectator.m_autoDirector->value )
	{
		if ( g_iUser3 )
			V_GetDirectedChasePosition( ent, gEngfuncs.GetEntityByIndex( g_iUser3 ),
				angles, origin );
		else
			V_GetDirectedChasePosition( ent, ( cl_entity_t*)0xFFFFFFFF,
				angles, origin );
	}
	else
	{
		if ( cl_angles == nullptr )	// no mouse angles given, use entity angles ( locked mode )
		{
			angles = ent->angles;
			angles[0]*=-1;
		}
		else
			angles = *cl_angles;


		origin = ent->origin;
		
		origin[2]+= DEFAULT_VIEWHEIGHT; // - some offset

		V_GetChaseOrigin( angles, origin, cl_chasedist->value, origin );
	}

	v_resetCamera = false;	
}