This repository has been archived on 2022-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
Xash3DArchive/engine/client/cl_world.c

44 lines
1.0 KiB
C
Raw Normal View History

2009-10-28 22:00:00 +01:00
//=======================================================================
// Copyright XashXT Group 2009 <20>
// cl_world.c - world query functions
//=======================================================================
#include "common.h"
#include "client.h"
#include "const.h"
/*
==================
CL_Trace
UNDONE: trace worldonly
==================
*/
2009-11-02 22:00:00 +01:00
trace_t CL_Trace( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int type, edict_t *e, int mask )
2009-10-28 22:00:00 +01:00
{
2009-11-02 22:00:00 +01:00
moveclip_t clip;
2009-10-28 22:00:00 +01:00
if( !mins ) mins = vec3_origin;
if( !maxs ) maxs = vec3_origin;
Mem_Set( &clip, 0, sizeof( clip ));
// clip to world
2009-11-03 22:00:00 +01:00
CM_BoxTrace( &clip.trace, start, end, mins, maxs, 0, mask, TR_AABB );
2009-10-28 22:00:00 +01:00
clip.trace.pHit = (clip.trace.flFraction != 1.0f) ? EDICT_NUM( 0 ) : NULL;
return clip.trace; // blocked immediately by the world
}
/*
=============
CL_PointContents
UNDONE: contents of worldonly
=============
*/
int CL_PointContents( const vec3_t p )
{
// get base contents from world
2009-11-03 22:00:00 +01:00
return CM_PointContents( p, 0 );
2009-10-28 22:00:00 +01:00
}