mathlib: add AddPointToBounds, ClearBounds
This commit is contained in:
parent
0ebbdac5f9
commit
5893c16267
|
|
@ -102,6 +102,26 @@ VecStrf(const vec3_t vec)
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClearBounds(vec3_t mins, vec3_t maxs)
|
||||||
|
{
|
||||||
|
for (int i=0; i<3; i++) {
|
||||||
|
mins[i] = VECT_MAX;
|
||||||
|
maxs[i] = -VECT_MAX;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPointToBounds(const vec3_t v, vec3_t mins, vec3_t maxs)
|
||||||
|
{
|
||||||
|
for (int i=0; i<3; i++) {
|
||||||
|
const vec_t val = v[i];
|
||||||
|
|
||||||
|
if (val < mins[i])
|
||||||
|
mins[i] = val;
|
||||||
|
if (val > maxs[i])
|
||||||
|
maxs[i] = val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// from http://mathworld.wolfram.com/SpherePointPicking.html
|
// from http://mathworld.wolfram.com/SpherePointPicking.html
|
||||||
// eqns 6,7,8
|
// eqns 6,7,8
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,9 @@ VectorCopyFromGLM(const qvec3f &in, vec3_t out)
|
||||||
out[2] = in[2];
|
out[2] = in[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClearBounds(vec3_t mins, vec3_t maxs);
|
||||||
|
void AddPointToBounds(const vec3_t v, vec3_t mins, vec3_t maxs);
|
||||||
|
|
||||||
static inline qvec3f
|
static inline qvec3f
|
||||||
VectorToGLM(const vec3_t in)
|
VectorToGLM(const vec3_t in)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue