Kaynağa Gözat

Added Vec3 round.

Бранимир Караџић 7 yıl önce
ebeveyn
işleme
1f3e70ebd2
2 değiştirilmiş dosya ile 13 ekleme ve 0 silme
  1. 10 0
      include/bx/inline/math.inl
  2. 3 0
      include/bx/math.h

+ 10 - 0
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

+ 3 - 0
include/bx/math.h

@@ -275,6 +275,9 @@ namespace bx
 	template<typename Ty>
 	void store(void* _ptr, const Ty& _a);
 
+	///
+	BX_CONSTEXPR_FUNC Vec3 round(const Vec3 _a);
+
 	///
 	BX_CONSTEXPR_FUNC Vec3 abs(const Vec3 _a);