Class: ModelEditor

ModelEditor

new ModelEditor(options)

Model editing class.

Name Type Description
options Object optional

Contains the following attributes:

Name Type Default Description
model Entity | S3MInstance | GeoModel3D

The model object that needs to be edited.

scene Scene

Scene objects.

offset Cartesian3 Cartesian3.ZERO optional

Edit the overall offset of the origin of the component relative to the origin of the model. If not set, the origin of the edited component will be the origin of the model.

hoverColor Color Color.WHITE optional

Edit the activation status color of the component.

scale Number 1.0 optional

Edit the overall scaling of the component.

axesShow Object {"translation": true, "rotation": true, "scale": true} optional

Used to specify which axes (translation, rotation, scaling) are visible.

lineWidthScale Number 4.0 optional

Used to set the scaling factor of the editor's line width.

Members

readonly changedEvtEvent

Trigger event when editing model changes, return the current model matrix of the model

Example
handler.changedEvt.addEventListener(function(result){
     let {modelMatrix, transitionAddtion} = result;
});

Methods

activate()

Activate the editor.

deactivate()

Make the editor ineffective.

destroy()

Destroy the editor.

setEditObject(model)

Used to switch and edit model objects.

Name Type Description
model Entity | S3MInstance | GeoModel3D

Set the edited model object