Clutter Engine 0.0.1
Loading...
Searching...
No Matches
scalar_multiplication.hpp File Reference
#include "../detail/setup.hpp"
#include "../vec2.hpp"
#include "../vec3.hpp"
#include "../vec4.hpp"
#include "../mat2x2.hpp"
#include <type_traits>

Go to the source code of this file.

Namespaces

namespace  glm
 Core features
 

Macros

#define GLM_IMPLEMENT_SCAL_MULT(Vec)
 

Typedefs

template<typename T , typename Vec >
using glm::return_type_scalar_multiplication
 

Detailed Description

Experimental extensions

Author
Joshua Moerman

Include <glm/gtx/scalar_multiplication.hpp> to use the features of this extension.

Enables scalar multiplication for all types

Since GLSL is very strict about types, the following (often used) combinations do not work: double * vec4 int * vec4 vec4 / int So we'll fix that! Of course "float * vec4" should remain the same (hence the enable_if magic)

Macro Definition Documentation

◆ GLM_IMPLEMENT_SCAL_MULT

#define GLM_IMPLEMENT_SCAL_MULT ( Vec)
Value:
template<typename T> \
return_type_scalar_multiplication<T, Vec> \
operator*(T const& s, Vec rh){ \
return rh *= static_cast<float>(s); \
} \
\
template<typename T> \
return_type_scalar_multiplication<T, Vec> \
operator*(Vec lh, T const& s){ \
return lh *= static_cast<float>(s); \
} \
\
template<typename T> \
return_type_scalar_multiplication<T, Vec> \
operator/(Vec lh, T const& s){ \
return lh *= 1.0f / static_cast<float>(s); \
}