89 return (
AT_Vec3){{0.0f, 0.0f, 0.0f}};
103 return (
AT_Vec3){{a.x + b.x, a.y + b.y, a.z + b.z}};
117 return (
AT_Vec3){{a.x - b.x, a.y - b.y, a.z - b.z}};
131 return (
AT_Vec3){{a.x * b.x, a.y * b.y, a.z * b.z}};
145 {(fabsf(v.x) < EPSILON ? FLT_MAX : (1.0f / fabsf(v.x))),
146 (fabsf(v.y) < EPSILON ? FLT_MAX : (1.0f / fabsf(v.y))),
147 (fabsf(v.z) < EPSILON ? FLT_MAX : (1.0f / fabsf(v.z)))}
162 return (
AT_Vec3){{v.x * s, v.y * s, v.z * s}};
176 return a.x * b.x + a.y * b.y + a.z * b.z;
191 {a.y * b.z - a.z * b.y,
192 a.z * b.x - a.x * b.z,
193 a.x * b.y - a.y * b.x}
235 return sqrt((b.x - a.x) * (b.x - a.x) + (b.y - a.y) * (b.y - a.y) + (b.z - a.z) * (b.z - a.z));
249 return (b.x - a.x) * (b.x - a.x) +
250 (b.y - a.y) * (b.y - a.y) +
251 (b.z - a.z) * (b.z - a.z);
265 {v.x != 0.0f ? fabsf(1.0f / v.x) : FLT_MAX,
266 v.y != 0.0f ? fabsf(1.0f / v.y) : FLT_MAX,
267 v.z != 0.0f ? fabsf(1.0f / v.z) : FLT_MAX}
static AT_Vec3 AT_vec3_inv(AT_Vec3 v)
Calculates the inverse of a vector.
Definition at_math.h:142
static AT_Vec3 AT_vec3_zero(void)
AT_Vec3 constructor for a zero initialised vector.
Definition at_math.h:87
static AT_Vec3 AT_vec3(float x, float y, float z)
AT_Vec3 constructor for a given point.
Definition at_math.h:76
static AT_Vec3 AT_vec3_cross(AT_Vec3 a, AT_Vec3 b)
Performs vector cross multiplication on two given AT_Vec3.
Definition at_math.h:188
static AT_Vec3 AT_vec3_add(AT_Vec3 a, AT_Vec3 b)
Adds two AT_Vec3.
Definition at_math.h:101
static float AT_vec3_dot(AT_Vec3 a, AT_Vec3 b)
Performs vector dot operation on two given AT_Vec3.
Definition at_math.h:174
static AT_Vec3 AT_vec3_scale(AT_Vec3 v, float s)
Scales an AT_Vec3 by a given scalar.
Definition at_math.h:160
static AT_Vec3 AT_vec3_sub(AT_Vec3 a, AT_Vec3 b)
Subtracts two AT_Vec3.
Definition at_math.h:115
static float AT_vec3_distance(AT_Vec3 a, AT_Vec3 b)
Calculates the distance between two AT_Vec3's.
Definition at_math.h:233
static float AT_vec3_length(AT_Vec3 v)
Calculate the length of an AT_Vec3.
Definition at_math.h:205
static float AT_vec3_distance_sq(AT_Vec3 a, AT_Vec3 b)
Calculates the squared distance between two AT_Vec3's.
Definition at_math.h:247
static AT_Vec3 AT_vec3_mul(AT_Vec3 a, AT_Vec3 b)
Product of two AT_Vec3.
Definition at_math.h:129
static AT_Vec3 AT_vec3_normalize(AT_Vec3 v)
Normalise a given vector to be within 0.0 -> 1.0.
Definition at_math.h:218
Axis-Aligned Bounding Box for triangle(s).
Definition at_math.h:48
AT_Vec3 max
Definition at_math.h:50
AT_Vec3 min
Definition at_math.h:49
Groups three AT_Vec3 to represent a triangle.
Definition at_math.h:58
AT_Vec3 v1
Definition at_math.h:59
AT_Vec3 v3
Definition at_math.h:61
AT_AABB aabb
Definition at_math.h:62
AT_Vec3 v2
Definition at_math.h:60
Groups three integers to represent a vector of size 3.
Definition at_math.h:39
int x
Definition at_math.h:40
int y
Definition at_math.h:41
int z
Definition at_math.h:42
Groups three floats to represent a vector of size 3.
Definition at_math.h:29
float arr[3]
Definition at_math.h:33