LCCObject::hasCollision
Queries whether the current LCC model contains collision data.
If collision data is available, the collision detection methods (intersectsRayExt, intersectsRayFromOriginExt, intersectsSphere, intersectsCapsule) become usable, enabling features such as digital human collision detection.
Version Requirement
SDK v0.4.1+
Engine Support
Three.js
API
LCCObject::hasCollision(): boolean
Parameters
None
Return Value
boolean — true indicates collision data is available and collision detection methods can be used; false indicates no collision data.
Usage Example
const ret = lccObject.hasCollision();
if (ret) {
console.log('Collision function available');
} else {
console.log('Collision function is not available');
}
Notes
- This method must be called after the success callback of
LCCRender.load()has been triggered. - The SDK only loads collision data within the vicinity of the camera position.
Related APIs
LCCObject::intersectsRayExt()LCCObject::intersectsRayFromOriginExt()LCCObject::intersectsSphere()LCCObject::intersectsCapsule()