Untitled
Loading...
Searching...
No Matches
utilities.h File Reference
#include "utilities/types.h"
#include "utilities/mathf.h"
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Macros

#define M_PI   3.14159265358979323846f
#define M_TAU   (2.0f * M_PI)
#define CAST_VEC(vec, type)
#define REMOVE_FROM_VEC(vec, index, type)
#define SHIFT_VEC_RIGHT(vec, index, type)
#define REMOVE_FROM_ARR(arr, index, count)
#define PRINT_VEC2N(vec)
#define PRINT_VEC3(vec, a, b, c)
#define PRINT_VEC3N(vec)
#define PRINT_VEC4N(vec)

Functions

int vector_push (Vector *v, void *o)
void * vector_expand (Vector *v, size_t i)
mat4 compose_2d_transform (vec2 transform, float angle, vec2 scale)
uint16_t float32_to_float16 (float f)
void init_vector (Vector *v, size_t i, size_t type_size)
float triangle_area (vec3 a, vec3 b, vec3 c)
bool is_similar_plane (vec3 n1, vec3 n2, vec3 p1, vec3 p2, float epsilon)
bool test_sphere_aabb (vec3 light_pos, float light_radius, vec3 min, vec3 max)
void compute_convex_hull (vec3 *points, int count, vec3 *out_hull, int *out_count, vec3 normal)
void compute_hull_faces (vec3 *points, size_t *indices, size_t count, size_t *out_hull, size_t *out_count, vec3 normal)
vec3 compute_hull_centroid (vec3 *hull_points, int hull_count, float bottom, float top)
void calculate_aabb_extents (AABB *aabb)
void calculate_aabb_bounds (AABB *aabb)
void compute_aabb_from_points (vec3 *points, int point_count, AABB *aabb)
bool aabbs_intersect (AABB *a, AABB *b)
AABB transform_aabb_by_position (AABB aabb, vec3 pos)
AABB transform_aabb_by_model_matrix (AABB aabb, mat4 mat)
AABB transform_aabb_by_model_matrix_rotation (AABB aabb, mat4 mat)
float fbm (vec3 p)
bool vec4_equal (vec4 a, vec4 b, float eps)
bool vec3_equal (vec3 a, vec3 b, float eps)
bool triangles_are_contiguous (Triangle *a, Triangle *b)
bool compute_barycentric (const vec2 uv0, const vec2 uv1, const vec2 uv2, const vec2 p, float *b0, float *b1, float *b2)
bool ray_intersects_triangle (vec3 origin, vec3 dir, vec3 a, vec3 b, vec3 c, float *out_t, vec3 *out_hit_point, vec3 *barycentric)
void compute_3d_barycentric (vec3 a, vec3 b, vec3 c, vec3 p, float *wA, float *wB, float *wC)
vec3 generate_bounce (uint32_t i, uint32_t N)
vec3 generate_sphere_dir (int i, int N)
bool mesh_faces_are_contiguous (MeshFace *a, vec3 *a_verts, MeshFace *b, vec3 *b_verts)
vec3 project_point_plane (vec3 point, vec3 plane_point, vec3 normal)
vec3 closest_point_triangle (vec3 p, vec3 a, vec3 b, vec3 c)
vec3 closest_point_segment (vec3 p, vec3 a, vec3 b)
float wrap_angle_pi (float angle)
float SDF_circle (vec2 p, vec2 center, float radius)
float SDF_rect (vec2 p, vec2 center, vec2 size, float r)
vec3 vec3_min (vec3 a, vec3 b)
vec3 vec3_max (vec3 a, vec3 b)
vec3 vec3_clamp (vec3 a, vec3 b, vec3 c)
bool vec2_inside_bounds (vec2 p, vec2 min, vec2 max)
int clip_against_plane (const vec3 *in, int in_count, vec3 *out, vec3 plane_point, vec3 plane_normal)
int clip_pts_against_plane (ClipVertex *in, int in_count, ClipVertex *out, vec3 plane_point, vec3 plane_normal)
float calculate_polygon_area (vec3 p[], int n)
void print_mat4 (mat4 *m)
void print_mat3 (mat3 *m)
vec3 vec4_to_vec3 (vec4 v)
vec4 vec3_to_vec4 (vec3 v)
void print_aabb (AABB *aabb)
void print_obb (OBB *obb)
void frisvad_basis (const vec3 n, vec3 *b1, vec3 *b2)
AABB translate_aabb (AABB a, vec3 b)
bool point_in_aabb (vec3 p, AABB *aabb)
void copy_vector (Vector *a, Vector *b)
float find_hull_point_z_from_plane (Plane p, vec2 xy)
void compute_triangle_normal (Triangle *tri)
vec3 compute_tri_normal (vec3 a, vec3 b, vec3 c)
void print_triangle (Triangle *t)
void print_tri (vec3 a, vec3 b, vec3 c)
vec3 mat4_mul_point (mat4 m, vec3 v)
vec3 mat4_mul_pointr (const mat4 m, vec3 v)
vec3 mat4_mul_direction (const mat4 m, vec3 v)
mat3 quat_to_mat3 (const vec4 q)
vec4 quat_from_axis_angle (vec3 axis, float angle)
vec4 quat_copy_sign (vec4 a, vec4 b)
vec4 quat_mul (vec4 a, vec4 b)
vec3 get_mat4_axis_x (mat4 a)
vec3 get_mat4_axis_y (mat4 a)
vec3 get_mat4_axis_z (mat4 a)
vec3 get_mat4_axis_w (mat4 a)
mat4 mat4_mul_flt (mat4 a, float b)
mat4 mat4_identity ()
mat3 mat3_identity ()
mat4 mat4_translation (vec3 t)
mat4 mat4_scale (vec3 s)
mat4 mat4_from_quat (vec4 q)
mat4 compose_trs_from_vectors (vec3 pos, vec4 rot, vec3 scale)
mat3 mat3_from_mat4 (const mat4 *m)
vec3 mat3_mul_vec3 (mat3 m, vec3 v)
vec3 mat3_mul_vec3r (mat3 m, vec3 v)
void mat4_transpose (float *dst, const float *src)
mat4 m4_transpose (mat4 in)
mat3 mat3_transpose (mat3 in)
mat3 mat3_mul (mat3 M, mat3 N)
mat3 mat3_inverse_transpose (mat3 m)
void OBB_vectors (mat3 rot, vec3 *fwd, vec3 *right, vec3 *up)
vec3 OBB_min_corner (OBB *obb)
bool point_in_obb (OBB *obb, vec3 pos)
vec3 triangle_centroid (vec3 A, vec3 B, vec3 C)

Macro Definition Documentation

◆ M_PI

◆ M_TAU

#define M_TAU   (2.0f * M_PI)

Definition at line 55 of file utilities.h.

Referenced by wrap_angle_pi().

◆ CAST_VEC

#define CAST_VEC ( vec,
type )
Value:
((type*)((vec).buffer))

Definition at line 134 of file utilities.h.

Referenced by a_star_aportal(), add_all_meshes_to_buffer(), add_all_text_boxes_to_draw_buffer(), add_horizon_face_to_hull_faces(), add_mesh_to_buffer(), add_text_box(), add_uv_island_to_lightmap(), align_text_box_label(), allocate_lightmap_ssbo(), assign_uvs(), bake_lighting_probe_volume(), bake_lightmap(), bake_reflection_probes(), bind_dynamic_shader(), bind_material(), build_adjacency_map(), build_light_bvh(), build_uv_islands(), calc_mesh_index_size(), calc_mesh_size(), check_audio_pv(), check_face_visibility(), check_horizon_edges(), check_lighting_pv(), clean_up_hull(), clip_tri_against_plane(), clip_triangle(), compute_mesh_hulls(), container_is_valid(), create_entity(), create_physics_component(), create_text_box(), create_ui_container(), create_ui_element(), deduplicate(), delete_text_box(), delete_ui_container(), delete_ui_element(), destroy_asset_instance(), determine_closest_rprobes(), determine_light_visibility_per_mesh(), determine_mesh_visibility(), determine_text_box_dimensions(), ESTATE_chair_interact(), execute_aportal_undo(), execute_aprobe_undo(), execute_globals_undo(), execute_light_undo(), execute_lprobe_undo(), execute_mesh_node_undo(), execute_rprobe_undo(), execute_text_box_undo(), execute_ui_container_undo(), execute_ui_element_undo(), execute_ui_menu_undo(), expand_hull(), fill_buffer_with_mesh_tri(), fill_index_buffer_mesh(), fill_vertex_buffer_mesh(), find_animation(), find_closest_visible_aportal(), find_free_mn(), find_mn_by_name(), get_text_box_from_coords(), get_ui_element_from_coords(), GPU_unwrap_mesh_to_buffers(), GPU_upload_scene_data(), GPU_upload_ui_elements(), handle_ui_event(), handle_ui_selection_event(), heap_pop(), heap_push(), incremental_hull(), init_lightmap_data(), init_mesh(), init_mesh_tri_bvh(), init_new_asset_instance(), init_PC(), init_player(), init_scene_bvh(), init_uv_islands(), interpolate_nearest_aprobes(), LM_allocate_empty_mns(), LM_regenerate_texels(), load_aportals(), load_gltf(), load_gltf_texture(), load_lightmap_from_binary(), load_ui(), main(), MN_INIT(), move_element_to_menu(), move_text_box_to_menu(), pathfind_audio_occlusion(), PC_find_collision(), PC_process_collision_node(), PC_resolve_impulse(), PC_resolve_impulse_static(), PC_traverse_scene_bvh(), pick_lowest_point(), play_animation(), player_find_collision(), player_resolve_impulse(), player_resolve_impulse_static(), populate_draw_commands(), process_collision_node(), process_sdl_event(), query_probe_volume(), ray_traverse_mesh_bvh(), ray_traverse_scene_bvh(), raycast_scene(), read_mesh_node(), reassign_elements_to_container(), recalculate_audio_portal_paths(), remove_audio_portal(), render(), render_all_draw_commands(), render_asset_instance_menu(), render_audio_menu(), render_editor_menu(), render_light_menu(), render_lprobe_menu(), render_main_menu(), render_material_menu(), render_mesh_aabbs_from_root(), render_mn_menu(), render_text_menu(), render_to_cubemap_face(), render_ui_menu(), resolve_collisions(), retrieve_asset_by_name(), retrieve_mesh_by_name(), save_aportals(), save_lightmap_to_binary(), save_ui(), scene_load(), scene_load_volumes(), scene_save(), search_collisions_from_hull(), search_collisions_from_pc(), setup_initial_hull_points(), SKIN_INIT(), subdivide_light_bvh(), subdivide_mesh_tri_bvh(), subdivide_scene_bvh(), toggle_performance_overlay(), update_body_from_legs(), update_performance_overlay(), update_physics_components(), update_scene_nodes(), update_skin_matrices(), update_ui_state(), upload_bake_lights_gpu(), upload_instance_data(), upload_instances(), upload_joint_matrices(), upload_lights(), upload_material_data(), walk_coplanar_adjacency(), write_mesh_node(), and write_point_light_shadows().

◆ REMOVE_FROM_VEC

#define REMOVE_FROM_VEC ( vec,
index,
type )
Value:
type * buf = CAST_VEC(*vec, type); \
for (int i = index; i < (int)(vec)->count-1; i++) \
{ \
buf[i] = buf[i+1]; \
} \
(vec)->count--; \
#define CAST_VEC(vec, type)
Definition utilities.h:134

Definition at line 276 of file utilities.h.

Referenced by execute_aprobe_undo(), execute_light_undo(), execute_lprobe_undo(), execute_rprobe_undo(), expand_hull(), incremental_hull(), remove_audio_portal(), render_audio_menu(), render_light_menu(), and render_lprobe_menu().

◆ SHIFT_VEC_RIGHT

#define SHIFT_VEC_RIGHT ( vec,
index,
type )
Value:
type * buf = CAST_VEC(*vec, type); \
for (int i = (int)(vec)->count; i > index; i--) \
{ \
buf[i] = buf[i-1]; \
} \
(vec)->count++; \

Definition at line 284 of file utilities.h.

Referenced by execute_aportal_undo(), execute_aprobe_undo(), execute_lprobe_undo(), and execute_rprobe_undo().

◆ REMOVE_FROM_ARR

#define REMOVE_FROM_ARR ( arr,
index,
count )
Value:
for (int i = index; i < (int)(*count)-1; i++) \
{ \
arr[i] = arr[i+1]; \
} \
(*count)--; \

Definition at line 292 of file utilities.h.

Referenced by EPA_expand_hull(), remove_element_from_container(), and remove_text_box_from_container().

◆ PRINT_VEC2N

#define PRINT_VEC2N ( vec)
Value:
printf("%s x: %.3f y: %.3f\n", #vec, vec.x, vec.y); \

Definition at line 299 of file utilities.h.

◆ PRINT_VEC3

#define PRINT_VEC3 ( vec,
a,
b,
c )
Value:
printf("%s %s: %.3f %s: %.3f %s: %.3f\n", #vec, a, vec.x, b, vec.y, c, vec.z); \

Definition at line 302 of file utilities.h.

◆ PRINT_VEC3N

#define PRINT_VEC3N ( vec)
Value:
printf("%s x: %.3f y: %.3f z: %.3f\n", #vec, vec.x, vec.y, vec.z); \

Definition at line 305 of file utilities.h.

Referenced by epa(), EPA_add_horizon_face_to_hull_faces(), and recalculate_audio_portal_paths().

◆ PRINT_VEC4N

#define PRINT_VEC4N ( vec)
Value:
printf("%s x: %.3f y: %.3f z: %.3f w: %.3f\n", #vec, vec.x, vec.y, vec.z, vec.w); \

Definition at line 308 of file utilities.h.

Function Documentation

◆ vector_push()

int vector_push ( Vector * v,
void * o )

◆ vector_expand()

◆ compose_2d_transform()

◆ float32_to_float16()

uint16_t float32_to_float16 ( float f)

Definition at line 110 of file utilities.c.

References float32_to_float16().

Referenced by float32_to_float16().

◆ init_vector()

◆ triangle_area()

float triangle_area ( vec3 a,
vec3 b,
vec3 c )

◆ is_similar_plane()

bool is_similar_plane ( vec3 n1,
vec3 n2,
vec3 p1,
vec3 p2,
float epsilon )

Definition at line 330 of file utilities.c.

References is_similar_plane(), and vec3_dot().

Referenced by compute_mesh_hulls(), and is_similar_plane().

◆ test_sphere_aabb()

bool test_sphere_aabb ( vec3 light_pos,
float light_radius,
vec3 min,
vec3 max )

Definition at line 246 of file utilities.c.

References test_sphere_aabb(), vec3_clamp(), vec3_dot(), and vec3_sub().

◆ compute_convex_hull()

void compute_convex_hull ( vec3 * points,
int count,
vec3 * out_hull,
int * out_count,
vec3 normal )

Definition at line 676 of file utilities.c.

References ccw(), ccwr(), compute_convex_hull(), leftmost_point(), leftmost_pointr(), and vec3::z.

Referenced by compute_convex_hull().

◆ compute_hull_faces()

void compute_hull_faces ( vec3 * points,
size_t * indices,
size_t count,
size_t * out_hull,
size_t * out_count,
vec3 normal )

◆ compute_hull_centroid()

◆ calculate_aabb_extents()

◆ calculate_aabb_bounds()

◆ compute_aabb_from_points()

void compute_aabb_from_points ( vec3 * points,
int point_count,
AABB * aabb )

◆ aabbs_intersect()

◆ transform_aabb_by_position()

AABB transform_aabb_by_position ( AABB aabb,
vec3 pos )

◆ transform_aabb_by_model_matrix()

◆ transform_aabb_by_model_matrix_rotation()

◆ fbm()

float fbm ( vec3 p)

Definition at line 221 of file utilities.c.

References fbm(), fbm_noise(), vec3_add(), and vec3_scale().

Referenced by compute_hull_centroid(), fbm(), and precompute_fbm_texture().

◆ vec4_equal()

bool vec4_equal ( vec4 a,
vec4 b,
float eps )

Definition at line 525 of file utilities.c.

References vec4_equal(), vec4::w, vec4::x, vec4::y, and vec4::z.

Referenced by check_equivalencyv4(), compute_hull_centroid(), and vec4_equal().

◆ vec3_equal()

◆ triangles_are_contiguous()

bool triangles_are_contiguous ( Triangle * a,
Triangle * b )

◆ compute_barycentric()

bool compute_barycentric ( const vec2 uv0,
const vec2 uv1,
const vec2 uv2,
const vec2 p,
float * b0,
float * b1,
float * b2 )

Definition at line 385 of file utilities.c.

References compute_barycentric(), vec2::x, and vec2::y.

Referenced by compute_barycentric(), and compute_hull_centroid().

◆ ray_intersects_triangle()

bool ray_intersects_triangle ( vec3 origin,
vec3 dir,
vec3 a,
vec3 b,
vec3 c,
float * out_t,
vec3 * out_hit_point,
vec3 * barycentric )

◆ compute_3d_barycentric()

void compute_3d_barycentric ( vec3 a,
vec3 b,
vec3 c,
vec3 p,
float * wA,
float * wB,
float * wC )

Definition at line 409 of file utilities.c.

References compute_3d_barycentric(), vec3_cross(), vec3_length(), and vec3_sub().

◆ generate_bounce()

vec3 generate_bounce ( uint32_t i,
uint32_t N )

Definition at line 429 of file utilities.c.

References generate_bounce(), M_PI, and rand().

Referenced by compute_hull_centroid(), and generate_bounce().

◆ generate_sphere_dir()

vec3 generate_sphere_dir ( int i,
int N )

Definition at line 258 of file audio_probe_bake.comp.

References generate_sphere_dir(), and M_PI.

Referenced by compute_hull_centroid(), generate_sphere_dir(), main(), and trace_path().

◆ mesh_faces_are_contiguous()

bool mesh_faces_are_contiguous ( MeshFace * a,
vec3 * a_verts,
MeshFace * b,
vec3 * b_verts )

◆ project_point_plane()

vec3 project_point_plane ( vec3 point,
vec3 plane_point,
vec3 normal )

◆ closest_point_triangle()

vec3 closest_point_triangle ( vec3 p,
vec3 a,
vec3 b,
vec3 c )

◆ closest_point_segment()

◆ wrap_angle_pi()

float wrap_angle_pi ( float angle)
inline

Definition at line 57 of file utilities.h.

References M_PI, M_TAU, and wrap_angle_pi().

Referenced by process_sdl_event(), update_angular_spring(), and wrap_angle_pi().

◆ SDF_circle()

float SDF_circle ( vec2 p,
vec2 center,
float radius )
inline

Definition at line 65 of file utilities.h.

References SDF_circle(), vec2_length(), and vec2_sub().

◆ SDF_rect()

float SDF_rect ( vec2 p,
vec2 center,
vec2 size,
float r )
inline

Definition at line 68 of file utilities.h.

References SDF_rect(), size, vec2_add(), vec2_length(), vec2_scale(), vec2_sub(), vec2::x, and vec2::y.

◆ vec3_min()

vec3 vec3_min ( vec3 a,
vec3 b )
inline

Definition at line 75 of file utilities.h.

References MIN, vec3_min(), vec3::x, vec3::y, and vec3::z.

Referenced by vec3_min().

◆ vec3_max()

vec3 vec3_max ( vec3 a,
vec3 b )
inline

Definition at line 83 of file utilities.h.

References MAX, vec3_max(), vec3::x, vec3::y, and vec3::z.

Referenced by vec3_max().

◆ vec3_clamp()

vec3 vec3_clamp ( vec3 a,
vec3 b,
vec3 c )
inline

Definition at line 91 of file utilities.h.

References clamp(), vec3_clamp(), vec3::x, vec3::y, and vec3::z.

Referenced by test_sphere_aabb(), and vec3_clamp().

◆ vec2_inside_bounds()

bool vec2_inside_bounds ( vec2 p,
vec2 min,
vec2 max )
inline

Definition at line 100 of file utilities.h.

References vec2_inside_bounds(), vec2::x, and vec2::y.

Referenced by get_text_box_from_coords(), and vec2_inside_bounds().

◆ clip_against_plane()

int clip_against_plane ( const vec3 * in,
int in_count,
vec3 * out,
vec3 plane_point,
vec3 plane_normal )

Definition at line 794 of file utilities.c.

References A, B, clip_against_plane(), vec3_add(), vec3_dot(), vec3_scale(), and vec3_sub().

Referenced by clip_against_plane(), and perform_clip().

◆ clip_pts_against_plane()

int clip_pts_against_plane ( ClipVertex * in,
int in_count,
ClipVertex * out,
vec3 plane_point,
vec3 plane_normal )

◆ calculate_polygon_area()

float calculate_polygon_area ( vec3 p[],
int n )
inline

Definition at line 121 of file utilities.h.

References calculate_polygon_area(), n, and vec3::x.

Referenced by calculate_polygon_area().

◆ print_mat4()

void print_mat4 ( mat4 * m)
inline

◆ print_mat3()

void print_mat3 ( mat3 * m)
inline

Definition at line 152 of file utilities.h.

References mat3::a0, mat3::a1, mat3::a2, mat3::b0, mat3::b1, mat3::b2, mat3::c0, mat3::c1, mat3::c2, and print_mat3().

Referenced by print_mat3(), and print_obb().

◆ vec4_to_vec3()

◆ vec3_to_vec4()

◆ print_aabb()

void print_aabb ( AABB * aabb)
inline

◆ print_obb()

void print_obb ( OBB * obb)
inline

Definition at line 175 of file utilities.h.

References OBB::center, OBB::extents, print_mat3(), print_obb(), OBB::rot, vec3::x, vec3::y, and vec3::z.

Referenced by print_obb().

◆ frisvad_basis()

void frisvad_basis ( const vec3 n,
vec3 * b1,
vec3 * b2 )
inline

Definition at line 183 of file utilities.h.

References frisvad_basis(), n, vec3::x, vec3::y, and vec3::z.

◆ translate_aabb()

AABB translate_aabb ( AABB a,
vec3 b )
inline

◆ point_in_aabb()

bool point_in_aabb ( vec3 p,
AABB * aabb )
inline

◆ copy_vector()

void copy_vector ( Vector * a,
Vector * b )
inline

Definition at line 225 of file utilities.h.

References Vector::buffer, Vector::capacity, copy_vector(), and Vector::type_size.

Referenced by copy_vector().

◆ find_hull_point_z_from_plane()

float find_hull_point_z_from_plane ( Plane p,
vec2 xy )
inline

◆ compute_triangle_normal()

void compute_triangle_normal ( Triangle * tri)
inline

◆ compute_tri_normal()

◆ print_triangle()

void print_triangle ( Triangle * t)
inline

Definition at line 264 of file utilities.h.

References Point::pos, print_triangle(), Triangle::pts, vec3::x, vec3::y, and vec3::z.

Referenced by print_triangle().

◆ print_tri()

void print_tri ( vec3 a,
vec3 b,
vec3 c )
inline

Definition at line 270 of file utilities.h.

References print_tri(), vec3::x, vec3::y, and vec3::z.

Referenced by print_tri().

◆ mat4_mul_point()

◆ mat4_mul_pointr()

vec3 mat4_mul_pointr ( const mat4 m,
vec3 v )
inline

Definition at line 318 of file utilities.h.

References mat4_mul_pointr(), mul_m4_v4r(), vec4::w, vec3::x, vec4::x, vec3::y, vec4::y, vec3::z, and vec4::z.

Referenced by mat4_mul_pointr().

◆ mat4_mul_direction()

◆ quat_to_mat3()

mat3 quat_to_mat3 ( const vec4 q)
inline

◆ quat_from_axis_angle()

vec4 quat_from_axis_angle ( vec3 axis,
float angle )
inline

◆ quat_copy_sign()

vec4 quat_copy_sign ( vec4 a,
vec4 b )
inline

Definition at line 371 of file utilities.h.

References quat_copy_sign(), vec4::w, vec4::x, vec4::y, and vec4::z.

Referenced by quat_copy_sign().

◆ quat_mul()

vec4 quat_mul ( vec4 a,
vec4 b )
inline

Definition at line 384 of file utilities.h.

References quat_mul(), vec4::w, vec4::x, vec4::y, and vec4::z.

Referenced by quat_mul(), and update_physics_components().

◆ get_mat4_axis_x()

vec3 get_mat4_axis_x ( mat4 a)
inline

Definition at line 394 of file utilities.h.

References mat4::a0, mat4::a1, mat4::a2, and get_mat4_axis_x().

Referenced by get_mat4_axis_x().

◆ get_mat4_axis_y()

vec3 get_mat4_axis_y ( mat4 a)
inline

Definition at line 397 of file utilities.h.

References mat4::b0, mat4::b1, mat4::b2, and get_mat4_axis_y().

Referenced by get_mat4_axis_y().

◆ get_mat4_axis_z()

vec3 get_mat4_axis_z ( mat4 a)
inline

Definition at line 400 of file utilities.h.

References mat4::c0, mat4::c1, mat4::c2, and get_mat4_axis_z().

Referenced by get_mat4_axis_z().

◆ get_mat4_axis_w()

vec3 get_mat4_axis_w ( mat4 a)
inline

Definition at line 403 of file utilities.h.

References mat4::d0, mat4::d1, mat4::d2, and get_mat4_axis_w().

Referenced by get_mat4_axis_w().

◆ mat4_mul_flt()

mat4 mat4_mul_flt ( mat4 a,
float b )
inline

◆ mat4_identity()

◆ mat3_identity()

mat3 mat3_identity ( )
inline

Definition at line 438 of file utilities.h.

References mat3_identity().

Referenced by mat3_identity(), render_audio_menu(), render_lprobe_menu(), and render_obb_widget().

◆ mat4_translation()

mat4 mat4_translation ( vec3 t)
inline

◆ mat4_scale()

mat4 mat4_scale ( vec3 s)
inline

◆ mat4_from_quat()

◆ compose_trs_from_vectors()

◆ mat3_from_mat4()

mat3 mat3_from_mat4 ( const mat4 * m)
inline

◆ mat3_mul_vec3()

◆ mat3_mul_vec3r()

vec3 mat3_mul_vec3r ( mat3 m,
vec3 v )
inline

◆ mat4_transpose()

void mat4_transpose ( float * dst,
const float * src )
inline

Definition at line 513 of file utilities.h.

References mat4_transpose().

Referenced by mat4_transpose().

◆ m4_transpose()

◆ mat3_transpose()

mat3 mat3_transpose ( mat3 in)
inline

◆ mat3_mul()

mat3 mat3_mul ( mat3 M,
mat3 N )
inline

◆ mat3_inverse_transpose()

mat3 mat3_inverse_transpose ( mat3 m)
inline

◆ OBB_vectors()

void OBB_vectors ( mat3 rot,
vec3 * fwd,
vec3 * right,
vec3 * up )
inline

Definition at line 600 of file utilities.h.

References OBB_vectors(), and rot().

Referenced by OBB_min_corner(), OBB_vectors(), and PV_step_size().

◆ OBB_min_corner()

◆ point_in_obb()

bool point_in_obb ( OBB * obb,
vec3 pos )
inline

◆ triangle_centroid()

vec3 triangle_centroid ( vec3 A,
vec3 B,
vec3 C )
inline

Definition at line 640 of file utilities.h.

References A, B, C, triangle_centroid(), vec3_add(), and vec3_scale().

Referenced by build_light_bvh(), build_uv_islands(), and triangle_centroid().