S3MInstance

new Supermap3D.S3MInstance(context, index, ownerGroup, options)

S3M model instance object.
Name Type Description
context Context context object.
index Number The index position of the group where this instance belongs.
ownerGroup Object The group the instance belongs to.
options Object The object has the following properties:
Name Type Description
position Cartesian3 optional World location.
color Color optional Colour.
scale Cartesian3 optional Zoom.
hpr HeadingPitchRoll optional Rotation (radians)
offset Cartesian3 optional center point offset
feature Object optional Description.

Members

boundingSphere : BoundingSphere

Get or set the bounding ball of this instance.

readonlycolor : Color

Get the color of this instance.

readonlyfeature : Object

Get the description information of the instance.

readonlyhpr : HeadingPitchRoll

Get the rotation coefficient of this instance.

id : Number

Get or set the id of the instance.

index : Number

Get or set the index position of the instance.

isDeleted : Boolean

Get or set whether the instance is removed. The instance is removed when the value is true, and the instance is not removed when the value is false. The default value is false.

readonlyisSelected : Boolean

Get the selected state of the instance.

localQuaternion : Quaternion

Local rotation quaternion

localTransform : Matrix4

Local transformation matrix (translation rotation scaling)

localTranslation : Cartesian3

local translation vector

readonlyoffset : Cartesian3

Get the offset position of the model center point of this instance.

readonlyposition : Cartesian3

Get the instance location.

readonlyscale : Cartesian3

Get the zoom factor of this instance.

visible : Boolean

Get or set whether the instance is displayed

Methods

setSelected(offset)

Set the instance as selected and highlight the instance.
Name Type Description
offset Number The index position of the group in which the instance is located

setUnSelected(offset)

Cancel the selected state of the instance.
Name Type Description
offset Number The index position of the group in which the instance is located

updateColor(color)

Update the instance color.
Name Type Description
color Color The color value.

updateModelMatrix(matrix)

Update instance translation, rotation, and scaling parameters
Name Type Description
matrix

updatePosition(position)

Update the instance location.
Name Type Description
position Cartesian3 World location.

updateRotation(hpr)

Update the instance rotation parameters.
Name Type Description
hpr HeadingPitchRoll Rotation parameters.

updateScale(scale)

Update the instance zoom factor.
Name Type Description
scale Cartesian3 Scaling parameters.