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

Function compile_capsule

src/resource/physics_resource.cpp:129–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127 }
128
129 void compile_capsule(ColliderDesc &sd, const Array<Vector3> &points)
130 {
131 AABB aabb;
132 aabb::from_points(aabb, array::size(points), array::begin(points));
133
134 const Vector3 origin = aabb::center(aabb);
135 sd.local_tm.t = { origin.x, origin.y, origin.z, 1.0f };
136 sd.capsule.radius = aabb::radius(aabb) / 2.0f;
137 sd.capsule.height = (aabb.max.y - aabb.min.y) / 2.0f;
138 }
139
140 void compile_box(ColliderDesc &sd, const Array<Vector3> &points)
141 {

Callers 1

compile_colliderFunction · 0.85

Calls 3

from_pointsFunction · 0.85
sizeFunction · 0.50
beginFunction · 0.50

Tested by

no test coverage detected