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

Function compile_box

src/resource/physics_resource.cpp:140–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138 }
139
140 void compile_box(ColliderDesc &sd, const Array<Vector3> &points)
141 {
142 AABB aabb;
143 aabb::from_points(aabb, array::size(points), array::begin(points));
144
145 const Vector3 origin = aabb::center(aabb);
146 sd.local_tm.t = { origin.x, origin.y, origin.z, 1.0f };
147 sd.box.half_size = (aabb.max - aabb.min) * 0.5f;
148 }
149
150 s32 compile_collider(Buffer &output, UnitCompiler &compiler, FlatJsonObject &obj, CompileOptions &opts)
151 {

Callers 1

compile_colliderFunction · 0.85

Calls 3

from_pointsFunction · 0.85
sizeFunction · 0.50
beginFunction · 0.50

Tested by

no test coverage detected