Manipulator

actual class Manipulator

Helper that enables camera interaction similar to sketchfab or Google Maps.

Clients notify the manipulator of various mouse or touch events, then periodically call getLookAt so that they can adjust their camera. Three modes are supported: Mode.ORBIT, Mode.MAP, and Mode.FLIGHT. To construct a manipulator, use Builder and pass the desired mode to Builder.build.

Usage example:

val manip = Manipulator.Builder()
.viewport(1024, 768)
.build(Manipulator.Mode.ORBIT)

// In mouse-down handler:
manip.grabBegin(x, y, false)

// In mouse-move handler:
manip.grabUpdate(x, y)

// In mouse-up handler:
manip.grabEnd()

// Each frame:
val eye = FloatArray(3); val target = FloatArray(3); val up = FloatArray(3)
manip.getLookAt(eye, target, up)
camera.lookAt(eye[0], eye[1], eye[2], target[0], target[1], target[2], up[0], up[1], up[2])

See also

expect class Manipulator

Helper that enables camera interaction similar to sketchfab or Google Maps.

Clients notify the manipulator of various mouse or touch events, then periodically call getLookAt so that they can adjust their camera. Three modes are supported: Mode.ORBIT, Mode.MAP, and Mode.FLIGHT. To construct a manipulator, use Builder and pass the desired mode to Builder.build.

Usage example:

val manip = Manipulator.Builder()
.viewport(1024, 768)
.build(Manipulator.Mode.ORBIT)

// In mouse-down handler:
manip.grabBegin(x, y, false)

// In mouse-move handler:
manip.grabUpdate(x, y)

// In mouse-up handler:
manip.grabEnd()

// Each frame:
val eye = FloatArray(3); val target = FloatArray(3); val up = FloatArray(3)
manip.getLookAt(eye, target, up)
camera.lookAt(eye[0], eye[1], eye[2], target[0], target[1], target[2], up[0], up[1], up[2])

See also

actual class Manipulator

Helper that enables camera interaction similar to sketchfab or Google Maps.

Clients notify the manipulator of various mouse or touch events, then periodically call getLookAt so that they can adjust their camera. Three modes are supported: Mode.ORBIT, Mode.MAP, and Mode.FLIGHT. To construct a manipulator, use Builder and pass the desired mode to Builder.build.

Usage example:

val manip = Manipulator.Builder()
.viewport(1024, 768)
.build(Manipulator.Mode.ORBIT)

// In mouse-down handler:
manip.grabBegin(x, y, false)

// In mouse-move handler:
manip.grabUpdate(x, y)

// In mouse-up handler:
manip.grabEnd()

// Each frame:
val eye = FloatArray(3); val target = FloatArray(3); val up = FloatArray(3)
manip.getLookAt(eye, target, up)
camera.lookAt(eye[0], eye[1], eye[2], target[0], target[1], target[2], up[0], up[1], up[2])

See also

actual class Manipulator

Helper that enables camera interaction similar to sketchfab or Google Maps.

Clients notify the manipulator of various mouse or touch events, then periodically call getLookAt so that they can adjust their camera. Three modes are supported: Mode.ORBIT, Mode.MAP, and Mode.FLIGHT. To construct a manipulator, use Builder and pass the desired mode to Builder.build.

Usage example:

val manip = Manipulator.Builder()
.viewport(1024, 768)
.build(Manipulator.Mode.ORBIT)

// In mouse-down handler:
manip.grabBegin(x, y, false)

// In mouse-move handler:
manip.grabUpdate(x, y)

// In mouse-up handler:
manip.grabEnd()

// Each frame:
val eye = FloatArray(3); val target = FloatArray(3); val up = FloatArray(3)
manip.getLookAt(eye, target, up)
camera.lookAt(eye[0], eye[1], eye[2], target[0], target[1], target[2], up[0], up[1], up[2])

See also

actual class Manipulator

Helper that enables camera interaction similar to sketchfab or Google Maps.

Clients notify the manipulator of various mouse or touch events, then periodically call getLookAt so that they can adjust their camera. Three modes are supported: Mode.ORBIT, Mode.MAP, and Mode.FLIGHT. To construct a manipulator, use Builder and pass the desired mode to Builder.build.

Usage example:

val manip = Manipulator.Builder()
.viewport(1024, 768)
.build(Manipulator.Mode.ORBIT)

// In mouse-down handler:
manip.grabBegin(x, y, false)

// In mouse-move handler:
manip.grabUpdate(x, y)

// In mouse-up handler:
manip.grabEnd()

// Each frame:
val eye = FloatArray(3); val target = FloatArray(3); val up = FloatArray(3)
manip.getLookAt(eye, target, up)
camera.lookAt(eye[0], eye[1], eye[2], target[0], target[1], target[2], up[0], up[1], up[2])

See also

Types

Link copied to clipboard
actual class Bookmark

Opaque handle to a viewing position and orientation, used to animate the camera.

expect class Bookmark

Opaque handle to a viewing position and orientation, used to animate the camera.

actual class Bookmark

Opaque handle to a viewing position and orientation, used to animate the camera.

actual class Bookmark

Opaque handle to a viewing position and orientation, used to animate the camera.

actual class Bookmark

Opaque handle to a viewing position and orientation, used to animate the camera.

Link copied to clipboard
actual class Builder

Builder for Manipulator instances.

expect class Builder

Builder for Manipulator instances.

actual class Builder

Builder for Manipulator instances.

actual class Builder

Builder for Manipulator instances.

actual class Builder

Builder for Manipulator instances.

Link copied to clipboard
actual enum Fov : Enum<Manipulator.Fov>

The axis held constant when the viewport changes in MAP mode.

expect enum Fov : Enum<Manipulator.Fov>

The axis held constant when the viewport changes in MAP mode.

actual enum Fov : Enum<Manipulator.Fov>

The axis held constant when the viewport changes in MAP mode.

actual enum Fov : Enum<Manipulator.Fov>

The axis held constant when the viewport changes in MAP mode.

actual enum Fov : Enum<Manipulator.Fov>

The axis held constant when the viewport changes in MAP mode.

Link copied to clipboard
actual enum Key : Enum<Manipulator.Key>

Keys used to translate the camera in Mode.FLIGHT mode.

expect enum Key : Enum<Manipulator.Key>

Keys used to translate the camera in Mode.FLIGHT mode.

actual enum Key : Enum<Manipulator.Key>

Keys used to translate the camera in Mode.FLIGHT mode.

actual enum Key : Enum<Manipulator.Key>

Keys used to translate the camera in Mode.FLIGHT mode.

actual enum Key : Enum<Manipulator.Key>

Keys used to translate the camera in Mode.FLIGHT mode.

Link copied to clipboard
actual enum Mode : Enum<Manipulator.Mode>

Camera manipulation mode.

expect enum Mode : Enum<Manipulator.Mode>

Camera manipulation mode.

actual enum Mode : Enum<Manipulator.Mode>

Camera manipulation mode.

actual enum Mode : Enum<Manipulator.Mode>

Camera manipulation mode.

actual enum Mode : Enum<Manipulator.Mode>

Camera manipulation mode.

Functions

Link copied to clipboard
actual fun destroy()

Destroys the manipulator and releases all resources.

expect fun destroy()

Destroys the manipulator and releases all resources.

actual fun destroy()

Destroys the manipulator and releases all resources.

actual fun destroy()

Destroys the manipulator and releases all resources.

actual fun destroy()

Destroys the manipulator and releases all resources.

Link copied to clipboard

Gets a handle that can be used to reset the manipulator back to its current position.

Gets a handle that can be used to reset the manipulator back to its current position.

Gets a handle that can be used to reset the manipulator back to its current position.

Gets a handle that can be used to reset the manipulator back to its current position.

Gets a handle that can be used to reset the manipulator back to its current position.

Link copied to clipboard

Gets a handle that can be used to reset the manipulator back to its home position.

Gets a handle that can be used to reset the manipulator back to its home position.

Gets a handle that can be used to reset the manipulator back to its home position.

Gets a handle that can be used to reset the manipulator back to its home position.

Gets a handle that can be used to reset the manipulator back to its home position.

Link copied to clipboard
actual fun getLookAt(outEye: FloatArray, outTarget: FloatArray, outUp: FloatArray)

Gets the current orthonormal basis; this is usually called once per frame.

expect fun getLookAt(outEye: FloatArray, outTarget: FloatArray, outUp: FloatArray)

Gets the current orthonormal basis; this is usually called once per frame.

actual fun getLookAt(outEye: FloatArray, outTarget: FloatArray, outUp: FloatArray)

Gets the current orthonormal basis; this is usually called once per frame.

actual fun getLookAt(outEye: FloatArray, outTarget: FloatArray, outUp: FloatArray)

Gets the current orthonormal basis; this is usually called once per frame.

actual fun getLookAt(outEye: FloatArray, outTarget: FloatArray, outUp: FloatArray)

Gets the current orthonormal basis; this is usually called once per frame.

Link copied to clipboard

Gets the immutable mode of the manipulator.

Gets the immutable mode of the manipulator.

Gets the immutable mode of the manipulator.

Gets the immutable mode of the manipulator.

Gets the immutable mode of the manipulator.

Link copied to clipboard
actual fun grabBegin(x: Int, y: Int, strafe: Boolean)

Starts a grabbing session (i.e. the user begins dragging in the viewport).

expect fun grabBegin(x: Int, y: Int, strafe: Boolean)

Starts a grabbing session (i.e. the user begins dragging in the viewport).

actual fun grabBegin(x: Int, y: Int, strafe: Boolean)

Starts a grabbing session (i.e. the user begins dragging in the viewport).

actual fun grabBegin(x: Int, y: Int, strafe: Boolean)

Starts a grabbing session (i.e. the user begins dragging in the viewport).

actual fun grabBegin(x: Int, y: Int, strafe: Boolean)

Starts a grabbing session (i.e. the user begins dragging in the viewport).

Link copied to clipboard
actual fun grabEnd()

Ends a grabbing session.

expect fun grabEnd()

Ends a grabbing session.

actual fun grabEnd()

Ends a grabbing session.

actual fun grabEnd()

Ends a grabbing session.

actual fun grabEnd()

Ends a grabbing session.

Link copied to clipboard
actual fun grabUpdate(x: Int, y: Int)

Updates a grabbing session.

expect fun grabUpdate(x: Int, y: Int)

Updates a grabbing session.

actual fun grabUpdate(x: Int, y: Int)

Updates a grabbing session.

actual fun grabUpdate(x: Int, y: Int)

Updates a grabbing session.

actual fun grabUpdate(x: Int, y: Int)

Updates a grabbing session.

Link copied to clipboard
actual fun jumpToBookmark(bookmark: Manipulator.Bookmark)

Sets the manipulator position and orientation back to a previously stashed state.

expect fun jumpToBookmark(bookmark: Manipulator.Bookmark)

Sets the manipulator position and orientation back to a previously stashed state.

actual fun jumpToBookmark(bookmark: Manipulator.Bookmark)

Sets the manipulator position and orientation back to a previously stashed state.

actual fun jumpToBookmark(bookmark: Manipulator.Bookmark)

Sets the manipulator position and orientation back to a previously stashed state.

actual fun jumpToBookmark(bookmark: Manipulator.Bookmark)

Sets the manipulator position and orientation back to a previously stashed state.

Link copied to clipboard
actual fun keyDown(key: Manipulator.Key)

Signals that a key is now in the down state.

expect fun keyDown(key: Manipulator.Key)

Signals that a key is now in the down state.

actual fun keyDown(key: Manipulator.Key)

Signals that a key is now in the down state.

actual fun keyDown(key: Manipulator.Key)

Signals that a key is now in the down state.

actual fun keyDown(key: Manipulator.Key)

Signals that a key is now in the down state.

Link copied to clipboard
actual fun keyUp(key: Manipulator.Key)

Signals that a key is now in the up state.

expect fun keyUp(key: Manipulator.Key)

Signals that a key is now in the up state.

actual fun keyUp(key: Manipulator.Key)

Signals that a key is now in the up state.

actual fun keyUp(key: Manipulator.Key)

Signals that a key is now in the up state.

actual fun keyUp(key: Manipulator.Key)

Signals that a key is now in the up state.

Link copied to clipboard
actual fun raycast(x: Int, y: Int, outResult: FloatArray)

Given a viewport coordinate, picks a point in the ground plane, or in the actual scene if a raycast callback was configured.

expect fun raycast(x: Int, y: Int, outResult: FloatArray)

Given a viewport coordinate, picks a point in the ground plane, or in the actual scene if a raycast callback was configured.

actual fun raycast(x: Int, y: Int, outResult: FloatArray)

Given a viewport coordinate, picks a point in the ground plane, or in the actual scene if a raycast callback was configured.

actual fun raycast(x: Int, y: Int, outResult: FloatArray)

Given a viewport coordinate, picks a point in the ground plane, or in the actual scene if a raycast callback was configured.

actual fun raycast(x: Int, y: Int, outResult: FloatArray)

Given a viewport coordinate, picks a point in the ground plane, or in the actual scene if a raycast callback was configured.

Link copied to clipboard
actual fun scroll(x: Int, y: Int, delta: Float)

In Mode.MAP and Mode.ORBIT modes, dollys the camera along the viewing direction. In Mode.FLIGHT mode, adjusts the move speed of the camera.

expect fun scroll(x: Int, y: Int, delta: Float)

In Mode.MAP and Mode.ORBIT modes, dollys the camera along the viewing direction. In Mode.FLIGHT mode, adjusts the move speed of the camera.

actual fun scroll(x: Int, y: Int, delta: Float)

In Mode.MAP and Mode.ORBIT modes, dollys the camera along the viewing direction. In Mode.FLIGHT mode, adjusts the move speed of the camera.

actual fun scroll(x: Int, y: Int, delta: Float)

In Mode.MAP and Mode.ORBIT modes, dollys the camera along the viewing direction. In Mode.FLIGHT mode, adjusts the move speed of the camera.

actual fun scroll(x: Int, y: Int, delta: Float)

In Mode.MAP and Mode.ORBIT modes, dollys the camera along the viewing direction. In Mode.FLIGHT mode, adjusts the move speed of the camera.

Link copied to clipboard
actual fun setViewport(width: Int, height: Int)

Sets the viewport dimensions. The manipulator uses this to process grab events and raycasts.

expect fun setViewport(width: Int, height: Int)

Sets the viewport dimensions. The manipulator uses this to process grab events and raycasts.

actual fun setViewport(width: Int, height: Int)

Sets the viewport dimensions. The manipulator uses this to process grab events and raycasts.

actual fun setViewport(width: Int, height: Int)

Sets the viewport dimensions. The manipulator uses this to process grab events and raycasts.

actual fun setViewport(width: Int, height: Int)

Sets the viewport dimensions. The manipulator uses this to process grab events and raycasts.

Link copied to clipboard
actual fun update(deltaTime: Float)

Processes input and updates internal state.

expect fun update(deltaTime: Float)

Processes input and updates internal state.

actual fun update(deltaTime: Float)

Processes input and updates internal state.

actual fun update(deltaTime: Float)

Processes input and updates internal state.

actual fun update(deltaTime: Float)

Processes input and updates internal state.