Param

Virtual camera used in the scene

Param

Renderer's dom element

Param

The scene to be rendered

Hierarchy

  • EventDispatcher
    • ArcballControls

Constructors

Methods

  • Apply a transformation matrix, to the camera and gizmos

    Parameters

    • transformation: any

      Object containing matrices to apply to camera and gizmos

    Returns void

  • Calculate the angular speed

    Parameters

    • p0: any

      Position at t0

    • p1: any

      Position at t1

    • t0: any

      Initial time in milliseconds

    • t1: any

      Ending time in milliseconds

    Returns number

  • Calculate the distance between two pointers

    Returns

    The distance between the two pointers

    Parameters

    • p0: any

      The first pointer

    • p1: any

      The second pointer

    Returns number

  • Calculate the rotation axis as the vector perpendicular between two vectors

    Returns

    The normalized rotation axis

    Parameters

    • vec1: any

      The first vector

    • vec2: any

      The second vector

    Returns any

  • Calculate the trackball radius so that gizmo's diamater will be 2/3 of the minimum side of the camera frustum

    Returns

    The trackball radius

    Parameters

    • camera: any

    Returns number

  • Compare two mouse actions

    Returns

    True if action1 and action 2 are the same mouse action, false otherwise

    Parameters

    • action1: any
    • action2: any

    Returns boolean

  • Compute the easing out cubic function for ease out effect in animation

    Returns

    Result of easing out cubic at time t

    Parameters

    • t: any

      The absolute progress of the animation in the bound of 0 (beginning of the) and 1 (ending of animation)

    Returns number

  • Focus operation consist of positioning the point of interest in front of the camera and a slightly zoom in

    Parameters

    • point: any

      The point of interest

    • size: any

      Scale factor

    • amount: number = 1

      Amount of operation to be completed (used for focus animations, default is complete full operation)

    Returns void

  • Calculate the angle between two pointers

    Returns

    The angle between two pointers in degrees

    Parameters

    • p1: any
    • p2: any

    Returns number

  • Calculate the cursor position in NDC

    Returns

    Cursor normalized position inside the canvas

    Parameters

    • cursorX: any
    • cursorY: any
    • canvas: any

      The canvas where the renderer draws its output

    Returns any

  • Calculate the cursor position inside the canvas x/y coordinates with the origin being in the center of the canvas

    Returns

    Cursor position inside the canvas

    Parameters

    • cursorX: any
    • cursorY: any
    • canvas: any

      The canvas where the renderer draws its output

    Returns any

  • Return the operation associated to a mouse/keyboard combination

    Returns

    The operation if it has been found, null otherwise

    Parameters

    • mouse: any

      A mouse button (0, 1, 2) or 'WHEEL' for wheel notches

    • key: any

      The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed

    Returns any

  • Get the operation associated to mouse and key combination and returns the corresponding FSA state

    Returns

    The FSA state obtained from the operation associated to mouse/keyboard combination

    Parameters

    • mouse: any

      Mouse button

    • key: any

      Keyboard modifier

    Returns any

  • Creates the rotation gizmos matching trackball center and radius

    Parameters

    • tbCenter: any

      The trackball center

    • tbRadius: any

      The trackball radius

    Returns void

  • Perform animation for focus operation

    Parameters

    • time: any

      Instant in which this function is called as performance.now()

    • point: any

      Point of interest for focus operation

    • cameraMatrix: any

      Camera matrix

    • gizmoMatrix: any

      Gizmos matrix

    Returns void

  • Perform animation for rotation operation

    Parameters

    • time: any

      Instant in which this function is called as performance.now()

    • rotationAxis: any

      Rotation axis

    • w0: any

      Initial angular velocity

    Returns void

  • Perform pan operation moving camera between two points

    Parameters

    • p0: any

      Initial point

    • p1: any

      Ending point

    • adjust: boolean = false

      If movement should be adjusted considering camera distance (Perspective only)

    Returns {
        camera: Matrix4;
        gizmos: Matrix4;
    }

    • camera: Matrix4
    • gizmos: Matrix4
  • Rotate the camera around an axis passing by trackball's center

    Returns

    Object with 'camera' field containing transformation matrix resulting from the operation to be applied to the camera

    Parameters

    • axis: any

      Rotation axis

    • angle: any

      Angle in radians

    Returns {
        camera: Matrix4;
        gizmos: Matrix4;
    }

    • camera: Matrix4
    • gizmos: Matrix4
  • Perform uniform scale operation around a given point

    Returns

    Object with 'camera' and 'gizmo' fields containing transformation matrices resulting from the operation to be applied to the camera and gizmos

    Parameters

    • size: any

      Scale factor

    • point: any

      Point around which scale

    • scaleGizmos: boolean = true

      If gizmos should be scaled (Perspective only)

    Returns {
        camera: Matrix4;
        gizmos: Matrix4;
    }

    • camera: Matrix4
    • gizmos: Matrix4
  • Set a new mouse action by specifying the operation to be performed and a mouse/key combination. In case of conflict, replaces the existing one

    Returns

    True if the mouse action has been successfully added, false otherwise

    Parameters

    • operation: any

      The operation to be performed ('PAN', 'ROTATE', 'ZOOM', 'FOV)

    • mouse: any

      A mouse button (0, 1, 2) or 'WHEEL' for wheel notches

    • key: any = null

      The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed

    Returns boolean

  • Set values in transformation object

    Parameters

    • camera: any = null

      Transformation to be applied to the camera

    • gizmos: any = null

      Transformation to be applied to gizmos

    Returns void

  • Unproject the cursor on the 3D object surface

    Returns

    The point of intersection with the model, if exist, null otherwise

    Parameters

    • cursor: any

      Cursor coordinates in NDC

    • camera: any

      Virtual camera

    Returns Vector3

  • Unproject the cursor on the plane passing through the center of the trackball orthogonal to the camera

    Returns

    The unprojected point on the trackball plane

    Parameters

    • camera: any

      The virtual camera

    • cursorX: any

      Cursor horizontal coordinate on screen

    • cursorY: any

      Cursor vertical coordinate on screen

    • canvas: any

      The canvas where the renderer draws its output

    • initialDistance: boolean = false

      If initial distance between camera and gizmos should be used for calculations instead of current (Perspective only)

    Returns any

  • Unproject the cursor on the trackball surface

    Returns

    The unprojected point on the trackball surface

    Parameters

    • camera: any

      The virtual camera

    • cursorX: any

      Cursor horizontal coordinate on screen

    • cursorY: any

      Cursor vertical coordinate on screen

    • canvas: any

      The canvas where the renderer draws its output

    • tbRadius: any

      The trackball radius

    Returns any

  • Remove a mouse action by specifying its mouse/key combination

    Returns

    True if the operation has been succesfully removed, false otherwise

    Parameters

    • mouse: any

      A mouse button (0, 1, 2) or 'WHEEL' for wheel notches

    • key: any = null

      The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed

    Returns boolean

  • Update the trackball FSA

    Parameters

    • newState: any

      New state of the FSA

    • updateMatrices: any

      If matriices state should be updated

    Returns void

  • Rotate camera around its direction axis passing by a given point by a given angle

    Returns

    The computed transormation matix

    Parameters

    • point: any

      The point where the rotation axis is passing trough

    • angle: any

      Angle in radians

    Returns {
        camera: Matrix4;
        gizmos: Matrix4;
    }

    • camera: Matrix4
    • gizmos: Matrix4

Generated using TypeDoc