LCCObject::getBounds
Gets the AABB bounding box of the LCC model scene.
Version Requirement
SDK v0.4.0+
Engine Support
Three.js / CesiumJS
API
LCCObject::getBounds(): BoundingBox
Parameters
None
Return Value
Returns a bounding box object with the following properties:
Three.js
| Property | Type | Description |
|---|---|---|
min | { x: number, y: number, z: number } | Minimum point of the bounding box. |
max | { x: number, y: number, z: number } | Maximum point of the bounding box. |
CesiumJS
| Property | Type | Description |
|---|---|---|
min | { x: number, y: number, z: number } | Minimum point of the bounding box. |
max | { x: number, y: number, z: number } | Maximum point of the bounding box. |
origin | { x: number, y: number, z: number } | Scene origin point coordinates (WGS84 Cartesian coordinate system). |
Usage Example
Three.js
const box = lccObject.getBounds();
console.log('min: ', box.min.x, box.min.y, box.min.z);
console.log('max: ', box.max.x, box.max.y, box.max.z);
CesiumJS
const box = lccObject.getBounds();
console.log('min: ', box.min.x, box.min.y, box.min.z);
console.log('max: ', box.max.x, box.max.y, box.max.z);
console.log('origin: ', box.origin.x, box.origin.y, box.origin.z);
Notes
- This method must be called after the success callback of
LCCRender.load()has been triggered. - In Three.js, the bounding box is based on the LCC model's local coordinate system.
- In CesiumJS, for non-RTK data the bounding box is based on the LCC model's local coordinate system; for RTK data the bounding box is based on the projection coordinate system.
originuses the WGS84 Cartesian coordinate system.
Related APIs
LCCObject::getProjectionCoordinateSystemInfos()