CameraZoomOperator

class Communicator.Operator.CameraZoomOperator()

Methods

addMapping

Communicator.Operator.CameraZoomOperator.addMapping(button, modifier)

Adds a button and key modifier mapping for the operator. If no mapping is provided, all combinations are considered valid. All mappings require a mouse button, but a key modifier is optional.

Arguments
  • button (Communicator.Button()) –

  • modifier (Communicator.KeyModifiers()) –

Return type

void

clearMapping

Communicator.Operator.CameraZoomOperator.clearMapping()

Clears any button and key modifier mappings for the operator.

Return type

void

getDollyZoomEnabled

Communicator.Operator.CameraZoomOperator.getDollyZoomEnabled()

Returns true if dolly zoom is enabled.

Return type

boolean

getMouseMoveZoomDelta

Communicator.Operator.CameraZoomOperator.getMouseMoveZoomDelta()

Gets the mouse move zoom delta

Return type

number

Returns

number

getMouseMoveZoomInverted

Communicator.Operator.CameraZoomOperator.getMouseMoveZoomInverted()
Return type

boolean

getMouseWheelAdjustCameraTarget

Communicator.Operator.CameraZoomOperator.getMouseWheelAdjustCameraTarget()

Returns whether the camera target will be updated to the selection position while zooming. See setMouseWheelAdjustCameraTarget

Return type

boolean

getMouseWheelZoomDelta

Communicator.Operator.CameraZoomOperator.getMouseWheelZoomDelta()

Gets the scrollwheel zoom delta

Return type

number

Returns

number

getMouseWheelZoomInverted

Communicator.Operator.CameraZoomOperator.getMouseWheelZoomInverted()
Return type

boolean

getPreserveViewAngle

Communicator.Operator.CameraZoomOperator.getPreserveViewAngle()

Gets whether to maintain a constant view angle while zooming. See setPreserveViewAngle

Return type

boolean

getZoomToMousePosition

Communicator.Operator.CameraZoomOperator.getZoomToMousePosition()
Return type

boolean

Returns

boolean When true, the zoom will be towards the mouse position. When false, the zoom will be towards the center of the screen.

setDollyZoomEnabled

Communicator.Operator.CameraZoomOperator.setDollyZoomEnabled(dollyZoomEnabled)

When dolly zoom is enabled, the camera position will move towards the camera target when zooming.

Arguments
  • dollyZoomEnabled (boolean()) –

Return type

void

setMapping

Communicator.Operator.CameraZoomOperator.setMapping(button, modifier)

Sets the button and key modifier mapping for the operator.

Arguments
  • button (Communicator.Button()) –

  • modifier (Communicator.KeyModifiers()) –

Return type

void

setMouseMoveZoomDelta

Communicator.Operator.CameraZoomOperator.setMouseMoveZoomDelta(delta)

Sets the delta to zoom when moving the mouse

Arguments
  • delta (number()) –

Return type

void

setMouseMoveZoomInverted

Communicator.Operator.CameraZoomOperator.setMouseMoveZoomInverted(inverted)

When true, moving the mouse up will zoom towards the model.

Arguments
  • inverted (boolean()) –

Return type

void

setMouseWheelAdjustCameraTarget

Communicator.Operator.CameraZoomOperator.setMouseWheelAdjustCameraTarget(value)

When enabled, the camera target will be updated to the selection position while zooming. This can provide a better zoom behavior in perspective projection mode, but comes at the cost of performing a selection on the model during each mouse scroll, which may not be ideal for performance on large models.

Arguments
  • value (boolean()) –

Return type

void

This setting is disabled by default.

setMouseWheelZoomDelta

Communicator.Operator.CameraZoomOperator.setMouseWheelZoomDelta(delta)

Sets the delta to zoom when scrolling

Arguments
  • delta (number()) –

Return type

void

setMouseWheelZoomInverted

Communicator.Operator.CameraZoomOperator.setMouseWheelZoomInverted(inverted)

When true, scrolling up will zoom towards the model.

Arguments
  • inverted (boolean()) –

Return type

void

setPreserveViewAngle

Communicator.Operator.CameraZoomOperator.setPreserveViewAngle(value)

Sets whether to maintain a constant view angle while zooming. If enabled, when zooming causes the camera’s field of view to shrink or grow, the camera’s position will also be moved toward or away from the target, respectively.

Arguments
  • value (boolean()) –

Return type

void

This may prevent confusing camera behavior when perspective projection is used or might be used. When using only orthographic projection, it is better to disable this.

If mouse wheel zoom is being using in conjunction with window zoom this setting should be the same in both.

This setting is enabled by default.

setZoomToMousePosition

Communicator.Operator.CameraZoomOperator.setZoomToMousePosition(zoom)

When set, the zoom will be towards the mouse position. When not set, the zoom will be from the center of the screen.

Arguments
  • zoom (boolean()) –

Return type

void