mwg API
    Preparing search index...

    Class Character3D

    Moves either a billboard sprite or imported mesh through continuous 3D world space, and - for an imported mesh - plays back whichever animation clips came baked into it. loadModel3D already loads a glTF's own animationGroups as part of its import result; this is what turns one of them into something a game can actually trigger, the way a walk cycle baked into a mesh needs to be, rather than leaving them loaded but unreachable.

    Index
    • Parameters

      • node: TransformNode
      • animations: readonly AnimationGroup[] = []
      • OptionalcollideXZ: CollideXZ

        optional, like rpg.FreeMover stays unopinionated about collision until a game wires one in - omitted, moveTo interpolates through open space with no notion of terrain height or collision at all, same as before this existed.

      Returns Character3D

    node: TransformNode
    • get currentAnimation(): string | null

      the name of the clip currently playing, or null when none is

      Returns string | null

    • true when an animation clip of this name was imported with the model

      Parameters

      • name: string

      Returns boolean

    • Parameters

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

      Returns void

    • Plays an imported animation clip by name, stopping whichever one was already playing. A name the model has no clip for is a no-op, returning false, the same degrade-to-nothing ActorAnimator/GridMover already use for a missing animation rather than throwing over what is often just a naming mismatch between assets.

      Parameters

      • name: string
      • loop: boolean = true

      Returns boolean

    • Parameters

      • mesh: AbstractMesh
      • animations: readonly AnimationGroup[] = []

        typically loadModel3D's own animationGroups result field

      Returns Character3D