@@ -177,11 +177,12 @@ static void CM_TestBoxInBrush( traceWork_t *tw, const cbrush_t *brush )
177
177
178
178
// special test for axial
179
179
// the first 6 brush planes are always axial
180
- if ( tw->bounds [ 0 ][ 0 ] > brush->bounds [ 1 ][ 0 ]
181
- || tw->bounds [ 0 ][ 1 ] > brush->bounds [ 1 ][ 1 ]
182
- || tw->bounds [ 0 ][ 2 ] > brush->bounds [ 1 ][ 2 ]
183
- || tw->bounds [ 1 ][ 0 ] < brush->bounds [ 0 ][ 0 ]
184
- || tw->bounds [ 1 ][ 1 ] < brush->bounds [ 0 ][ 1 ] || tw->bounds [ 1 ][ 2 ] < brush->bounds [ 0 ][ 2 ] )
180
+ if ( tw->bounds .mins [ 0 ] > brush->bounds .maxs [ 0 ]
181
+ || tw->bounds .mins [ 1 ] > brush->bounds .maxs [ 1 ]
182
+ || tw->bounds .mins [ 2 ] > brush->bounds .maxs [ 2 ]
183
+ || tw->bounds .maxs [ 0 ] < brush->bounds .mins [ 0 ]
184
+ || tw->bounds .maxs [ 1 ] < brush->bounds .mins [ 1 ]
185
+ || tw->bounds .maxs [ 2 ] < brush->bounds .mins [ 2 ] )
185
186
{
186
187
return ;
187
188
}
@@ -613,17 +614,17 @@ void CM_PositionTest( traceWork_t *tw )
613
614
leafList_t ll;
614
615
615
616
// identify the leafs we are touching
616
- VectorAdd ( tw->start , tw->size [ 0 ], ll.bounds [ 0 ] );
617
- VectorAdd ( tw->start , tw->size [ 1 ], ll.bounds [ 1 ] );
617
+ VectorAdd ( tw->start , tw->size [ 0 ], ll.bounds . mins );
618
+ VectorAdd ( tw->start , tw->size [ 1 ], ll.bounds . maxs );
618
619
619
620
{
620
- ll.bounds [ 0 ] [ 0 ] -= 1 ;
621
- ll.bounds [ 0 ] [ 1 ] -= 1 ;
622
- ll.bounds [ 0 ] [ 2 ] -= 1 ;
621
+ ll.bounds . mins [ 0 ] -= 1 ;
622
+ ll.bounds . mins [ 1 ] -= 1 ;
623
+ ll.bounds . mins [ 2 ] -= 1 ;
623
624
624
- ll.bounds [ 1 ] [ 0 ] += 1 ;
625
- ll.bounds [ 1 ] [ 1 ] += 1 ;
626
- ll.bounds [ 1 ] [ 2 ] += 1 ;
625
+ ll.bounds . maxs [ 0 ] += 1 ;
626
+ ll.bounds . maxs [ 1 ] += 1 ;
627
+ ll.bounds . maxs [ 2 ] += 1 ;
627
628
}
628
629
629
630
ll.count = 0 ;
@@ -850,7 +851,7 @@ void CM_TraceThroughSurfaceCollide( traceWork_t *tw, const cSurfaceCollide_t *sc
850
851
cFacet_t *facet;
851
852
vec3_t startp, endp;
852
853
853
- if ( !CM_BoundsIntersect ( tw->bounds [ 0 ] , tw->bounds [ 1 ] , sc->bounds [ 0 ] , sc->bounds [ 1 ] ) )
854
+ if ( !CM_BoundsIntersect ( tw->bounds . mins , tw->bounds . maxs , sc->bounds . mins , sc->bounds . maxs ) )
854
855
{
855
856
return ;
856
857
}
@@ -1290,7 +1291,7 @@ void CM_TraceThroughLeaf( traceWork_t *tw, const cLeaf_t *leaf )
1290
1291
continue ;
1291
1292
}
1292
1293
1293
- if ( !CM_BoundsIntersect ( tw->bounds [ 0 ] , tw->bounds [ 1 ] , b->bounds [ 0 ] , b->bounds [ 1 ] ) )
1294
+ if ( !CM_BoundsIntersect ( tw->bounds . mins , tw->bounds . maxs , b->bounds . mins , b->bounds . maxs ) )
1294
1295
{
1295
1296
continue ;
1296
1297
}
@@ -1338,7 +1339,7 @@ void CM_TraceThroughLeaf( traceWork_t *tw, const cLeaf_t *leaf )
1338
1339
continue ;
1339
1340
}
1340
1341
1341
- if ( !CM_BoundsIntersect ( tw->bounds [ 0 ] , tw->bounds [ 1 ] , surface->sc ->bounds [ 0 ] , surface->sc ->bounds [ 1 ] ) )
1342
+ if ( !CM_BoundsIntersect ( tw->bounds . mins , tw->bounds . maxs , surface->sc ->bounds . mins , surface->sc ->bounds . maxs ) )
1342
1343
{
1343
1344
continue ;
1344
1345
}
@@ -1590,12 +1591,12 @@ void CM_TraceCapsuleThroughCapsule( traceWork_t *tw, clipHandle_t model )
1590
1591
CM_ModelBounds ( model, mins, maxs );
1591
1592
1592
1593
// test trace bounds vs. capsule bounds
1593
- if ( tw->bounds [ 0 ] [ 0 ] > maxs[ 0 ] + RADIUS_EPSILON
1594
- || tw->bounds [ 0 ] [ 1 ] > maxs[ 1 ] + RADIUS_EPSILON
1595
- || tw->bounds [ 0 ] [ 2 ] > maxs[ 2 ] + RADIUS_EPSILON
1596
- || tw->bounds [ 1 ] [ 0 ] < mins[ 0 ] - RADIUS_EPSILON
1597
- || tw->bounds [ 1 ] [ 1 ] < mins[ 1 ] - RADIUS_EPSILON
1598
- || tw->bounds [ 1 ] [ 2 ] < mins[ 2 ] - RADIUS_EPSILON )
1594
+ if ( tw->bounds . mins [ 0 ] > maxs[ 0 ] + RADIUS_EPSILON
1595
+ || tw->bounds . mins [ 1 ] > maxs[ 1 ] + RADIUS_EPSILON
1596
+ || tw->bounds . mins [ 2 ] > maxs[ 2 ] + RADIUS_EPSILON
1597
+ || tw->bounds . maxs [ 0 ] < mins[ 0 ] - RADIUS_EPSILON
1598
+ || tw->bounds . maxs [ 1 ] < mins[ 1 ] - RADIUS_EPSILON
1599
+ || tw->bounds . maxs [ 2 ] < mins[ 2 ] - RADIUS_EPSILON )
1599
1600
{
1600
1601
return ;
1601
1602
}
@@ -1964,13 +1965,13 @@ static void CM_Trace( trace_t *results, const vec3_t start, const vec3_t end, co
1964
1965
{
1965
1966
if ( tw.start [ i ] < tw.end [ i ] )
1966
1967
{
1967
- tw.bounds [ 0 ] [ i ] = tw.start [ i ] - fabsf ( tw.sphere .offset [ i ] ) - tw.sphere .radius ;
1968
- tw.bounds [ 1 ] [ i ] = tw.end [ i ] + fabsf ( tw.sphere .offset [ i ] ) + tw.sphere .radius ;
1968
+ tw.bounds . mins [ i ] = tw.start [ i ] - fabsf ( tw.sphere .offset [ i ] ) - tw.sphere .radius ;
1969
+ tw.bounds . maxs [ i ] = tw.end [ i ] + fabsf ( tw.sphere .offset [ i ] ) + tw.sphere .radius ;
1969
1970
}
1970
1971
else
1971
1972
{
1972
- tw.bounds [ 0 ] [ i ] = tw.end [ i ] - fabsf ( tw.sphere .offset [ i ] ) - tw.sphere .radius ;
1973
- tw.bounds [ 1 ] [ i ] = tw.start [ i ] + fabsf ( tw.sphere .offset [ i ] ) + tw.sphere .radius ;
1973
+ tw.bounds . mins [ i ] = tw.end [ i ] - fabsf ( tw.sphere .offset [ i ] ) - tw.sphere .radius ;
1974
+ tw.bounds . maxs [ i ] = tw.start [ i ] + fabsf ( tw.sphere .offset [ i ] ) + tw.sphere .radius ;
1974
1975
}
1975
1976
}
1976
1977
}
@@ -1980,13 +1981,13 @@ static void CM_Trace( trace_t *results, const vec3_t start, const vec3_t end, co
1980
1981
{
1981
1982
if ( tw.start [ i ] < tw.end [ i ] )
1982
1983
{
1983
- tw.bounds [ 0 ] [ i ] = tw.start [ i ] + tw.size [ 0 ][ i ];
1984
- tw.bounds [ 1 ] [ i ] = tw.end [ i ] + tw.size [ 1 ][ i ];
1984
+ tw.bounds . mins [ i ] = tw.start [ i ] + tw.size [ 0 ][ i ];
1985
+ tw.bounds . maxs [ i ] = tw.end [ i ] + tw.size [ 1 ][ i ];
1985
1986
}
1986
1987
else
1987
1988
{
1988
- tw.bounds [ 0 ] [ i ] = tw.end [ i ] + tw.size [ 0 ][ i ];
1989
- tw.bounds [ 1 ] [ i ] = tw.start [ i ] + tw.size [ 1 ][ i ];
1989
+ tw.bounds . mins [ i ] = tw.end [ i ] + tw.size [ 0 ][ i ];
1990
+ tw.bounds . maxs [ i ] = tw.start [ i ] + tw.size [ 1 ][ i ];
1990
1991
}
1991
1992
}
1992
1993
}
0 commit comments