diff --git a/etk/math/Vector2D.h b/etk/math/Vector2D.h index cf6fab1..7f25a88 100644 --- a/etk/math/Vector2D.h +++ b/etk/math/Vector2D.h @@ -372,7 +372,6 @@ namespace etk etk::CCout& operator <<(etk::CCout &os, const etk::Vector2D obj); }; - // To siplify the writing of the code ==> this permit to have the same name with the glsl language... typedef etk::Vector2D vec2; typedef etk::Vector2D ivec2; @@ -380,4 +379,14 @@ typedef etk::Vector2D ivec2; typedef etk::Vector2D uivec2; typedef etk::Vector2D bvec2; +inline vec2 vec2ClipInt32(const vec2& val) +{ + return vec2((int32_t)val.x(), (int32_t)val.y()); +} + +inline vec2 vec2ClipInt64(const vec2& val) +{ + return vec2((int64_t)val.x(), (int64_t)val.y()); +} + #endif diff --git a/etk/math/Vector3D.h b/etk/math/Vector3D.h index 5f09151..6e5fa4c 100644 --- a/etk/math/Vector3D.h +++ b/etk/math/Vector3D.h @@ -461,6 +461,15 @@ typedef etk::Vector3D bvec3; vec3 quaternionToEulerXYZ(const btQuaternion& quat); +inline vec3 vec3ClipInt32(const vec3& val) +{ + return vec3((int32_t)val.x(), (int32_t)val.y(), (int32_t)val.z()); +} +inline vec3 vec3ClipInt64(const vec3& val) +{ + return vec3((int64_t)val.x(), (int64_t)val.y(), (int64_t)val.z()); +} + #endif