Untitled
Toggle main menu visibility
Loading...
Searching...
No Matches
acceleration.h
Go to the documentation of this file.
1
5
6
#ifndef ACCELERATION_H
7
#define ACCELERATION_H
8
#include "
engine_types.h
"
9
18
bool
ray_intersects_aabb
(
AABB
aabb,
vec3
origin,
vec3
dir,
vec3
inv_dir);
19
20
31
bool
ray_intersects_aabb_with_point
(
AABB
aabb,
vec3
origin,
vec3
dir,
vec3
inv_dir,
vec3
* intersection_point);
32
42
bool
ray_intersects_obb_with_point
(
OBB
obb,
vec3
origin,
vec3
dir,
vec3
* intersection_point);
43
52
RayHit
raycast_scene
(
vec3
start,
vec3
dir,
float
initial_t,
bool
check_normal);
53
54
// TODO make this non-recursive
66
bool
traverse_collision_bvh
(
Mesh
* m,
MeshNode
* mn,
BVHNode
* nodes,
BVHNode
* node,
vec3
proposed,
vec3
inv_p,
CollisionPoints
* p);
67
71
void
init_scene_bvh
();
72
76
void
init_mesh_tri_bvh
(
Mesh
* mesh);
77
81
void
build_light_bvh
();
82
83
#endif
init_scene_bvh
void init_scene_bvh()
Initializes or updates the pre-existing scene bvh based on all mesh nodes with valid meshes.
Definition
acceleration.c:850
raycast_scene
RayHit raycast_scene(vec3 start, vec3 dir, float initial_t, bool check_normal)
Raycasts through the scene and finds closest intersection to meshes.
Definition
acceleration.c:448
ray_intersects_aabb
bool ray_intersects_aabb(AABB aabb, vec3 origin, vec3 dir, vec3 inv_dir)
Checks if a ray intersects an aabb.
Definition
acceleration.c:157
init_mesh_tri_bvh
void init_mesh_tri_bvh(Mesh *mesh)
Initializes the bvh for a mesh's triangles.
Definition
acceleration.c:1231
build_light_bvh
void build_light_bvh()
Initializes a bvh for all current lights and emissive triangles in the scene, and sets the flux up fo...
Definition
acceleration.c:1600
ray_intersects_obb_with_point
bool ray_intersects_obb_with_point(OBB obb, vec3 origin, vec3 dir, vec3 *intersection_point)
Checks if a ray intersects an obb and outputs an intersection point.
Definition
acceleration.c:220
ray_intersects_aabb_with_point
bool ray_intersects_aabb_with_point(AABB aabb, vec3 origin, vec3 dir, vec3 inv_dir, vec3 *intersection_point)
Checks if a ray intersects an aabb and outputs an intersection point.
Definition
acceleration.c:182
traverse_collision_bvh
bool traverse_collision_bvh(Mesh *m, MeshNode *mn, BVHNode *nodes, BVHNode *node, vec3 proposed, vec3 inv_p, CollisionPoints *p)
Traverses the mesh bvh to find collisions based on point vs aabb within a certain epsilon for player ...
Definition
acceleration.c:514
engine_types.h
Engine specific types and defines.
CollisionPoints
Points that track collision data such as direction, penetration depth, and more to generate Manifolds...
Definition
engine_types.h:986
MeshNode
MeshNodes that describe the position of Meshes, GLTF nodes for GLTFAnimations, or hold references to ...
Definition
audio_probe_bake.comp:85
OBB
Oriented Bounding Boxes.
Definition
dynamic.frag:14
Mesh
A Mesh with geometry data that is either initialized as static or dynamic and split into SubMeshes.
Definition
engine_types.h:2485
BVHNode
Nodes for the acceleration structures of BVHs.
Definition
audio_probe_bake.comp:126
AABB
Definition
audio_probe_bake.comp:111
RayHit
Definition
audio_probe_bake.comp:272
vec3
Definition
types.h:12
src
core
acceleration.h
Generated by
1.18.0