From 1f3e70ebd284825788f591666ec73e4b7f5fb986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 3 Jan 2019 14:30:46 -0800 Subject: [PATCH] Added Vec3 round. --- include/bx/inline/math.inl | 10 ++++++++++ include/bx/math.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/include/bx/inline/math.inl b/include/bx/inline/math.inl index 4be1e21..f7ec88e 100644 --- a/include/bx/inline/math.inl +++ b/include/bx/inline/math.inl @@ -361,6 +361,16 @@ namespace bx memCopy(_ptr, &_a, sizeof(Ty) ); } + inline BX_CONSTEXPR_FUNC Vec3 round(const Vec3 _a) + { + return + { + round(_a.x), + round(_a.y), + round(_a.z), + }; + } + inline BX_CONSTEXPR_FUNC Vec3 abs(const Vec3 _a) { return diff --git a/include/bx/math.h b/include/bx/math.h index 29d2aed..d910710 100644 --- a/include/bx/math.h +++ b/include/bx/math.h @@ -275,6 +275,9 @@ namespace bx template void store(void* _ptr, const Ty& _a); + /// + BX_CONSTEXPR_FUNC Vec3 round(const Vec3 _a); + /// BX_CONSTEXPR_FUNC Vec3 abs(const Vec3 _a);