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

Function from_boxes

src/core/math/aabb.cpp:45–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43 }
44
45 void from_boxes(AABB &b, u32 num, const AABB *boxes)
46 {
47 CE_ENSURE(num > 0);
48 CE_ENSURE(boxes != NULL);
49
50 b.min.x = boxes[0].min.x;
51 b.min.y = boxes[0].min.y;
52 b.min.z = boxes[0].min.z;
53 b.max.x = boxes[0].max.x;
54 b.max.y = boxes[0].max.y;
55 b.max.z = boxes[0].max.z;
56
57 for (u32 i = 1; i < num; ++i) {
58 b.min.x = min(b.min.x, boxes[i].min.x);
59 b.min.y = min(b.min.y, boxes[i].min.y);
60 b.min.z = min(b.min.z, boxes[i].min.z);
61 b.max.x = max(b.max.x, boxes[i].max.x);
62 b.max.y = max(b.max.y, boxes[i].max.y);
63 b.max.z = max(b.max.z, boxes[i].max.z);
64 }
65 }
66
67 Vector3 vertex(const AABB &b, u32 index)
68 {

Callers 1

test_aabbFunction · 0.85

Calls 2

minFunction · 0.50
maxFunction · 0.50

Tested by 1

test_aabbFunction · 0.68