Camera module

Module for inspecting the active camera state.

Properties

  • trx.camera.pos (trx.math.Vec3). Current camera position. (read-only)
  • trx.camera.room_num (trx.rooms.Num). The room the camera is in, or nil if unknown. (read-only)
  • trx.camera.room (trx.rooms.Room). The room the camera is in, or nil if unknown. (read-only)
  • trx.camera.target_pos (trx.math.Vec3). Position the camera is looking at. (read-only)
  • trx.camera.target_room_num (trx.rooms.Num). The room the camera is looking at, or nil if unknown. (read-only)
  • trx.camera.is_flyby_active (boolean). Whether a flyby camera sequence is playing. (read-only)

Structures

  • trx.camera.SequenceNum

    Flyby sequence number, as the level numbers them. Counted from 0.

Functions

  • trx.camera.shake(intensity)
    Shakes the camera by setting its bounce value. Positive values shake it upward, negative values downward.

    Parameters:

    • intensity (integer). Bounce value.

    Example:

    trx.camera.shake(200)
    
  • trx.camera.reset()
    Resets the camera to Lara's current position.

  • trx.camera.play_flyby(sequence_num)
    Starts a flyby camera sequence. Does nothing if another one is already playing.

    Parameters:

    Returns: boolean. Whether the sequence took the camera.

    Example:

    trx.camera.play_flyby(1)
    
  • trx.camera.cancel_flyby()
    Cancels the flyby camera sequence, if one is playing.