Exemple #1
0
/*
================
PM_TestPlayerPosition

Returns false if the given player position is not valid (in solid)
================
*/
qbool PM_TestPlayerPosition (playermove_t *pm, vec3_t pos)
{
	int			i;
	physent_t	*pe;
	vec3_t		mins, maxs, offset, test;
	hull_t		*hull;

	for (i=0 ; i< pm->numphysent ; i++)
	{
		pe = &pm->physents[i];
	// get the clipping hull
		if (pe->model)
		{
			hull = &pm->physents[i].model->hulls[1];
			VectorSubtract (hull->clip_mins, player_mins, offset);
			VectorAdd (offset, pe->origin, offset);
		}
		else
		{
			VectorSubtract (pe->mins, player_maxs, mins);
			VectorSubtract (pe->maxs, player_mins, maxs);
			hull = CM_HullForBox (mins, maxs);
			VectorCopy (pe->origin, offset);
		}

		VectorSubtract (pos, offset, test);

		if (CM_HullPointContents (hull, hull->firstclipnode, test) == CONTENTS_SOLID)
			return false;
	}

	return true;
}
Exemple #2
0
/*
==================
PM_PointContents
==================
*/
int PM_PointContents (vec3_t p)
{
    hull_t *hull = &pmove.physents[0].model->hulls[0];
    return CM_HullPointContents (hull, hull->firstclipnode, p);
}
Exemple #3
0
/*
==================
SV_PointContents

==================
*/
int SV_PointContents (vec3_t p)
{
	return CM_HullPointContents (&sv.worldmodel->hulls[0], sv.worldmodel->hulls[0].firstclipnode, p);
}
Exemple #4
0
/*
==================
PM_PointContents
==================
*/
int PM_PointContents (playermove_t *pm, vec3_t p)
{
	hull_t *hull = &pm->physents[0].model->hulls[0];
	return CM_HullPointContents (hull, hull->firstclipnode, p);
}