LCCObject::setRotation
Sets the rotation of the LCC model.
Rotation is applied in the LCC model's coordinate space.
Version Requirement
SDK v0.3.1+
Engine Support
CesiumJS
API
LCCObject::setRotation(rotation: Cesium.Matrix3 | { heading: number, pitch: number, roll: number } | Cesium.HeadingPitchRoll): void
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
rotation | Cesium.Matrix3 / { heading: number, pitch: number, roll: number } / Cesium.HeadingPitchRoll | Yes | - | Before SDK v0.6.3, pass a Cesium.Matrix3 rotation matrix; from SDK v0.6.3+, ENU coordinate system based, pass an object with heading, pitch, roll or a Cesium.HeadingPitchRoll. |
Return Value
void
Usage Example
SDK v0.3.1 – v0.6.2
const matrix3 = new Cesium.Matrix3();
lccObject.setRotation(matrix3);
SDK v0.6.3+ (ENU Coordinate System)
Starting from v0.6.3, rotation is based on the ENU coordinate system, with parameters changed to heading, pitch, and roll angles.
lccObject.setRotation({ heading: 1, pitch: 0, roll: 0 });
You can also use Cesium.HeadingPitchRoll:
const hpr = new Cesium.HeadingPitchRoll(1, 0, 0);
lccObject.setRotation(hpr);
Notes
- This method must be called after the success callback of
LCCRender.load()has been triggered.
Related APIs
LCCObject::setScale()LCCObject::setOriginPosition()