LibGame  v0.4.0
The LG Game Engine - Copyright (C) 2024 ETMSoftware
lg_collision_detect.h
1 /*
2  * LibGame - Copyright (C) Emmanuel Thomas-Maurin 2011-2024
3  * All rights reserved
4  */
5 
6 #ifndef LG_COLLISION_DETECT_H
7 #define LG_COLLISION_DETECT_H
8 
9 /* Axis-aligned bounding box, now defined in lg_mesh.h */
10 /*typedef struct {
11  float min_x;
12  float max_x;
13  float min_y;
14  float max_y;
15  float min_z;
16  float max_z;
17 } LG_BBox;*/
18 
19 /* Bounding sphere */
20 typedef struct {
21  vec3_t center;
22  float radius;
23 } LG_BSphere;
24 
25 LG_BBox lg_bbox(float, float, float, float, float, float);
26 
28 
30 
32 
34 
35 /* Not sure about that so discarded for now
36 zboolean lg_bbox_is_AA(LG_BBox *);*/
37 
39 
40 zboolean lg_bboxes_collide(LG_BBox *, LG_BBox *);
41 
42 zboolean lg_bbox_sets_collide(LG_BBox **, LG_BBox **);
43 
45 
46 void lg_bbox_info(LG_BBox *);
47 
48 LG_BSphere lg_bsphere(float, float, float, float);
49 
51 
53 
55 
57 
59 
60 #endif /* LG_COLLISION_DETECT_H */
LG_Mesh
Definition: lg_mesh.h:68
lg_bsphere_info
void lg_bsphere_info(LG_BSphere bsphere)
Definition: lg_collision_detect.c:413
LG_Cuboid
Definition: lg_3d_primitives.h:64
LG_BBox
Definition: lg_mesh.h:43
lg_bbox_from_mesh
LG_BBox lg_bbox_from_mesh(LG_Mesh *mesh)
Definition: lg_collision_detect.c:141
lg_bbox_from_cuboid
LG_BBox lg_bbox_from_cuboid(LG_Cuboid *cuboid)
Definition: lg_collision_detect.c:61
lg_bbox_transform
LG_BBox lg_bbox_transform(LG_BBox bbox, mat4_t matrix)
Definition: lg_collision_detect.c:153
Lines3D_VB
Definition: lg_3d_primitives.h:53
lg_bbox_info
void lg_bbox_info(LG_BBox *bbox)
Definition: lg_collision_detect.c:304
vec3_t
Definition: math_3d.h:111
lg_bbox_get_center
vec3_t lg_bbox_get_center(LG_BBox *bbox)
Definition: lg_collision_detect.c:204
lg_bsphere
LG_BSphere lg_bsphere(float x_center, float y_center, float z_center, float radius)
Definition: lg_collision_detect.c:328
lg_bbox
LG_BBox lg_bbox(float min_x, float max_x, float min_y, float max_y, float min_z, float max_z)
Definition: lg_collision_detect.c:29
LG_Color_u
Definition: lg_vertex.h:91
lg_bsphere_from_mesh
LG_BSphere lg_bsphere_from_mesh(LG_Mesh *mesh)
Definition: lg_collision_detect.c:363
lg_bbox_sets_collide
zboolean lg_bbox_sets_collide(LG_BBox *bbox1[], LG_BBox *bbox2[])
Definition: lg_collision_detect.c:234
lg_bboxes_collide
zboolean lg_bboxes_collide(LG_BBox *bbox1, LG_BBox *bbox2)
Definition: lg_collision_detect.c:216
lg_bsphere_from_bbox
LG_BSphere lg_bsphere_from_bbox(LG_BBox bbox)
Definition: lg_collision_detect.c:347
lg_bspheres_collide
zboolean lg_bspheres_collide(LG_BSphere *bsphere1, LG_BSphere *bsphere2)
Definition: lg_collision_detect.c:375
lg_cuboid_from_bbox
LG_Cuboid lg_cuboid_from_bbox(LG_BBox bbox, LG_Color_u c)
Definition: lg_collision_detect.c:116
LG_BSphere
Definition: lg_collision_detect.h:20
lg_l3d_vb_from_bbox
Lines3D_VB lg_l3d_vb_from_bbox(LG_BBox bbox, LG_Color_u c)
Definition: lg_collision_detect.c:275
lg_bsphere_sets_collide
zboolean lg_bsphere_sets_collide(LG_BSphere *bsphere1[], LG_BSphere *bsphere2[])
Definition: lg_collision_detect.c:391
mat4_t
Definition: math_3d.h:167