Class SkinViewer

The SkinViewer renders the player on a canvas.

Constructors

Properties

_animation: null | PlayerAnimation
_disposed: boolean = false
_nameTag: null | NameTagObject = null
_pixelRatio: number | "match-device"
_renderPaused: boolean = false
_zoom: number
animationID: null | number
autoRotate: boolean = false

Whether to rotate the player along the y axis.

Default Value

false

autoRotateSpeed: number = 1.0

The angular velocity of the player, in rad/s.

Default Value

1.0

See

autoRotate

backgroundTexture: null | Texture = null
camera: PerspectiveCamera
cameraLight: PointLight = ...
canvas: HTMLCanvasElement

The canvas where the renderer draws its output.

capeCanvas: HTMLCanvasElement
capeTexture: null | Texture = null
clock: Clock
composer: EffectComposer
controls: OrbitControls

The OrbitControls component which is used to implement the mouse control function.

devicePixelRatioQuery: null | MediaQueryList
earsCanvas: HTMLCanvasElement
earsTexture: null | Texture = null
fxaaPass: ShaderPass
globalLight: AmbientLight = ...
isUserRotating: boolean = false
onContextLost: ((event) => void)

Type declaration

    • (event): void
    • Parameters

      • event: Event

      Returns void

onContextRestored: (() => void)

Type declaration

    • (): void
    • Returns void

onDevicePixelRatioChange: (() => void)

Type declaration

    • (): void
    • Returns void

playerObject: PlayerObject

The player object.

playerWrapper: Group<Object3DEventMap>

A group that wraps the player object. It is used to center the player in the world.

renderPass: RenderPass
renderer: WebGLRenderer
scene: Scene
skinCanvas: HTMLCanvasElement
skinTexture: null | Texture = null

Accessors

  • get animation(): null | PlayerAnimation
  • The animation that is current playing, or null if no animation is playing.

    Setting this property to a different value will change the current animation. The player's pose and the progress of the new animation will be reset before playing.

    Setting this property to null will stop the current animation and reset the player's pose.

    Returns null | PlayerAnimation

  • set animation(animation): void
  • Parameters

    • animation: null | PlayerAnimation

    Returns void

  • get background(): null | Texture | Color
  • Returns null | Texture | Color

  • set background(value): void
  • Parameters

    • value: null | Texture | ColorRepresentation

    Returns void

  • get disposed(): boolean
  • Returns boolean

  • get fov(): number
  • Returns number

  • set fov(value): void
  • Parameters

    • value: number

    Returns void

  • get height(): number
  • Returns number

  • set height(newHeight): void
  • Parameters

    • newHeight: number

    Returns void

  • get nameTag(): null | NameTagObject
  • The name tag to display above the player, or null if there is none.

    When setting this property to a string value, a NameTagObject will be automatically created with default options.

    Returns null | NameTagObject

    Example

    skinViewer.nameTag = "hello";
    skinViewer.nameTag = new NameTagObject("hello", { textStyle: "yellow" });
    skinViewer.nameTag = null;
  • set nameTag(newVal): void
  • Parameters

    • newVal: null | string | NameTagObject

    Returns void

  • get pixelRatio(): number | "match-device"
  • Returns number | "match-device"

  • set pixelRatio(newValue): void
  • Parameters

    • newValue: number | "match-device"

    Returns void

  • get renderPaused(): boolean
  • Whether rendering and animations are paused. Setting this property to true will stop both rendering and animation loops. Setting it back to false will resume them.

    Returns boolean

  • set renderPaused(value): void
  • Parameters

    • value: boolean

    Returns void

  • get width(): number
  • Returns number

  • set width(newWidth): void
  • Parameters

    • newWidth: number

    Returns void

  • get zoom(): number
  • Returns number

  • set zoom(value): void
  • Parameters

    • value: number

    Returns void

Methods

  • Returns void

  • Returns void

  • Returns void

  • Type Parameters

    • S extends RemoteImage | TextureSource

    Parameters

    • source: S
    • Optional mapping: Mapping

    Returns S extends TextureSource
        ? void
        : Promise<void>

  • Parameters

    • empty: null

    Returns void

  • Type Parameters

    • S extends RemoteImage | TextureSource

    Parameters

    Returns S extends TextureSource
        ? void
        : Promise<void>

  • Parameters

    • empty: null

    Returns void

  • Type Parameters

    • S extends RemoteImage | TextureSource

    Parameters

    Returns S extends TextureSource
        ? void
        : Promise<void>

  • Type Parameters

    • S extends RemoteImage | TextureSource

    Parameters

    • source: S

    Returns S extends TextureSource
        ? void
        : Promise<void>

  • Parameters

    • empty: null

    Returns void

  • Type Parameters

    • S extends RemoteImage | TextureSource

    Parameters

    Returns S extends TextureSource
        ? void
        : Promise<void>

  • Returns void

  • Returns void

  • Returns void

  • Renders the scene to the canvas. This method does not change the animation progress.

    Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Parameters

    • width: number
    • height: number

    Returns void

  • Returns void

Generated using TypeDoc