Skip to content

eulerjs API / @eulerjs/core / fitCollider

fitCollider() ​

ts
function fitCollider(
   shape, 
   geometry, 
   options?
): Collider;

Defined in: packages/core/src/colliders/fitCollider.ts:19

A collider of the given shape fitted around a geometry, in the geometry's frame: its bounding box, its bounding sphere, its convex hull, or a cylinder, cone or capsule standing along its y axis, as three.js's own cylinder, cone and capsule geometries do, as wide as the wider of x and z. What world.addBody(object, { collider: 'box' }) and the rest fit; options sets the rest of the collider, its friction say, all but where it sits, which the fit decides.

Parameters ​

ParameterType
shapeColliderShorthand
geometryBufferGeometry
options?Omit<ColliderOptions, "offset" | "rotation">

Returns ​

Collider

Released under the MIT License.