Skip to main content

TFixedAxisCameraController

Hierarchy

  • default
    • TFixedAxisCameraController

Implements

  • default

Index

Constructors

constructor

  • new TFixedAxisCameraController(config?: { axis?: string; bounds?: { max: vec3; min: vec3 }; deadzone?: number; distance?: number; leadFactor?: number; lerpFactor?: number; maxLead?: number }): default
  • Parameters

    • optionalconfig: { axis?: string; bounds?: { max: vec3; min: vec3 }; deadzone?: number; distance?: number; leadFactor?: number; lerpFactor?: number; maxLead?: number }
      • optionalaxis: string
      • optionalbounds: { max: vec3; min: vec3 }
      • optionaldeadzone: number
      • optionaldistance: number
      • optionalleadFactor: number
      • optionallerpFactor: number
      • optionalmaxLead: number

    Returns default

Properties

publicaxis

axis: string = 'z'

publicoptionalbounds

bounds?: { max: vec3; min: vec3 }

Type declaration

  • max: vec3
  • min: vec3

publicdeadzone

deadzone: number = 0

publicdistance

distance: number = 0

publicleadFactor

leadFactor: number = 0

publiclerpFactor

lerpFactor: number = 1

Lerp factor controlling the speed of interpolation.

  • If set to 1, movement and rotation are applied immediately.
  • Values closer to 1 result in faster transitions.
  • Values closer to 0 result in slower transitions.

publicmaxLead

maxLead: number = 0

Methods

attachTo

  • Attach this controller to a scene component.


    Parameters

    • component: default

      The scene component to attach to.

    Returns void

publiclookAt

  • lookAt(target: vec3, instant?: boolean): void
  • Adjust the camera to look at the specified target position using linear interpolation.


    Parameters

    • target: vec3

      The target position to look at.

    • instant: boolean = false

      If true, rotate the camera instantly without interpolation.

    Returns void

publicmoveTo

  • moveTo(position: vec3, instant?: boolean): void
  • Move the camera to the specified position using linear interpolation.


    Parameters

    • position: vec3

      The target position to move the camera to.

    • instant: boolean = false

      If true, move the camera instantly without interpolation.

    Returns void

publiconUpdate

  • onUpdate(camera: default, engine: default, delta: number): Promise<void>
  • Update the camera position based on the target's position and velocity.


    Parameters

    • camera: default

      The camera to update.

    • engine: default

      The game engine.

    • delta: number

      Time delta.

    Returns Promise<void>