Untitled
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
18bool ray_intersects_aabb(AABB aabb, vec3 origin, vec3 dir, vec3 inv_dir);
19
20
31bool ray_intersects_aabb_with_point(AABB aabb, vec3 origin, vec3 dir, vec3 inv_dir, vec3 * intersection_point);
32
42bool ray_intersects_obb_with_point(OBB obb, vec3 origin, vec3 dir, vec3 * intersection_point);
43
52RayHit raycast_scene(vec3 start, vec3 dir, float initial_t, bool check_normal);
53
54// TODO make this non-recursive
66bool traverse_collision_bvh(Mesh * m, MeshNode * mn, BVHNode * nodes, BVHNode * node, vec3 proposed, vec3 inv_p, CollisionPoints * p);
67
71void init_scene_bvh();
72
76void init_mesh_tri_bvh(Mesh * mesh);
77
81void build_light_bvh();
82
83#endif
void init_scene_bvh()
Initializes or updates the pre-existing scene bvh based on all mesh nodes with valid meshes.
RayHit raycast_scene(vec3 start, vec3 dir, float initial_t, bool check_normal)
Raycasts through the scene and finds closest intersection to meshes.
bool ray_intersects_aabb(AABB aabb, vec3 origin, vec3 dir, vec3 inv_dir)
Checks if a ray intersects an aabb.
void init_mesh_tri_bvh(Mesh *mesh)
Initializes the bvh for a mesh's triangles.
void build_light_bvh()
Initializes a bvh for all current lights and emissive triangles in the scene, and sets the flux up fo...
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.
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.
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 ...
Engine specific types and defines.
Points that track collision data such as direction, penetration depth, and more to generate Manifolds...
MeshNodes that describe the position of Meshes, GLTF nodes for GLTFAnimations, or hold references to ...
Oriented Bounding Boxes.
Definition dynamic.frag:14
A Mesh with geometry data that is either initialized as static or dynamic and split into SubMeshes.
Nodes for the acceleration structures of BVHs.
Definition types.h:12