Skip to main content

LCC for Web Manual · v0.6.3 · Page 26 of 68

LCCObject::intersectsSphere

Sphere collision test.

Version Requirement

SDK v0.4.1+

Engine Support

Three.js

API

LCCObject::intersectsSphere(param: IntersectsSphereParam): IntersectsSphereResult

Parameters

ParameterTypeRequiredDefaultDescription
param.center{ x: number, y: number, z: number }Yes-Sphere center position.
param.radiusnumberYes-Sphere radius.
param.noDeltabooleanNo-When true, collision offset is not calculated for faster detection; when false, offset is computed.

Return Value

PropertyTypeDescription
hitbooleanWhether a collision occurred.
delta{ x: number, y: number, z: number }Collision offset, useful for adjusting digital human position. Direction points toward the collider. Only valid when noDelta is false.

Usage Example

const ret = lccObject.hasCollision();
if (ret) {
    const center = { x: 10, y: 10, z: 10 };
    const radius = 1;
    const noDelta = true;
    let intersectResult = lccObject.intersectsSphere({ center, radius, noDelta });
    if (intersectResult.hit) {
        console.log('Collision occurs');
    }
} else {
    // Collision function not supported
}

Notes

  • This method must be called after the success callback of LCCRender.load() has been triggered.
  • Check collision support via hasCollision() before use.
  • The SDK only loads collision data within the vicinity of the camera position.
  • LCCObject::hasCollision()
  • LCCObject::intersectsCapsule()

XGRIDS documentation, reproduced as published and captured on October 27, 2026. Read this page on docs.xgrids.com

Stuck on a Step?

QRC supports every scanner and software seat it sells. Send us the page you are on and we will walk you through it.

Contact Us
Request a Quote