MCPcopy Create free account
hub / github.com/esengine/esengine / createCollider

Method createCollider

packages/rapier2d/pkg/rapier_wasm2d.js:702–717  ·  view source on GitHub ↗

* @param {boolean} enabled * @param {RawShape} shape * @param {RawVector} translation * @param {RawRotation} rotation * @param {number} massPropsMode * @param {number} mass * @param {RawVector} centerOfMass * @param {number} principalAngularInertia * @param {n

(enabled, shape, translation, rotation, massPropsMode, mass, centerOfMass, principalAngularInertia, density, friction, restitution, frictionCombineRule, restitutionCombineRule, isSensor, collisionGroups, solverGroups, activeCollisionTypes, activeHooks, activeEvents, contactForceEventThreshold, contactSkin, hasParent, parent, bodies)

Source from the content-addressed store, hash-verified

700 * @returns {number | undefined}
701 */
702 createCollider(enabled, shape, translation, rotation, massPropsMode, mass, centerOfMass, principalAngularInertia, density, friction, restitution, frictionCombineRule, restitutionCombineRule, isSensor, collisionGroups, solverGroups, activeCollisionTypes, activeHooks, activeEvents, contactForceEventThreshold, contactSkin, hasParent, parent, bodies) {
703 try {
704 const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
705 _assertClass(shape, RawShape);
706 _assertClass(translation, RawVector);
707 _assertClass(rotation, RawRotation);
708 _assertClass(centerOfMass, RawVector);
709 _assertClass(bodies, RawRigidBodySet);
710 wasm.rawcolliderset_createCollider(retptr, this.__wbg_ptr, enabled, shape.__wbg_ptr, translation.__wbg_ptr, rotation.__wbg_ptr, massPropsMode, mass, centerOfMass.__wbg_ptr, principalAngularInertia, density, friction, restitution, frictionCombineRule, restitutionCombineRule, isSensor, collisionGroups, solverGroups, activeCollisionTypes, activeHooks, activeEvents, contactForceEventThreshold, contactSkin, hasParent, parent, bodies.__wbg_ptr);
711 var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
712 var r2 = getDataViewMemory0().getFloat64(retptr + 8 * 1, true);
713 return r0 === 0 ? undefined : r2;
714 } finally {
715 wasm.__wbindgen_add_to_stack_pointer(16);
716 }
717 }
718 /**
719 * Applies the given JavaScript function to the integer handle of each collider managed by this collider set.
720 *

Callers

nothing calls this directly

Calls 4

_assertClassFunction · 0.85
getDataViewMemory0Function · 0.85
getInt32Method · 0.80
getFloat64Method · 0.80

Tested by

no test coverage detected