summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2005-12-20 00:53:13 +0000
committerTim Angus <tim@ngus.net>2005-12-20 00:53:13 +0000
commit611eb5ee8a55d5aa473c48f8f9436a01e3f0cdb7 (patch)
treee2c52d2d0c43e5343df017c7578fb99275a8bfed /src/server
parent65b823bf367034c204d370a6a73965a196072153 (diff)
* New collision type, for improved light flares
Diffstat (limited to 'src/server')
-rw-r--r--src/server/server.h4
-rw-r--r--src/server/sv_game.c12
-rw-r--r--src/server/sv_world.c14
3 files changed, 15 insertions, 15 deletions
diff --git a/src/server/server.h b/src/server/server.h
index da5e0947..3a0924a5 100644
--- a/src/server/server.h
+++ b/src/server/server.h
@@ -384,7 +384,7 @@ int SV_PointContents( const vec3_t p, int passEntityNum );
// returns the CONTENTS_* value from the world and all entities at the given point.
-void SV_Trace( trace_t *results, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask, int capsule );
+void SV_Trace( trace_t *results, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask, traceType_t type );
// mins and maxs are relative
// if the entire move stays in a solid volume, trace.allsolid will be set,
@@ -396,7 +396,7 @@ void SV_Trace( trace_t *results, const vec3_t start, vec3_t mins, vec3_t maxs, c
// passEntityNum is explicitly excluded from clipping checks (normally ENTITYNUM_NONE)
-void SV_ClipToEntity( trace_t *trace, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int entityNum, int contentmask, int capsule );
+void SV_ClipToEntity( trace_t *trace, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int entityNum, int contentmask, traceType_t type );
// clip to a specific entity
//
diff --git a/src/server/sv_game.c b/src/server/sv_game.c
index 2d07fab7..b89ea920 100644
--- a/src/server/sv_game.c
+++ b/src/server/sv_game.c
@@ -226,7 +226,7 @@ void SV_AdjustAreaPortalState( sharedEntity_t *ent, qboolean open ) {
SV_GameAreaEntities
==================
*/
-qboolean SV_EntityContact( vec3_t mins, vec3_t maxs, const sharedEntity_t *gEnt, int capsule ) {
+qboolean SV_EntityContact( vec3_t mins, vec3_t maxs, const sharedEntity_t *gEnt, traceType_t type ) {
const float *origin, *angles;
clipHandle_t ch;
trace_t trace;
@@ -237,7 +237,7 @@ qboolean SV_EntityContact( vec3_t mins, vec3_t maxs, const sharedEntity_t *gEnt,
ch = SV_ClipHandleForEntity( gEnt );
CM_TransformedBoxTrace ( &trace, vec3_origin, vec3_origin, mins, maxs,
- ch, -1, origin, angles, capsule );
+ ch, -1, origin, angles, type );
return trace.startsolid;
}
@@ -373,14 +373,14 @@ long SV_GameSystemCalls( long *args ) {
case G_ENTITIES_IN_BOX:
return SV_AreaEntities( VMA(1), VMA(2), VMA(3), args[4] );
case G_ENTITY_CONTACT:
- return SV_EntityContact( VMA(1), VMA(2), VMA(3), /*int capsule*/ qfalse );
+ return SV_EntityContact( VMA(1), VMA(2), VMA(3), TT_AABB );
case G_ENTITY_CONTACTCAPSULE:
- return SV_EntityContact( VMA(1), VMA(2), VMA(3), /*int capsule*/ qtrue );
+ return SV_EntityContact( VMA(1), VMA(2), VMA(3), TT_CAPSULE );
case G_TRACE:
- SV_Trace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], /*int capsule*/ qfalse );
+ SV_Trace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], TT_AABB );
return 0;
case G_TRACECAPSULE:
- SV_Trace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], /*int capsule*/ qtrue );
+ SV_Trace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], TT_CAPSULE );
return 0;
case G_POINT_CONTENTS:
return SV_PointContents( VMA(1), args[2] );
diff --git a/src/server/sv_world.c b/src/server/sv_world.c
index 2060985d..d40cc217 100644
--- a/src/server/sv_world.c
+++ b/src/server/sv_world.c
@@ -456,7 +456,7 @@ typedef struct {
trace_t trace;
int passEntityNum;
int contentmask;
- int capsule;
+ traceType_t collisionType;
} moveclip_t;
@@ -466,7 +466,7 @@ SV_ClipToEntity
====================
*/
-void SV_ClipToEntity( trace_t *trace, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int entityNum, int contentmask, int capsule ) {
+void SV_ClipToEntity( trace_t *trace, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int entityNum, int contentmask, traceType_t type ) {
sharedEntity_t *touch;
clipHandle_t clipHandle;
float *origin, *angles;
@@ -494,7 +494,7 @@ void SV_ClipToEntity( trace_t *trace, const vec3_t start, const vec3_t mins, con
CM_TransformedBoxTrace ( trace, (float *)start, (float *)end,
(float *)mins, (float *)maxs, clipHandle, contentmask,
- origin, angles, capsule);
+ origin, angles, type);
if ( trace->fraction < 1 ) {
trace->entityNum = touch->s.number;
@@ -566,7 +566,7 @@ void SV_ClipMoveToEntities( moveclip_t *clip ) {
CM_TransformedBoxTrace ( &trace, (float *)clip->start, (float *)clip->end,
(float *)clip->mins, (float *)clip->maxs, clipHandle, clip->contentmask,
- origin, angles, clip->capsule);
+ origin, angles, clip->collisionType);
if ( trace.allsolid ) {
clip->trace.allsolid = qtrue;
@@ -598,7 +598,7 @@ Moves the given mins/maxs volume through the world from start to end.
passEntityNum and entities owned by passEntityNum are explicitly not checked.
==================
*/
-void SV_Trace( trace_t *results, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask, int capsule ) {
+void SV_Trace( trace_t *results, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask, traceType_t type ) {
moveclip_t clip;
int i;
@@ -612,7 +612,7 @@ void SV_Trace( trace_t *results, const vec3_t start, vec3_t mins, vec3_t maxs, c
Com_Memset ( &clip, 0, sizeof ( moveclip_t ) );
// clip to world
- CM_BoxTrace( &clip.trace, start, end, mins, maxs, 0, contentmask, capsule );
+ CM_BoxTrace( &clip.trace, start, end, mins, maxs, 0, contentmask, type );
clip.trace.entityNum = clip.trace.fraction != 1.0 ? ENTITYNUM_WORLD : ENTITYNUM_NONE;
if ( clip.trace.fraction == 0 ) {
*results = clip.trace;
@@ -626,7 +626,7 @@ void SV_Trace( trace_t *results, const vec3_t start, vec3_t mins, vec3_t maxs, c
clip.mins = mins;
clip.maxs = maxs;
clip.passEntityNum = passEntityNum;
- clip.capsule = capsule;
+ clip.collisionType = type;
// create the bounding box of the entire move
// we can limit it to the part of the move not