srp
software rendering pipeline
Loading...
Searching...
No Matches
vec.h
Go to the documentation of this file.
1// Software Rendering Pipeline (SRP) library
2// Licensed under GNU GPLv3
3
8#pragma once
9
10#include <stdint.h>
11
15#pragma pack(push, 1)
16
18typedef struct vec2 { float x, y; } vec2;
19#define VEC2_ZERO (vec2) {0, 0}
20
22typedef struct vec3 { float x, y, z; } vec3;
23#define VEC3_ZERO (vec3) {0, 0, 0}
24
26typedef struct vec4 { float x, y, z, w; } vec4;
27#define VEC4_ZERO (vec4) {0, 0, 0, 0}
28
29#pragma pack(pop)
30
32vec2 vec2Add(vec2 a, vec2 b);
36float vec2DotProduct(vec2 a, vec2 b);
38vec2 vec2MultiplyScalar(vec2 a, float b);
39
41vec3 vec3Add(vec3 a, vec3 b);
45float vec3DotProduct(vec3 a, vec3 b);
47vec3 vec3MultiplyScalar(vec3 a, float b);
48
50vec4 vec4Add(vec4 a, vec4 b);
54float vec4DotProduct(vec4 a, vec4 b);
56vec4 vec4MultiplyScalar(vec4 a, float b);
57
// ingroup Math
vec2 vec2Add(vec2 a, vec2 b)
Definition vec.c:15
Definition vec.h:18
Definition vec.h:22
Definition vec.h:26
vec4 vec4MultiplyScalar(vec4 a, float b)
Definition vec.c:101
vec4 vec4Subtract(vec4 a, vec4 b)
Definition vec.c:86
vec2 vec2MultiplyScalar(vec2 a, float b)
Definition vec.c:36
vec4 vec4Add(vec4 a, vec4 b)
Definition vec.c:76
float vec2DotProduct(vec2 a, vec2 b)
Definition vec.c:31
vec3 vec3Add(vec3 a, vec3 b)
Definition vec.c:44
vec2 vec2Subtract(vec2 a, vec2 b)
Definition vec.c:23
float vec3DotProduct(vec3 a, vec3 b)
Definition vec.c:62
float vec4DotProduct(vec4 a, vec4 b)
Definition vec.c:96
vec3 vec3MultiplyScalar(vec3 a, float b)
Definition vec.c:67
vec3 vec3Subtract(vec3 a, vec3 b)
Definition vec.c:53