OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vector_math.h File Reference
#include <string.h>
#include <math.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  vec2
 
struct  detail::ivec2< T >
 
struct  vec3
 
struct  vec4
 
struct  mat4
 

Namespaces

 detail
 

Macros

#define PI   3.141592653f
 

Typedefs

typedef detail::ivec2< uint32_t > uvec2
 
typedef detail::ivec2< int32_t > ivec2
 
typedef detail::ivec2< uint8_t > ubvec2
 

Functions

template<typename T >
const T::data_type * value_ptr (const T &vec)
 
template<typename T >
T::vector_type operator- (const T &a)
 
template<typename T >
T::vector_type operator* (const T &a, const T &b)
 
template<typename T >
T::vector_type operator/ (const T &a, const T &b)
 
template<typename T >
T::vector_type operator+ (const T &a, const T &b)
 
template<typename T >
T::vector_type operator- (const T &a, const T &b)
 
template<typename T >
T::vector_type & operator*= (T &a, const T &b)
 
template<typename T >
T::vector_type & operator/= (T &a, const T &b)
 
template<typename T >
T::vector_type & operator+= (T &a, const T &b)
 
template<typename T >
T::vector_type & operator-= (T &a, const T &b)
 
mat4 operator* (const mat4 &a, const mat4 &b)
 
vec4 operator* (const mat4 &mat, const vec4 &vec)
 
mat4operator*= (mat4 &mat, float v)
 
vec3 vec_cross (const vec3 &a, const vec3 &b)
 
template<typename T >
float vec_dot (const T &a, const T &b)
 
template<typename T >
float vec_length (const T &vec)
 
template<typename T >
vec_normalize (const T &vec)
 
template<typename T >
vec_floor (const T &vec)
 
template<typename T >
vec_round (const T &vec)
 
template<typename T >
vec_fract (const T &vec)
 
vec3 vec_project (const vec4 &vec)
 
template<typename T >
clamp (T value, T lo, T hi)
 
template<typename T >
vec_clamp (const T &vec, const T &lo, const T &hi)
 
mat4 mat_look_at (const vec3 &eye, const vec3 &center, const vec3 &up)
 
mat4 mat_rotate_x (float radians)
 
mat4 mat_rotate_y (float radians)
 
mat4 mat_rotate_z (float radians)
 
vec3 vec_rotateX (const vec3 &v, float radians)
 
vec3 vec_rotateY (const vec3 &v, float radians)
 
vec3 vec_rotateZ (const vec3 &v, float radians)
 
mat4 mat_perspective_fov (float fovy, float aspect, float zn, float zf)
 
mat4 mat_inverse (const mat4 &a)
 

Macro Definition Documentation

#define PI   3.141592653f

Definition at line 29 of file vector_math.h.

Typedef Documentation

typedef detail::ivec2<int32_t> ivec2

Definition at line 91 of file vector_math.h.

typedef detail::ivec2<uint8_t> ubvec2

Definition at line 92 of file vector_math.h.

typedef detail::ivec2<uint32_t> uvec2

Definition at line 90 of file vector_math.h.

Function Documentation

template<typename T >
T clamp ( value,
lo,
hi 
)
inline

Definition at line 339 of file vector_math.h.

mat4 mat_inverse ( const mat4 a)
inline

Definition at line 430 of file vector_math.h.

mat4 mat_look_at ( const vec3 eye,
const vec3 center,
const vec3 up 
)
inline

Definition at line 358 of file vector_math.h.

mat4 mat_perspective_fov ( float  fovy,
float  aspect,
float  zn,
float  zf 
)
inline

Definition at line 419 of file vector_math.h.

mat4 mat_rotate_x ( float  radians)
inline

Definition at line 371 of file vector_math.h.

mat4 mat_rotate_y ( float  radians)
inline

Definition at line 382 of file vector_math.h.

mat4 mat_rotate_z ( float  radians)
inline

Definition at line 393 of file vector_math.h.

template<typename T >
T::vector_type operator* ( const T &  a,
const T &  b 
)
inline

Definition at line 181 of file vector_math.h.

mat4 operator* ( const mat4 a,
const mat4 b 
)
inline

Definition at line 248 of file vector_math.h.

vec4 operator* ( const mat4 mat,
const vec4 vec 
)
inline

Definition at line 265 of file vector_math.h.

template<typename T >
T::vector_type& operator*= ( T &  a,
const T &  b 
)
inline

Definition at line 217 of file vector_math.h.

mat4& operator*= ( mat4 mat,
float  v 
)
inline

Definition at line 273 of file vector_math.h.

template<typename T >
T::vector_type operator+ ( const T &  a,
const T &  b 
)
inline

Definition at line 199 of file vector_math.h.

template<typename T >
T::vector_type& operator+= ( T &  a,
const T &  b 
)
inline

Definition at line 233 of file vector_math.h.

template<typename T >
T::vector_type operator- ( const T &  a)
inline

Definition at line 172 of file vector_math.h.

template<typename T >
T::vector_type operator- ( const T &  a,
const T &  b 
)
inline

Definition at line 208 of file vector_math.h.

template<typename T >
T::vector_type& operator-= ( T &  a,
const T &  b 
)
inline

Definition at line 241 of file vector_math.h.

template<typename T >
T::vector_type operator/ ( const T &  a,
const T &  b 
)
inline

Definition at line 190 of file vector_math.h.

template<typename T >
T::vector_type& operator/= ( T &  a,
const T &  b 
)
inline

Definition at line 225 of file vector_math.h.

template<typename T >
const T::data_type* value_ptr ( const T &  vec)

Definition at line 35 of file vector_math.h.

template<typename T >
T vec_clamp ( const T &  vec,
const T &  lo,
const T &  hi 
)
inline

Definition at line 350 of file vector_math.h.

vec3 vec_cross ( const vec3 a,
const vec3 b 
)
inline

Definition at line 280 of file vector_math.h.

template<typename T >
float vec_dot ( const T &  a,
const T &  b 
)
inline

Definition at line 289 of file vector_math.h.

template<typename T >
T vec_floor ( const T &  vec)
inline

Definition at line 310 of file vector_math.h.

template<typename T >
T vec_fract ( const T &  vec)
inline

Definition at line 328 of file vector_math.h.

template<typename T >
float vec_length ( const T &  vec)
inline

Definition at line 298 of file vector_math.h.

template<typename T >
T vec_normalize ( const T &  vec)
inline

Definition at line 304 of file vector_math.h.

vec3 vec_project ( const vec4 vec)
inline

Definition at line 333 of file vector_math.h.

vec3 vec_rotateX ( const vec3 v,
float  radians 
)
inline

Definition at line 404 of file vector_math.h.

vec3 vec_rotateY ( const vec3 v,
float  radians 
)
inline

Definition at line 409 of file vector_math.h.

vec3 vec_rotateZ ( const vec3 v,
float  radians 
)
inline

Definition at line 414 of file vector_math.h.

template<typename T >
T vec_round ( const T &  vec)
inline

Definition at line 319 of file vector_math.h.