blob: 937c38af44fb77bbdda322f896e5c73cc41a6525 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
/**
* @file geometry.h
* @author your name (you@domain.com)
* @brief Shapes and intersections between them
* @version 0.1
* @date 2024-02-24
*
* @copyright Copyright (c) 2024
*/
#pragma once
#include "maths.h"
typedef struct line_3d {
vec3 start, end;
} line_3d;
typedef struct plane {
vec3 normal;
} plane;
typedef struct cuboid {
vec3 half_extents;
} cuboid;
typedef struct sphere {
f32 radius;
} sphere;
typedef struct cylinder {
f32 radius;
f32 half_height;
} cylinder;
typedef struct cone {
f32 radius;
f32 half_height;
} cone;
// TODO:
// capsule
// torus
// ray
// frustum
// conical frustum
// wedge
// 2d...
// line
// circle
|