-
Notifications
You must be signed in to change notification settings - Fork 2
/
vgen_bounds.h
31 lines (27 loc) · 977 Bytes
/
vgen_bounds.h
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
// .___
// ___ __ ____ ___ ___ ____ __| _/
// \ \/ // __ \\ \/ // __ \ / __ |
// \ /\ ___/ > <\ ___// /_/ |
// \_/ \___ >__/\_ \\___ >____ |
// \/ \/ \/ \/ __ .__
// ____ ____ ____ ________________ _/ |_|__| ____ ____
// / ___\_/ __ \ / \_/ __ \_ __ \__ \\ __\ |/ _ \ / \
// / /_/ > ___/| | \ ___/| | \// __ \| | | ( <_> ) | \
// \___ / \___ >___| /\___ >__| (____ /__| |__|\____/|___| /
// /_____/ \/ \/ \/ \/ \/
//
// (c) 2016 - 2020 Karsten Schmidt // ASL 2.0 licensed
#ifndef __vgen_bounds_h__
#define __vgen_bounds_h__
struct vgAABB {
vector center;
vector size;
}
vgAABB
vg_aabb_normalized(int geo) {
vector c = getbbox_center(0);
vector size = getbbox_size(0);
float s = 1.0 / max(size.x, size.y, size.z);
return vgAABB(c * s, size * s, s);
}
#endif