dot big bang

Developer API
Menu

Class SkeletalObjectComponent

All
  • Public
  • Public/Protected
  • All

Hierarchy

Index

Constructors

constructor

Properties

castShadow

castShadow: boolean

Whether the object casts shadows on itself and other objects when rendererd.

Readonly color

color: Color

The tint color (default is white).

Readonly emissive

emissive: Color

The emissive color (default is black).

emissiveIntensity

emissiveIntensity: number

The emissive intensity (default is 1.0).

Readonly id

id: string

The 36-character identifier string of the Component. The id is unique within the Entity is belongs to. Currently, the same id may be used by another Component on a different Entity.

ignoreFog

ignoreFog: boolean

Whether the skeletal object is hidden when inside fog See this.game.renderer.fog for more info on fog

isWorldOffset

isWorldOffset: boolean

If true, the offset is expressed along the world-space axes (going through the origin of the Entity). If false, the offset is expressed along the local axes of the Entity. Look at offset property for more information.

offset

offset: Vector3

The offset from the Entity origin where the skeletal object should be rendered. If isWorldOffset is true, that axes is in world-space (going through the origin of the Entity). If it is false, it is the local axes of the Entity. The value of the offset is expressed in the local Entity's space unit.

opacity

opacity: number

The opacity level, between 0 (fully transparent, i.e invisible) and 1 (fully opaque), at which the VoxelObject is rendered. This is used to make the VoxelObject see-through.

play

play: boolean

Indicates whether the animation is automatically played on the SkeletalObject by the component. When set to true, the component updates its own time property based on the other playback-related properties: playbackRate, playOnce and transitionDuration (this assumes that a SkeletalObject and a SkeletalAnimation are set, if that's not the case, there's nothing to play). When set to false, the SkeletalObject appears immobile in the pose specified by the time property and these other properties have no effect.

playOnce

playOnce: boolean

Indicates whether the component should play the animation only once, or repeat it forever (assuming that a SkeletalObject and a SkeletalAnimation are set, and play is true).

playbackRate

playbackRate: number

The rate at which the animation of the SkeletalObject is played by the component (assuming that a SkeletalObject and a SkeletalAnimation are set, and play is true). A rate of 1 means that the animation is played at its default speed as intended by its author, while a rate of 0.5 is half speed, a rate of 2 is twice the speed, etc... A negative value plays the animation backwards.

skeletalAnimation

skeletalAnimation: null | SkeletalAnimation

The SkeletalAnimation to play on the SkeletalObject. When no animation is set, the SkeletalObject is rendered in T-pose.

skeletalObject

skeletalObject: null | SkeletalObject

The SkeletalObject to render. If no SkeletalObject is set, nothing will be rendered by this component.

time

time: number

The current time position in the animation, in seconds.

transitionDuration

transitionDuration: number

The time it takes, in seconds, for the current animation being played to be fade out into the new animation set by a change to the skeletalAnimation property.

Readonly type

The type of the Component.

visible

visible: boolean

Whether the skeletal object should be rendered or not.

visibleInDepthPass

visibleInDepthPass: boolean

Whether the object will be rendered in the ambient occlusion pass of the Renderer.

Accessors

entity

  • Gets the Entity the Component is part of. This throws an exception if the Component is not in an Entity. Use the isInEntity property to test for that.

    Returns Entity

game

  • Gets the Game the Component is part of (via the Entity it belongs to). This throws an exception if the Component is not in the game. Use the isInGame property to test for that.

    Returns Game<{ saveData: SaveData<any, any> }>

isInEntity

  • get isInEntity(): boolean
  • Returns true if the Component is part of an Entity.

    Returns boolean

isInGame

  • get isInGame(): boolean
  • Returns true if the Component is part of the Game (via the Entity it belongs to).

    Returns boolean

playedOnce

  • get playedOnce(): boolean
  • Returns true if the component is set to playing once, was actively playing and has reached the end of the animation. Returns false if the component isn't actively playing (i.e. hasn't got a SKO or an animation or play is false, etc...). Also returns false, if the component is playing but not set to playOnce as it plays forever and is never done.

    Returns boolean