From 6c25c3f57482981f08bcb7a1b2224321ea8aeb33 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sat, 9 Jul 2011 10:42:45 +0100 Subject: [PATCH] New convenience functions for creating vectors --- include/Maths.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/Maths.hpp b/include/Maths.hpp index 1b1f4ed..0ccbae0 100644 --- a/include/Maths.hpp +++ b/include/Maths.hpp @@ -218,6 +218,22 @@ inline Vector make_vector(T x, T y, T z) return Vector(x, y, z); } +template +inline VectorI make_vector_i(X x, Y y, Z z) +{ + return make_vector(static_cast(x), + static_cast(y), + static_cast(z)); +} + +template +inline VectorF make_vector_f(X x, Y y, Z z) +{ + return make_vector(static_cast(x), + static_cast(y), + static_cast(z)); +} + // Find a surface normal template Vector surface_normal(const Vector& a, const Vector& b, -- 2.39.2