Skip to main content

Animation.Base

Base animations are used to display arbitrary model in the world.

Hierarchy

Index

Constructors

constructor

  • new Base(x: number, y: number, z: number): Base
  • Constructs a new Base animation on the specified coordinates.


    Parameters

    • x: number
    • y: number
    • z: number

    Returns Base

Methods

createRenderIfNeeded

  • createRenderIfNeeded(): void
  • Creates render if it was not previously created and applies all the parameters from animation description.


    Returns void

describe

  • describe(description: { material?: string; mesh?: RenderMesh; render?: number; scale?: number; skin?: string }): void
  • Describes animation parameters for the future use. Call load or loadCustom to actually launch the animation.


    Parameters

    • description: { material?: string; mesh?: RenderMesh; render?: number; scale?: number; skin?: string }

      an object containing all the required data about animation

      • optionalmaterial: string

        Animation material, can be used to apply custom materials to the animation.

      • optionalmesh: RenderMesh

        RenderMesh object to be displayed with animation.

      • optionalrender: number

        Numeric ID of the Render object to be displayed with animation. Can be obtained using Render.getId

      • optionalscale: number = 1

        Animation scale.

      • optionalskin: string

        Name of the texture to be used as render's skin.

    Returns void

destroy

  • destroy(): void
  • Destroys animation and releases all the resources.


    Returns void

exists

  • exists(): boolean
  • since: 2.1.0b60

    Returns boolean

getAge

  • getAge(): void
  • That feature is obsolete

    Backwards compatibility, render doesn't have attributes.


    Returns void

getShaderUniforms

load

  • load(): void
  • Loads animation in the world.


    Returns void

loadCustom

  • loadCustom(func: () => void): void
  • since: 2.3.1b116 (client-side)

    Loads animation in the world registering it as an Updatable.


    Parameters

    Returns void

newTransform

  • newTransform(transformations: { name: string; params: any[] }[], noClear: boolean): void
  • Creates a set of transformations for the current animation.


    Parameters

    • transformations: { name: string; params: any[] }[]
    • noClear: boolean

    Returns void

refresh

  • refresh(): void
  • Refreshes the animation.


    Returns void

resetBlockLightPos

  • resetBlockLightPos(): void
  • Resets light measuring position for the animation (to it's coordinates).


    Returns void

setBlockLightPos

  • setBlockLightPos(x: number, y: number, z: number): void
  • Sets specified coordinates as light measuring position for the animation. In other words, animation lightning will be calculated as if animation was at the specified coordinates.


    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

setBlocklightMode

  • setBlocklightMode(): void
  • Sets light measuring to match the animation coordinated.


    Returns void

setIgnoreBlocklight

  • setIgnoreBlocklight(ignore: boolean): void
  • That feature is obsolete

    Use setBlockLightPos and related methods instead.


    Parameters

    • ignore: boolean

    Returns void

setIgnoreLightMode

  • setIgnoreLightMode(): void
  • Makes the animation ignore light at all.


    Returns void

setInterpolationEnabled

  • setInterpolationEnabled(enabled: boolean): void
  • Parameters

    • enabled: boolean

      if true, animation position will be interpolated between tick calls

    Returns void

setPos

  • setPos(x: number, y: number, z: number): void
  • Changes the animation's position.


    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

setSkylightMode

  • setSkylightMode(): void
  • Sets light measuring position to always match day/night lightning, even when the animation is not directly illuminated.


    Returns void

transform

  • Returns Transform

    Object for current animation's render.

updateRender

  • updateRender(): void
  • Refreshes the animation.


    Returns void