srp
software rendering pipeline
Loading...
Searching...
No Matches
vec.h File Reference
#include <stdint.h>
Include dependency graph for vec.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  vec2
 
struct  vec3
 
struct  vec4
 
#define VEC2_ZERO   (vec2) {0, 0}
 
#define VEC3_ZERO   (vec3) {0, 0, 0}
 
#define VEC4_ZERO   (vec4) {0, 0, 0, 0}
 
typedef struct vec2 vec2
 
typedef struct vec3 vec3
 
typedef struct vec4 vec4
 
vec2 vec2Add (vec2 a, vec2 b)
 
vec2 vec2Subtract (vec2 a, vec2 b)
 
float vec2DotProduct (vec2 a, vec2 b)
 
vec2 vec2MultiplyScalar (vec2 a, float b)
 
vec3 vec3Add (vec3 a, vec3 b)
 
vec3 vec3Subtract (vec3 a, vec3 b)
 
float vec3DotProduct (vec3 a, vec3 b)
 
vec3 vec3MultiplyScalar (vec3 a, float b)
 
vec4 vec4Add (vec4 a, vec4 b)
 
vec4 vec4Subtract (vec4 a, vec4 b)
 
float vec4DotProduct (vec4 a, vec4 b)
 
vec4 vec4MultiplyScalar (vec4 a, float b)
 

Detailed Description

vec2, vec3, vec4 definition

Typedef Documentation

◆ vec3

typedef struct vec3 vec3

Represents a 3D vector of floats

◆ vec4

typedef struct vec4 vec4

Represents a 4D vector of floats

Function Documentation

◆ vec2DotProduct()

float vec2DotProduct ( vec2  a,
vec2  b 
)

Calculate the dot product of two vectors

◆ vec2MultiplyScalar()

vec2 vec2MultiplyScalar ( vec2  a,
float  b 
)

Multiply a vector with a scalar value

◆ vec2Subtract()

vec2 vec2Subtract ( vec2  a,
vec2  b 
)

Subtract two vectors

◆ vec3Add()

vec3 vec3Add ( vec3  a,
vec3  b 
)

Add two vectors

◆ vec3DotProduct()

float vec3DotProduct ( vec3  a,
vec3  b 
)

Calculate the dot product of two vectors

◆ vec3MultiplyScalar()

vec3 vec3MultiplyScalar ( vec3  a,
float  b 
)

Multiply a vector with a scalar value

◆ vec3Subtract()

vec3 vec3Subtract ( vec3  a,
vec3  b 
)

Subtract two vectors

◆ vec4Add()

vec4 vec4Add ( vec4  a,
vec4  b 
)

Add two vectors

◆ vec4DotProduct()

float vec4DotProduct ( vec4  a,
vec4  b 
)

Calculate the dot product of two vectors

◆ vec4MultiplyScalar()

vec4 vec4MultiplyScalar ( vec4  a,
float  b 
)

Multiply a vector with a scalar value

◆ vec4Subtract()

vec4 vec4Subtract ( vec4  a,
vec4  b 
)

Subtract two vectors