MCPcopy Create free account
hub / github.com/crownengine/crown / from_points

Function from_points

src/core/math/aabb.cpp:20–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 }
19
20 void from_points(AABB &b, u32 num, u32 stride, const void *points)
21 {
22 CE_ENSURE(num > 0);
23 CE_ENSURE(points != NULL);
24
25 const char *pts = (char *)points;
26 const f32 *point = (f32 *)pts;
27
28 b.min.x = b.max.x = point[0];
29 b.min.y = b.max.y = point[1];
30 b.min.z = b.max.z = point[2];
31 pts += stride;
32
33 for (u32 i = 1; i < num; ++i, pts += stride) {
34 point = (f32 *)pts;
35
36 b.min.x = min(b.min.x, point[0]);
37 b.min.y = min(b.min.y, point[1]);
38 b.min.z = min(b.min.z, point[2]);
39 b.max.x = max(b.max.x, point[0]);
40 b.max.y = max(b.max.y, point[1]);
41 b.max.z = max(b.max.z, point[2]);
42 }
43 }
44
45 void from_boxes(AABB &b, u32 num, const AABB *boxes)
46 {

Callers 7

test_aabbFunction · 0.85
compileFunction · 0.85
obbFunction · 0.85
compile_sphereFunction · 0.85
compile_capsuleFunction · 0.85
compile_boxFunction · 0.85
renderMethod · 0.85

Calls 2

minFunction · 0.50
maxFunction · 0.50

Tested by 1

test_aabbFunction · 0.68