From 4b4f3fbbaaca7a9d7e623e2e09455f7a4f714f84 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 1 Apr 2013 23:02:26 +0200 Subject: [PATCH] Fixed space characters and improved forward declaration, including extensions --- glm/fwd.hpp | 655 +++++++++++++++++++++++++++++++++++ glm/gtc/epsilon.inl | 80 ++--- glm/gtc/half_float.inl | 78 ++--- glm/gtc/matrix_access.hpp | 4 +- glm/gtc/matrix_access.inl | 8 +- glm/gtc/matrix_inverse.inl | 4 +- glm/gtc/matrix_transform.inl | 11 +- glm/gtc/noise.hpp | 8 +- glm/gtc/noise.inl | 10 +- glm/gtc/quaternion.hpp | 35 -- glm/gtc/quaternion.inl | 6 +- glm/gtc/type_ptr.hpp | 64 ++-- glm/gtc/type_ptr.inl | 34 +- glm/gtc/ulp.hpp | 40 +-- glm/gtc/ulp.inl | 70 ++-- 15 files changed, 863 insertions(+), 244 deletions(-) diff --git a/glm/fwd.hpp b/glm/fwd.hpp index fbe89683..d389eac1 100644 --- a/glm/fwd.hpp +++ b/glm/fwd.hpp @@ -34,4 +34,659 @@ #include "core/type_vec.hpp" #include "core/type_mat.hpp" +////////////////////// +// GLM_GTC_quaternion +namespace glm{ +namespace detail +{ + template struct tquat; + +}//namespace detail + + /// Quaternion of floating-point numbers. + /// + /// @see gtc_quaternion + typedef detail::tquat quat; + + /// Quaternion of half-precision floating-point numbers. + /// + /// @see gtc_quaternion + typedef detail::tquat hquat; + + /// Quaternion of single-precision floating-point numbers. + /// + /// @see gtc_quaternion + typedef detail::tquat fquat; + + /// Quaternion of double-precision floating-point numbers. + /// + /// @see gtc_quaternion + typedef detail::tquat dquat; + + /// Quaternion of low precision floating-point numbers. + /// + /// @see gtc_quaternion + typedef detail::tquat lowp_quat; + + /// Quaternion of medium precision floating-point numbers. + /// + /// @see gtc_quaternion + typedef detail::tquat mediump_quat; + + /// Quaternion of high precision floating-point numbers. + /// + /// @see gtc_quaternion + typedef detail::tquat highp_quat; + +}//namespace glm + +////////////////////// +// GLM_GTC_precision +namespace glm +{ + /// @addtogroup gtc_type_precision + /// @{ + + /// 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 int8; + + /// 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 int16; + + /// 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 int32; + + /// 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 int64; + + + /// 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 int8_t; + + /// 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 int16_t; + + /// 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 int32_t; + + /// 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 int64_t; + + + /// 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 i8; + + /// 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 i16; + + /// 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 i32; + + /// 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 i64; + + + /// 8 bit signed integer scalar type. + /// @see gtc_type_precision + typedef detail::tvec1 i8vec1; + + /// 8 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef detail::tvec2 i8vec2; + + /// 8 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef detail::tvec3 i8vec3; + + /// 8 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef detail::tvec4 i8vec4; + + + /// 16 bit signed integer scalar type. + /// @see gtc_type_precision + typedef detail::tvec1 i16vec1; + + /// 16 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef detail::tvec2 i16vec2; + + /// 16 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef detail::tvec3 i16vec3; + + /// 16 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef detail::tvec4 i16vec4; + + + /// 32 bit signed integer scalar type. + /// @see gtc_type_precision + typedef detail::tvec1 i32vec1; + + /// 32 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef detail::tvec2 i32vec2; + + /// 32 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef detail::tvec3 i32vec3; + + /// 32 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef detail::tvec4 i32vec4; + + + /// 64 bit signed integer scalar type. + /// @see gtc_type_precision + typedef detail::tvec1 i64vec1; + + /// 64 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef detail::tvec2 i64vec2; + + /// 64 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef detail::tvec3 i64vec3; + + /// 64 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef detail::tvec4 i64vec4; + + + ///////////////////////////// + // Unsigned int vector types + + /// 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 uint8; + + /// 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 uint16; + + /// 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 uint32; + + /// 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 uint64; + + + /// 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 uint8_t; + + /// 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 uint16_t; + + /// 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 uint32_t; + + /// 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 uint64_t; + + + /// 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 u8; + + /// 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 u16; + + /// 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 u32; + + /// 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 u64; + + + /// 8 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef detail::tvec1 u8vec1; + + /// 8 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef detail::tvec2 u8vec2; + + /// 8 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef detail::tvec3 u8vec3; + + /// 8 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef detail::tvec4 u8vec4; + + + /// 16 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef detail::tvec1 u16vec1; + + /// 16 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef detail::tvec2 u16vec2; + + /// 16 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef detail::tvec3 u16vec3; + + /// 16 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef detail::tvec4 u16vec4; + + + /// 32 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef detail::tvec1 u32vec1; + + /// 32 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef detail::tvec2 u32vec2; + + /// 32 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef detail::tvec3 u32vec3; + + /// 32 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef detail::tvec4 u32vec4; + + + /// 64 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef detail::tvec1 u64vec1; + + /// 64 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef detail::tvec2 u64vec2; + + /// 64 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef detail::tvec3 u64vec3; + + /// 64 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef detail::tvec4 u64vec4; + + + ////////////////////// + // Float vector types + + /// 16 bit half-precision floating-point scalar. + /// @see gtc_type_precision + typedef detail::float16 float16; + + /// 32 bit single-precision floating-point scalar. + /// @see gtc_type_precision + typedef detail::float32 float32; + + /// 64 bit double-precision floating-point scalar. + /// @see gtc_type_precision + typedef detail::float64 float64; + + + /// 16 bit half-precision floating-point scalar. + /// @see gtc_type_precision + typedef detail::float16 float16_t; + + /// 32 bit single-precision floating-point scalar. + /// @see gtc_type_precision + typedef detail::float32 float32_t; + + /// 64 bit double-precision floating-point scalar. + /// @see gtc_type_precision + typedef detail::float64 float64_t; + + + /// 16 bit half-precision floating-point scalar. + /// @see gtc_type_precision + typedef float16 f16; + + /// 32 bit single-precision floating-point scalar. + /// @see gtc_type_precision + typedef float32 f32; + + /// 64 bit double-precision floating-point scalar. + /// @see gtc_type_precision + typedef float64 f64; + + + /// Single-precision floating-point vector of 1 component. + /// @see gtc_type_precision + typedef detail::tvec1 fvec1; + + /// Single-precision floating-point vector of 2 components. + /// @see gtc_type_precision + typedef detail::tvec2 fvec2; + + /// Single-precision floating-point vector of 3 components. + /// @see gtc_type_precision + typedef detail::tvec3 fvec3; + + /// Single-precision floating-point vector of 4 components. + /// @see gtc_type_precision + typedef detail::tvec4 fvec4; + + + /// Half-precision floating-point vector of 1 component. + /// @see gtc_type_precision + typedef detail::tvec1 f16vec1; + + /// Half-precision floating-point vector of 2 components. + /// @see gtc_type_precision + typedef detail::tvec2 f16vec2; + + /// Half-precision floating-point vector of 3 components. + /// @see gtc_type_precision + typedef detail::tvec3 f16vec3; + + /// Half-precision floating-point vector of 4 components. + /// @see gtc_type_precision + typedef detail::tvec4 f16vec4; + + + /// Single-precision floating-point vector of 1 component. + /// @see gtc_type_precision + typedef detail::tvec1 f32vec1; + + /// Single-precision floating-point vector of 2 components. + /// @see gtc_type_precision + typedef detail::tvec2 f32vec2; + + /// Single-precision floating-point vector of 3 components. + /// @see gtc_type_precision + typedef detail::tvec3 f32vec3; + + /// Single-precision floating-point vector of 4 components. + /// @see gtc_type_precision + typedef detail::tvec4 f32vec4; + + + /// Double-precision floating-point vector of 1 component. + /// @see gtc_type_precision + typedef detail::tvec1 f64vec1; + + /// Double-precision floating-point vector of 2 components. + /// @see gtc_type_precision + typedef detail::tvec2 f64vec2; + + /// Double-precision floating-point vector of 3 components. + /// @see gtc_type_precision + typedef detail::tvec3 f64vec3; + + /// Double-precision floating-point vector of 4 components. + /// @see gtc_type_precision + typedef detail::tvec4 f64vec4; + + + ////////////////////// + // Float matrix types + + /// Single-precision floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 fmat1; + + /// Single-precision floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x2 fmat2; + + /// Single-precision floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x3 fmat3; + + /// Single-precision floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x4 fmat4; + + + /// Single-precision floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 fmat1x1; + + /// Single-precision floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x2 fmat2x2; + + /// Single-precision floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x3 fmat2x3; + + /// Single-precision floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x4 fmat2x4; + + /// Single-precision floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x2 fmat3x2; + + /// Single-precision floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x3 fmat3x3; + + /// Single-precision floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x4 fmat3x4; + + /// Single-precision floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x2 fmat4x2; + + /// Single-precision floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x3 fmat4x3; + + /// Single-precision floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x4 fmat4x4; + + + /// Half-precision floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f16mat1; + + /// Half-precision floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x2 f16mat2; + + /// Half-precision floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x3 f16mat3; + + /// Half-precision floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x4 f16mat4; + + + /// Half-precision floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f16 f16mat1x1; + + /// Half-precision floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x2 f16mat2x2; + + /// Half-precision floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x3 f16mat2x3; + + /// Half-precision floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x4 f16mat2x4; + + /// Half-precision floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x2 f16mat3x2; + + /// Half-precision floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x3 f16mat3x3; + + /// Half-precision floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x4 f16mat3x4; + + /// Half-precision floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x2 f16mat4x2; + + /// Half-precision floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x3 f16mat4x3; + + /// Half-precision floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x4 f16mat4x4; + + + /// Single-precision floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f32mat1; + + /// Single-precision floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x2 f32mat2; + + /// Single-precision floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x3 f32mat3; + + /// Single-precision floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x4 f32mat4; + + + /// Single-precision floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 f32mat1x1; + + /// Single-precision floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x2 f32mat2x2; + + /// Single-precision floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x3 f32mat2x3; + + /// Single-precision floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x4 f32mat2x4; + + /// Single-precision floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x2 f32mat3x2; + + /// Single-precision floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x3 f32mat3x3; + + /// Single-precision floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x4 f32mat3x4; + + /// Single-precision floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x2 f32mat4x2; + + /// Single-precision floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x3 f32mat4x3; + + /// Single-precision floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x4 f32mat4x4; + + + /// Double-precision floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f64mat1; + + /// Double-precision floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x2 f64mat2; + + /// Double-precision floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x3 f64mat3; + + /// Double-precision floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x4 f64mat4; + + + /// Double-precision floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f64 f64mat1x1; + + /// Double-precision floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x2 f64mat2x2; + + /// Double-precision floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x3 f64mat2x3; + + /// Double-precision floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat2x4 f64mat2x4; + + /// Double-precision floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x2 f64mat3x2; + + /// Double-precision floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x3 f64mat3x3; + + /// Double-precision floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat3x4 f64mat3x4; + + /// Double-precision floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x2 f64mat4x2; + + /// Double-precision floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x3 f64mat4x3; + + /// Double-precision floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef detail::tmat4x4 f64mat4x4; + + + ////////////////////////// + // Quaternion types + + /// Half-precision floating-point quaternion. + /// @see gtc_type_precision + typedef detail::tquat f16quat; + + /// Single-precision floating-point quaternion. + /// @see gtc_type_precision + typedef detail::tquat f32quat; + + /// Double-precision floating-point quaternion. + /// @see gtc_type_precision + typedef detail::tquat f64quat; +}//namespace glm + #endif//GLM_FWD_INCLUDED diff --git a/glm/gtc/epsilon.inl b/glm/gtc/epsilon.inl index ecfc4aa5..770943a8 100644 --- a/glm/gtc/epsilon.inl +++ b/glm/gtc/epsilon.inl @@ -30,8 +30,8 @@ namespace glm { GLM_FUNC_QUALIFIER bool epsilonEqual ( - glm::half const & x, - glm::half const & y, + glm::half const & x, + glm::half const & y, glm::half const & epsilon ) { @@ -40,8 +40,8 @@ namespace glm GLM_FUNC_QUALIFIER bool epsilonEqual ( - float const & x, - float const & y, + float const & x, + float const & y, float const & epsilon ) { @@ -50,8 +50,8 @@ namespace glm GLM_FUNC_QUALIFIER bool epsilonEqual ( - double const & x, - double const & y, + double const & x, + double const & y, double const & epsilon ) { @@ -60,8 +60,8 @@ namespace glm GLM_FUNC_QUALIFIER bool epsilonNotEqual ( - glm::half const & x, - glm::half const & y, + glm::half const & x, + glm::half const & y, glm::half const & epsilon ) { @@ -70,8 +70,8 @@ namespace glm GLM_FUNC_QUALIFIER bool epsilonNotEqual ( - float const & x, - float const & y, + float const & x, + float const & y, float const & epsilon ) { @@ -80,8 +80,8 @@ namespace glm GLM_FUNC_QUALIFIER bool epsilonNotEqual ( - double const & x, - double const & y, + double const & x, + double const & y, double const & epsilon ) { @@ -91,8 +91,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tvec2 epsilonEqual ( - detail::tvec2 const & x, - detail::tvec2 const & y, + detail::tvec2 const & x, + detail::tvec2 const & y, valType const & epsilon) { return detail::tvec2( @@ -103,8 +103,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tvec2 epsilonEqual ( - detail::tvec2 const & x, - detail::tvec2 const & y, + detail::tvec2 const & x, + detail::tvec2 const & y, detail::tvec2 const & epsilon ) { @@ -116,8 +116,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tvec3 epsilonEqual ( - detail::tvec3 const & x, - detail::tvec3 const & y, + detail::tvec3 const & x, + detail::tvec3 const & y, valType const & epsilon) { return detail::tvec3( @@ -129,8 +129,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tvec3 epsilonEqual ( - detail::tvec3 const & x, - detail::tvec3 const & y, + detail::tvec3 const & x, + detail::tvec3 const & y, detail::tvec3 const & epsilon ) { @@ -143,8 +143,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tvec4 epsilonEqual ( - detail::tvec4 const & x, - detail::tvec4 const & y, + detail::tvec4 const & x, + detail::tvec4 const & y, valType const & epsilon ) { @@ -158,8 +158,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tvec4 epsilonEqual ( - detail::tvec4 const & x, - detail::tvec4 const & y, + detail::tvec4 const & x, + detail::tvec4 const & y, detail::tvec4 const & epsilon ) { @@ -173,8 +173,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tvec2 epsilonNotEqual ( - detail::tvec2 const & x, - detail::tvec2 const & y, + detail::tvec2 const & x, + detail::tvec2 const & y, valType const & epsilon ) { @@ -186,8 +186,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tvec2 epsilonNotEqual ( - detail::tvec2 const & x, - detail::tvec2 const & y, + detail::tvec2 const & x, + detail::tvec2 const & y, detail::tvec2 const & epsilon ) { @@ -199,8 +199,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tvec3 epsilonNotEqual ( - detail::tvec3 const & x, - detail::tvec3 const & y, + detail::tvec3 const & x, + detail::tvec3 const & y, valType const & epsilon ) { @@ -213,8 +213,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tvec3 epsilonNotEqual ( - detail::tvec3 const & x, - detail::tvec3 const & y, + detail::tvec3 const & x, + detail::tvec3 const & y, detail::tvec3 const & epsilon ) { @@ -227,8 +227,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tvec4 epsilonNotEqual ( - detail::tvec4 const & x, - detail::tvec4 const & y, + detail::tvec4 const & x, + detail::tvec4 const & y, valType const & epsilon ) { @@ -242,8 +242,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tvec4 epsilonNotEqual ( - detail::tvec4 const & x, - detail::tvec4 const & y, + detail::tvec4 const & x, + detail::tvec4 const & y, detail::tvec4 const & epsilon ) { @@ -257,8 +257,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tvec4 epsilonEqual ( - detail::tquat const & x, - detail::tquat const & y, + detail::tquat const & x, + detail::tquat const & y, valType const & epsilon ) { @@ -272,8 +272,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tvec4 epsilonNotEqual ( - detail::tquat const & x, - detail::tquat const & y, + detail::tquat const & x, + detail::tquat const & y, valType const & epsilon ) { diff --git a/glm/gtc/half_float.inl b/glm/gtc/half_float.inl index 57dae8ee..033f917b 100644 --- a/glm/gtc/half_float.inl +++ b/glm/gtc/half_float.inl @@ -88,7 +88,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec2::tvec2 ( - half const & s1, + half const & s1, half const & s2 ) : x(s1), @@ -372,8 +372,8 @@ namespace detail GLM_FUNC_QUALIFIER tvec3::tvec3 ( - half const & s0, - half const & s1, + half const & s0, + half const & s1, half const & s2 ) : x(s0), @@ -406,11 +406,11 @@ namespace detail z(half(x)) {} - template + template GLM_FUNC_QUALIFIER tvec3::tvec3 ( - A const & x, - B const & y, + A const & x, + B const & y, C const & z ) : x(half(x)), @@ -466,7 +466,7 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator= + GLM_FUNC_QUALIFIER tvec3 & tvec3::operator= ( tvec3 const & v ) @@ -692,9 +692,9 @@ namespace detail GLM_FUNC_QUALIFIER tvec4::tvec4 ( - half const & s1, - half const & s2, - half const & s3, + half const & s1, + half const & s2, + half const & s3, half const & s4 ) : x(s1), @@ -730,12 +730,12 @@ namespace detail w(half(x)) {} - template + template GLM_FUNC_QUALIFIER tvec4::tvec4 ( - A const & x, - B const & y, - C const & z, + A const & x, + B const & y, + C const & z, D const & w ) : x(half(x)), @@ -747,11 +747,11 @@ namespace detail ////////////////////////////////////// // Convertion vector constructors - template + template GLM_FUNC_QUALIFIER tvec4::tvec4 ( - tvec2 const & v, - B const & s1, + tvec2 const & v, + B const & s1, C const & s2 ) : x(half(v.x)), @@ -760,11 +760,11 @@ namespace detail w(half(s2)) {} - template + template GLM_FUNC_QUALIFIER tvec4::tvec4 ( - A const & s1, - tvec2 const & v, + A const & s1, + tvec2 const & v, C const & s2 ) : x(half(s1)), @@ -773,11 +773,11 @@ namespace detail w(half(s2)) {} - template + template GLM_FUNC_QUALIFIER tvec4::tvec4 ( - A const & s1, - B const & s2, + A const & s1, + B const & s2, tvec2 const & v ) : x(half(s1)), @@ -786,10 +786,10 @@ namespace detail w(half(v.y)) {} - template + template GLM_FUNC_QUALIFIER tvec4::tvec4 ( - tvec3 const & v, + tvec3 const & v, B const & s ) : x(half(v.x)), @@ -798,10 +798,10 @@ namespace detail w(half(s)) {} - template + template GLM_FUNC_QUALIFIER tvec4::tvec4 ( - A const & s, + A const & s, tvec3 const & v ) : x(half(s)), @@ -810,10 +810,10 @@ namespace detail w(half(v.z)) {} - template + template GLM_FUNC_QUALIFIER tvec4::tvec4 ( - tvec2 const & v1, + tvec2 const & v1, tvec2 const & v2 ) : x(half(v1.x)), @@ -822,7 +822,7 @@ namespace detail w(half(v2.y)) {} - template + template GLM_FUNC_QUALIFIER tvec4::tvec4 ( tvec4 const & v @@ -836,7 +836,7 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators - GLM_FUNC_QUALIFIER tvec4& tvec4::operator= + GLM_FUNC_QUALIFIER tvec4& tvec4::operator= ( tvec4 const & v ) @@ -1015,32 +1015,32 @@ namespace detail GLM_FUNC_QUALIFIER hvec2 abs(hvec2 const & v) { return hvec2( - float(v.x) >= float(0) ? v.x : -v.x, + float(v.x) >= float(0) ? v.x : -v.x, float(v.y) >= float(0) ? v.y : -v.y); } GLM_FUNC_QUALIFIER hvec3 abs(hvec3 const & v) { return hvec3( - float(v.x) >= float(0) ? v.x : -v.x, - float(v.y) >= float(0) ? v.y : -v.y, + float(v.x) >= float(0) ? v.x : -v.x, + float(v.y) >= float(0) ? v.y : -v.y, float(v.z) >= float(0) ? v.z : -v.z); } GLM_FUNC_QUALIFIER hvec4 abs(hvec4 const & v) { return hvec4( - float(v.x) >= float(0) ? v.x : -v.x, - float(v.y) >= float(0) ? v.y : -v.y, - float(v.z) >= float(0) ? v.z : -v.z, + float(v.x) >= float(0) ? v.x : -v.x, + float(v.y) >= float(0) ? v.y : -v.y, + float(v.z) >= float(0) ? v.z : -v.z, float(v.w) >= float(0) ? v.w : -v.w); } template <> GLM_FUNC_QUALIFIER glm::half mix ( - glm::half const & x, - glm::half const & y, + glm::half const & x, + glm::half const & y, bool const & a ) { diff --git a/glm/gtc/matrix_access.hpp b/glm/gtc/matrix_access.hpp index 201317ea..d49e096f 100644 --- a/glm/gtc/matrix_access.hpp +++ b/glm/gtc/matrix_access.hpp @@ -71,8 +71,8 @@ namespace glm genType const & m, int index); - /// Set a specific column to a matrix. - /// @see gtc_matrix_access + /// Set a specific column to a matrix. + /// @see gtc_matrix_access template genType column( genType const & m, diff --git a/glm/gtc/matrix_access.inl b/glm/gtc/matrix_access.inl index a9e48bbb..e5fa9e88 100644 --- a/glm/gtc/matrix_access.inl +++ b/glm/gtc/matrix_access.inl @@ -45,7 +45,7 @@ namespace glm template GLM_FUNC_QUALIFIER typename genType::row_type row ( - genType const & m, + genType const & m, int index ) { @@ -58,8 +58,8 @@ namespace glm template GLM_FUNC_QUALIFIER genType column ( - genType const & m, - int index, + genType const & m, + int index, typename genType::col_type const & x ) { @@ -71,7 +71,7 @@ namespace glm template GLM_FUNC_QUALIFIER typename genType::col_type column ( - genType const & m, + genType const & m, int index ) { diff --git a/glm/gtc/matrix_inverse.inl b/glm/gtc/matrix_inverse.inl index 470dca87..4fa09164 100644 --- a/glm/gtc/matrix_inverse.inl +++ b/glm/gtc/matrix_inverse.inl @@ -67,7 +67,7 @@ namespace glm detail::tmat2x2 Inverse( + m[1][1] / Determinant, - m[0][1] / Determinant, - - m[1][0] / Determinant, + - m[1][0] / Determinant, + m[0][0] / Determinant); return Inverse; @@ -153,7 +153,7 @@ namespace glm + m[0][3] * Inverse[0][3]; Inverse /= Determinant; - + return Inverse; } }//namespace glm diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index beba1c0d..c9a03c21 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -241,7 +241,6 @@ namespace glm #else valType const rad = glm::radians(fovy); #endif - valType range = tan(rad / valType(2)) * zNear; valType left = -range * aspect; valType right = range * aspect; @@ -314,8 +313,8 @@ namespace glm template GLM_FUNC_QUALIFIER detail::tmat4x4 tweakedInfinitePerspective ( - T fovy, - T aspect, + T fovy, + T aspect, T zNear ) { @@ -384,15 +383,15 @@ namespace glm template detail::tmat4x4 pickMatrix ( - detail::tvec2 const & center, - detail::tvec2 const & delta, + detail::tvec2 const & center, + detail::tvec2 const & delta, detail::tvec4 const & viewport ) { assert(delta.x > T(0) && delta.y > T(0)); detail::tmat4x4 Result(1.0f); - if(!(delta.x > T(0) && delta.y > T(0))) + if(!(delta.x > T(0) && delta.y > T(0))) return Result; // Error detail::tvec3 Temp( diff --git a/glm/gtc/noise.hpp b/glm/gtc/noise.hpp index 1768bd2f..f30a2f25 100644 --- a/glm/gtc/noise.hpp +++ b/glm/gtc/noise.hpp @@ -54,22 +54,22 @@ namespace glm /// @{ /// Classic perlin noise. - /// @see gtc_noise + /// @see gtc_noise template class vecType> - T perlin( + T perlin( vecType const & p); /// Periodic perlin noise. /// @see gtc_noise template class vecType> - T perlin( + T perlin( vecType const & p, vecType const & rep); /// Simplex noise. /// @see gtc_noise template class vecType> - T simplex( + T simplex( vecType const & p); /// @} diff --git a/glm/gtc/noise.inl b/glm/gtc/noise.inl index 1c6d557e..14eb2d9a 100644 --- a/glm/gtc/noise.inl +++ b/glm/gtc/noise.inl @@ -50,7 +50,7 @@ namespace glm { return mod289(((x * T(34)) + T(1)) * x); } - + template GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r) { @@ -426,10 +426,10 @@ namespace glm detail::tvec2 g11(gx.w, gy.w); detail::tvec4 norm = taylorInvSqrt(detail::tvec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); - g00 *= norm.x; - g01 *= norm.y; - g10 *= norm.z; - g11 *= norm.w; + g00 *= norm.x; + g01 *= norm.y; + g10 *= norm.z; + g11 *= norm.w; T n00 = dot(g00, detail::tvec2(fx.x, fy.x)); T n10 = dot(g10, detail::tvec2(fx.y, fy.y)); diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index c6cfd546..947445a3 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -338,41 +338,6 @@ namespace detail valType const & angle, detail::tvec3 const & axis); - /// Quaternion of floating-point numbers. - /// - /// @see gtc_quaternion - typedef detail::tquat quat; - - /// Quaternion of half-precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef detail::tquat hquat; - - /// Quaternion of single-precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef detail::tquat fquat; - - /// Quaternion of double-precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef detail::tquat dquat; - - /// Quaternion of low precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef detail::tquat lowp_quat; - - /// Quaternion of medium precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef detail::tquat mediump_quat; - - /// Quaternion of high precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef detail::tquat highp_quat; - /// @} } //namespace glm diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 0b9d2051..925525aa 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -712,9 +712,9 @@ namespace detail Result.z = biggestVal; break; - default: // Silence a -Wswitch-default warning in GCC. Should never actually get here. Assert is just for sanity. - assert(false); - break; + default: // Silence a -Wswitch-default warning in GCC. Should never actually get here. Assert is just for sanity. + assert(false); + break; } return Result; } diff --git a/glm/gtc/type_ptr.hpp b/glm/gtc/type_ptr.hpp index 49395733..7470d826 100644 --- a/glm/gtc/type_ptr.hpp +++ b/glm/gtc/type_ptr.hpp @@ -70,96 +70,96 @@ #endif namespace glm -{ +{ /// @addtogroup gtc_type_ptr /// @{ - + /// Return the constant address to the data of the input parameter. - /// @see gtc_type_ptr + /// @see gtc_type_ptr template - typename genType::value_type const * value_ptr(genType const & vec); + typename genType::value_type const * value_ptr(genType const & vec); /// Build a vector from a pointer. /// @see gtc_type_ptr template - detail::tvec2 make_vec2(T const * const ptr); + detail::tvec2 make_vec2(T const * const ptr); /// Build a vector from a pointer. /// @see gtc_type_ptr template - detail::tvec3 make_vec3(T const * const ptr); + detail::tvec3 make_vec3(T const * const ptr); /// Build a vector from a pointer. /// @see gtc_type_ptr template - detail::tvec4 make_vec4(T const * const ptr); + detail::tvec4 make_vec4(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template - detail::tmat2x2 make_mat2x2(T const * const ptr); - + detail::tmat2x2 make_mat2x2(T const * const ptr); + /// Build a matrix from a pointer. /// @see gtc_type_ptr template - detail::tmat2x3 make_mat2x3(T const * const ptr); - + detail::tmat2x3 make_mat2x3(T const * const ptr); + /// Build a matrix from a pointer. /// @see gtc_type_ptr template - detail::tmat2x4 make_mat2x4(T const * const ptr); - + detail::tmat2x4 make_mat2x4(T const * const ptr); + /// Build a matrix from a pointer. /// @see gtc_type_ptr template - detail::tmat3x2 make_mat3x2(T const * const ptr); - + detail::tmat3x2 make_mat3x2(T const * const ptr); + /// Build a matrix from a pointer. /// @see gtc_type_ptr template - detail::tmat3x3 make_mat3x3(T const * const ptr); + detail::tmat3x3 make_mat3x3(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template - detail::tmat3x4 make_mat3x4(T const * const ptr); - + detail::tmat3x4 make_mat3x4(T const * const ptr); + /// Build a matrix from a pointer. /// @see gtc_type_ptr template - detail::tmat4x2 make_mat4x2( - T const * const ptr); - + detail::tmat4x2 make_mat4x2( + T const * const ptr); + /// Build a matrix from a pointer. /// @see gtc_type_ptr template - detail::tmat4x3 make_mat4x3(T const * const ptr); - + detail::tmat4x3 make_mat4x3(T const * const ptr); + /// Build a matrix from a pointer. /// @see gtc_type_ptr template - detail::tmat4x4 make_mat4x4(T const * const ptr); - + detail::tmat4x4 make_mat4x4(T const * const ptr); + /// Build a matrix from a pointer. /// @see gtc_type_ptr template - detail::tmat2x2 make_mat2(T const * const ptr); - + detail::tmat2x2 make_mat2(T const * const ptr); + /// Build a matrix from a pointer. /// @see gtc_type_ptr template - detail::tmat3x3 make_mat3(T const * const ptr); + detail::tmat3x3 make_mat3(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template - detail::tmat4x4 make_mat4(T const * const ptr); - + detail::tmat4x4 make_mat4(T const * const ptr); + /// Build a quaternion from a pointer. /// @see gtc_type_ptr template - detail::tquat make_quat(T const * const ptr); - + detail::tquat make_quat(T const * const ptr); + /// @} }//namespace glm diff --git a/glm/gtc/type_ptr.inl b/glm/gtc/type_ptr.inl index c0d1d877..c318385d 100644 --- a/glm/gtc/type_ptr.inl +++ b/glm/gtc/type_ptr.inl @@ -27,12 +27,12 @@ /////////////////////////////////////////////////////////////////////////////////// namespace glm -{ +{ /// @addtogroup gtc_type_ptr /// @{ /// Return the constant address to the data of the input parameter. - /// @see gtc_type_ptr + /// @see gtc_type_ptr template GLM_FUNC_QUALIFIER T const * value_ptr ( @@ -283,18 +283,18 @@ namespace glm { return &(mat[0].x); } - + //! Return the constant address to the data of the input parameter. /// @see gtc_type_ptr template GLM_FUNC_QUALIFIER T const * value_ptr ( - detail::tquat const & q - ) + detail::tquat const & q + ) { return &(q[0]); } - + //! Get the address of the matrix content. /// @see gtc_type_ptr template @@ -342,7 +342,7 @@ namespace glm memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x2)); return Result; } - + //! Build a matrix from a pointer. /// @see gtc_type_ptr template @@ -352,7 +352,7 @@ namespace glm memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x3)); return Result; } - + //! Build a matrix from a pointer. /// @see gtc_type_ptr template @@ -362,7 +362,7 @@ namespace glm memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x4)); return Result; } - + //! Build a matrix from a pointer. /// @see gtc_type_ptr template @@ -372,7 +372,7 @@ namespace glm memcpy(value_ptr(Result), ptr, sizeof(detail::tmat3x2)); return Result; } - + //! Build a matrix from a pointer. /// @see gtc_type_ptr template @@ -392,7 +392,7 @@ namespace glm memcpy(value_ptr(Result), ptr, sizeof(detail::tmat3x4)); return Result; } - + //! Build a matrix from a pointer. /// @see gtc_type_ptr template @@ -402,7 +402,7 @@ namespace glm memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x2)); return Result; } - + //! Build a matrix from a pointer. /// @see gtc_type_ptr template @@ -412,7 +412,7 @@ namespace glm memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x3)); return Result; } - + //! Build a matrix from a pointer. /// @see gtc_type_ptr template @@ -422,7 +422,7 @@ namespace glm memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x4)); return Result; } - + //! Build a matrix from a pointer. /// @see gtc_type_ptr template @@ -430,7 +430,7 @@ namespace glm { return make_mat2x2(ptr); } - + //! Build a matrix from a pointer. /// @see gtc_type_ptr template @@ -446,7 +446,7 @@ namespace glm { return make_mat4x4(ptr); } - + //! Build a quaternion from a pointer. /// @see gtc_type_ptr template @@ -456,7 +456,7 @@ namespace glm memcpy(value_ptr(Result), ptr, sizeof(detail::tquat)); return Result; } - + /// @} }//namespace glm diff --git a/glm/gtc/ulp.hpp b/glm/gtc/ulp.hpp index 7ab0d6a2..5bbc1bc5 100644 --- a/glm/gtc/ulp.hpp +++ b/glm/gtc/ulp.hpp @@ -53,34 +53,34 @@ namespace glm /// Return the next ULP value(s) after the input value(s). /// @see gtc_ulp - template - genType next_float(genType const & x); - + template + genType next_float(genType const & x); + /// Return the previous ULP value(s) before the input value(s). /// @see gtc_ulp - template - genType prev_float(genType const & x); + template + genType prev_float(genType const & x); /// Return the value(s) ULP distance after the input value(s). /// @see gtc_ulp - template - genType next_float(genType const & x, uint const & Distance); - - /// Return the value(s) ULP distance before the input value(s). + template + genType next_float(genType const & x, uint const & Distance); + + /// Return the value(s) ULP distance before the input value(s). /// @see gtc_ulp - template - genType prev_float(genType const & x, uint const & Distance); - - /// Return the distance in the number of ULP between 2 scalars. + template + genType prev_float(genType const & x, uint const & Distance); + + /// Return the distance in the number of ULP between 2 scalars. /// @see gtc_ulp - template - uint float_distance(T const & x, T const & y); - - /// Return the distance in the number of ULP between 2 vectors. + template + uint float_distance(T const & x, T const & y); + + /// Return the distance in the number of ULP between 2 vectors. /// @see gtc_ulp - template class vecType> - vecType float_distance(vecType const & x, vecType const & y); - + template class vecType> + vecType float_distance(vecType const & x, vecType const & y); + /// @} }// namespace glm diff --git a/glm/gtc/ulp.inl b/glm/gtc/ulp.inl index 997a8163..97d0b271 100644 --- a/glm/gtc/ulp.inl +++ b/glm/gtc/ulp.inl @@ -58,34 +58,34 @@ typedef union } parts; } ieee_double_shape_type; -#define GLM_EXTRACT_WORDS(ix0,ix1,d) \ - do { \ - ieee_double_shape_type ew_u; \ - ew_u.value = (d); \ - (ix0) = ew_u.parts.msw; \ - (ix1) = ew_u.parts.lsw; \ +#define GLM_EXTRACT_WORDS(ix0,ix1,d) \ + do { \ + ieee_double_shape_type ew_u; \ + ew_u.value = (d); \ + (ix0) = ew_u.parts.msw; \ + (ix1) = ew_u.parts.lsw; \ } while (0) -#define GLM_GET_FLOAT_WORD(i,d) \ - do { \ - ieee_float_shape_type gf_u; \ - gf_u.value = (d); \ - (i) = gf_u.word; \ +#define GLM_GET_FLOAT_WORD(i,d) \ + do { \ + ieee_float_shape_type gf_u; \ + gf_u.value = (d); \ + (i) = gf_u.word; \ } while (0) -#define GLM_SET_FLOAT_WORD(d,i) \ - do { \ - ieee_float_shape_type sf_u; \ - sf_u.word = (i); \ - (d) = sf_u.value; \ +#define GLM_SET_FLOAT_WORD(d,i) \ + do { \ + ieee_float_shape_type sf_u; \ + sf_u.word = (i); \ + (d) = sf_u.value; \ } while (0) -#define GLM_INSERT_WORDS(d,ix0,ix1) \ - do { \ - ieee_double_shape_type iw_u; \ - iw_u.parts.msw = (ix0); \ - iw_u.parts.lsw = (ix1); \ - (d) = iw_u.value; \ +#define GLM_INSERT_WORDS(d,ix0,ix1) \ + do { \ + ieee_double_shape_type iw_u; \ + iw_u.parts.msw = (ix0); \ + iw_u.parts.lsw = (ix1); \ + (d) = iw_u.value; \ } while (0) namespace glm{ @@ -98,28 +98,28 @@ namespace detail GLM_GET_FLOAT_WORD(hx, x); GLM_GET_FLOAT_WORD(hy, y); - ix = hx&0x7fffffff; // |x| - iy = hy&0x7fffffff; // |y| + ix = hx&0x7fffffff; // |x| + iy = hy&0x7fffffff; // |y| - if((ix>0x7f800000) || // x is nan - (iy>0x7f800000)) // y is nan + if((ix>0x7f800000) || // x is nan + (iy>0x7f800000)) // y is nan return x+y; - if(x==y) return y; // x=y, return y - if(ix==0) { // x == 0 + if(x==y) return y; // x=y, return y + if(ix==0) { // x == 0 GLM_SET_FLOAT_WORD(x,(hy&0x80000000)|1);// return +-minsubnormal t = x*x; - if(t==x) return t; else return x; // raise underflow flag + if(t==x) return t; else return x; // raise underflow flag } - if(hx>=0) { // x > 0 - if(hx>hy) { // x > y, x -= ulp + if(hx>=0) { // x > 0 + if(hx>hy) { // x > y, x -= ulp hx -= 1; - } else { // x < y, x += ulp + } else { // x < y, x += ulp hx += 1; } - } else { // x < 0 - if(hy>=0||hx>hy){ // x < y, x -= ulp + } else { // x < 0 + if(hy>=0||hx>hy){ // x < y, x -= ulp hx -= 1; - } else { // x > y, x += ulp + } else { // x > y, x += ulp hx += 1; } }