medfall

A super great game engine
Log | Files | Refs

commit 7d1d19dd607aa365a7360080f774f260ef0e57ea
parent 7b19d447128a32811ad70d5ba8760b7ab3f4c5d4
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Wed Jun 28 21:52:52 +0300

ggformat AABB/AABBu32/v3u32

Diffstat:
aabb.h | 17+++++++++++++++++
linear_algebra.h | 10++++++++++
2 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/aabb.h b/aabb.h @@ -2,6 +2,7 @@ #include "intrinsics.h" #include "linear_algebra.h" +#include "ggformat.h" enum Quadrant { QUADRANT_SW, @@ -101,3 +102,19 @@ forceinline AABBu32 AABBu32::clamp_z( u32 lo, u32 hi ) { mx.z = min( mx.z, hi ); return AABBu32( mn, mx ); } + +inline void format( FormatBuffer * fb, const AABB & aabb, const FormatOpts & opts ) { + format( fb, "AABB(" ); + format( fb, aabb.mins, opts ); + format( fb, ", " ); + format( fb, aabb.maxs, opts ); + format( fb, ")" ); +} + +inline void format( FormatBuffer * fb, const AABBu32 & aabb, const FormatOpts & opts ) { + format( fb, "AABBu32(" ); + format( fb, aabb.mins, opts ); + format( fb, ", " ); + format( fb, aabb.maxs, opts ); + format( fb, ")" ); +} diff --git a/linear_algebra.h b/linear_algebra.h @@ -817,6 +817,16 @@ inline void format( FormatBuffer * fb, const v3 & v, const FormatOpts & opts ) { format( fb, ")" ); } +inline void format( FormatBuffer * fb, const v3u32 & v, const FormatOpts & opts ) { + format( fb, "v3u32(" ); + format( fb, v.x, opts ); + format( fb, ", " ); + format( fb, v.y, opts ); + format( fb, ", " ); + format( fb, v.z, opts ); + format( fb, ")" ); +} + inline void format( FormatBuffer * fb, const v4 & v, const FormatOpts & opts ) { format( fb, "v4(" ); format( fb, v.x, opts );