RetroArch
Macros | Variables
vector_3.h File Reference
#include <stdint.h>
#include <math.h>
#include <retro_common_api.h>
Include dependency graph for vector_3.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define vec3_dot(a, b)   (a[0] * b[0] + a[1] * b[1] + a[2] * b[2])
 
#define vec3_cross(dst, a, b)
 
#define vec3_length(a)   sqrtf(vec3_dot(a,a))
 
#define vec3_add(dst, src)
 
#define vec3_subtract(dst, src)
 
#define vec3_scale(dst, scale)
 
#define vec3_copy(dst, src)
 
#define vec3_normalize(dst)   vec3_scale(dst,1.0f / vec3_length(dst))
 

Variables

RETRO_BEGIN_DECLS typedef float vec3_t [3]
 

Macro Definition Documentation

◆ vec3_add

#define vec3_add (   dst,
  src 
)
Value:
dst[0] += src[0]; \
dst[1] += src[1]; \
dst[2] += src[2]
GLenum src
Definition: glext.h:6980
GLenum GLenum dst
Definition: glext.h:6980

◆ vec3_copy

#define vec3_copy (   dst,
  src 
)
Value:
dst[0] = src[0]; \
dst[1] = src[1]; \
dst[2] = src[2]
GLenum src
Definition: glext.h:6980
GLenum GLenum dst
Definition: glext.h:6980

◆ vec3_cross

#define vec3_cross (   dst,
  a,
  b 
)
Value:
dst[0] = a[1]*b[2] - a[2]*b[1]; \
dst[1] = a[2]*b[0] - a[0]*b[2]; \
dst[2] = a[0]*b[1] - a[1]*b[0]
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
GLenum GLenum dst
Definition: glext.h:6980
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6844

◆ vec3_dot

#define vec3_dot (   a,
  b 
)    (a[0] * b[0] + a[1] * b[1] + a[2] * b[2])

◆ vec3_length

#define vec3_length (   a)    sqrtf(vec3_dot(a,a))

◆ vec3_normalize

#define vec3_normalize (   dst)    vec3_scale(dst,1.0f / vec3_length(dst))

◆ vec3_scale

#define vec3_scale (   dst,
  scale 
)
Value:
dst[0] *= scale; \
dst[1] *= scale; \
dst[2] *= scale
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9939
GLenum GLenum dst
Definition: glext.h:6980

◆ vec3_subtract

#define vec3_subtract (   dst,
  src 
)
Value:
dst[0] -= src[0]; \
dst[1] -= src[1]; \
dst[2] -= src[2]
GLenum src
Definition: glext.h:6980
GLenum GLenum dst
Definition: glext.h:6980

Variable Documentation

◆ vec3_t

RETRO_BEGIN_DECLS typedef float vec3_t[3]