libgpac
Documentation of the core library of GPAC
mesh_collide.c File Reference
+ Include dependency graph for mesh_collide.c:

Data Structures

struct  AABSplitParams
 

Functions

static GFINLINE void update_node_bounds (GF_Mesh *mesh, AABBNode *node)
 
static GFINLINE u32 gf_vec_main_axis (SFVec3f v)
 
static GFINLINE Fixed tri_get_center (GF_Mesh *mesh, u32 tri_idx, u32 axis)
 
static GFINLINE u32 aabb_split (GF_Mesh *mesh, AABBNode *node, u32 axis)
 
static void mesh_subdivide_aabbtree (GF_Mesh *mesh, AABBNode *node, AABSplitParams *aab_par)
 
void gf_mesh_build_aabbtree (GF_Mesh *mesh)
 
static void ray_hit_triangle_get_u_v (GF_Ray *ray, GF_Vec *v0, GF_Vec *v1, GF_Vec *v2, Fixed *u, Fixed *v)
 
Bool gf_mesh_aabb_ray_hit (GF_Mesh *mesh, AABBNode *n, GF_Ray *ray, Fixed *closest, SFVec3f *outPoint, SFVec3f *outNormal, SFVec2f *outTexCoords)
 
Bool gf_mesh_intersect_ray (GF_Mesh *mesh, GF_Ray *ray, SFVec3f *outPoint, SFVec3f *outNormal, SFVec2f *outTexCoords)
 
static GFINLINE Bool mesh_collide_triangle (GF_Ray *ray, SFVec3f *v0, SFVec3f *v1, SFVec3f *v2, Fixed *dist)
 
static GFINLINE Bool sphere_box_overlap (SFVec3f sc, Fixed sq_rad, SFVec3f bmin, SFVec3f bmax)
 
Bool gf_mesh_closest_face_aabb (GF_Mesh *mesh, AABBNode *node, SFVec3f pos, Fixed min_dist, Fixed min_sq_dist, Fixed *min_col_dist, SFVec3f *outPoint)
 
Bool gf_mesh_closest_face (GF_Mesh *mesh, SFVec3f pos, Fixed min_dist, SFVec3f *outPoint)
 

Data Structure Documentation

◆ AABSplitParams

struct AABSplitParams
Data Fields
u32 max_depth
u32 min_tri_limit
u32 split_type
u32 depth
u32 nb_nodes

Function Documentation

◆ update_node_bounds()

static GFINLINE void update_node_bounds ( GF_Mesh mesh,
AABBNode node 
)
static
+ Here is the caller graph for this function:

◆ gf_vec_main_axis()

static GFINLINE u32 gf_vec_main_axis ( SFVec3f  v)
static
+ Here is the caller graph for this function:

◆ tri_get_center()

static GFINLINE Fixed tri_get_center ( GF_Mesh mesh,
u32  tri_idx,
u32  axis 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aabb_split()

static GFINLINE u32 aabb_split ( GF_Mesh mesh,
AABBNode node,
u32  axis 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mesh_subdivide_aabbtree()

static void mesh_subdivide_aabbtree ( GF_Mesh mesh,
AABBNode node,
AABSplitParams aab_par 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_mesh_build_aabbtree()

void gf_mesh_build_aabbtree ( GF_Mesh mesh)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ray_hit_triangle_get_u_v()

static void ray_hit_triangle_get_u_v ( GF_Ray ray,
GF_Vec v0,
GF_Vec v1,
GF_Vec v2,
Fixed u,
Fixed v 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_mesh_aabb_ray_hit()

Bool gf_mesh_aabb_ray_hit ( GF_Mesh mesh,
AABBNode n,
GF_Ray ray,
Fixed closest,
SFVec3f outPoint,
SFVec3f outNormal,
SFVec2f outTexCoords 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_mesh_intersect_ray()

Bool gf_mesh_intersect_ray ( GF_Mesh mesh,
GF_Ray ray,
SFVec3f outPoint,
SFVec3f outNormal,
SFVec2f outTexCoords 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mesh_collide_triangle()

static GFINLINE Bool mesh_collide_triangle ( GF_Ray ray,
SFVec3f v0,
SFVec3f v1,
SFVec3f v2,
Fixed dist 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sphere_box_overlap()

static GFINLINE Bool sphere_box_overlap ( SFVec3f  sc,
Fixed  sq_rad,
SFVec3f  bmin,
SFVec3f  bmax 
)
static
+ Here is the caller graph for this function:

◆ gf_mesh_closest_face_aabb()

Bool gf_mesh_closest_face_aabb ( GF_Mesh mesh,
AABBNode node,
SFVec3f  pos,
Fixed  min_dist,
Fixed  min_sq_dist,
Fixed min_col_dist,
SFVec3f outPoint 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_mesh_closest_face()

Bool gf_mesh_closest_face ( GF_Mesh mesh,
SFVec3f  pos,
Fixed  min_dist,
SFVec3f outPoint 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function: