MovablePlane
Class in @bimworks/viewer3d.
API catalogue · @bimworks/viewer3d · Class
TypeScript#
class MovablePlaneA plane with a drag icon that does not cut anything: the user drags it along its normal (left button on the icon or the rectangle), the middle button on the icon removes it. Coordinates are render space: millimetres, globalBaseTranslation included.
Members#
| Member | Kind | Description |
|---|---|---|
| constructor | Method | |
| coordinate | Property | A point on the plane, render space mm; do not modify, use setCoordinate/setOffset |
| id | Property | |
| normal | Property | Unit normal |
| offset | Property | dot(coordinate, normal): the plane's position along its normal |
| addListener | Method | |
| remove | Method | |
| removeListener | Method | |
| setCoordinate | Method | Moves the plane to a point (the normal stays); fires "moveEnd" |
| setOffset | Method | Moves the plane along its normal so that offset becomes the given value; fires "moveEnd" |
constructor#
TypeScript#
constructor()coordinate#
TypeScript#
readonly coordinate: Float32ArrayA point on the plane, render space mm; do not modify, use setCoordinate/setOffset
id#
TypeScript#
readonly id: numbernormal#
TypeScript#
readonly normal: Float32ArrayUnit normal
offset#
TypeScript#
readonly offset: numberdot(coordinate, normal): the plane's position along its normal
addListener#
TypeScript#
addListener(listener: (event: MovablePlaneEvent) => void): (event: MovablePlaneEvent) => voidParameters#
| Name | Type | Description |
|---|---|---|
listener |
(event: MovablePlaneEvent) => void |
remove#
TypeScript#
remove(): voidremoveListener#
TypeScript#
removeListener(listener: (event: MovablePlaneEvent) => void): voidParameters#
| Name | Type | Description |
|---|---|---|
listener |
(event: MovablePlaneEvent) => void |
setCoordinate#
TypeScript#
setCoordinate(coordinate: (number)[] | Float32Array<ArrayBuffer>): voidMoves the plane to a point (the normal stays); fires "moveEnd"
Parameters#
| Name | Type | Description |
|---|---|---|
coordinate |
(number)[] | Float32Array<ArrayBuffer> |
setOffset#
TypeScript#
setOffset(offset: number): voidMoves the plane along its normal so that offset becomes the given value; fires "moveEnd"
Parameters#
| Name | Type | Description |
|---|---|---|
offset |
number |