diff --git a/src/animation.ts b/src/animation.ts index 743390d..641927e 100644 --- a/src/animation.ts +++ b/src/animation.ts @@ -102,7 +102,7 @@ export class CompositeAnimation implements IAnimation { export class RootAnimation extends CompositeAnimation implements AnimationHandle { speed: number = 1.0; progress: number = 0.0; - readonly clock: Clock = new Clock(true); + private readonly clock: Clock = new Clock(true); get animation(): RootAnimation { return this; diff --git a/src/model.ts b/src/model.ts index 5431d5e..dae1db9 100644 --- a/src/model.ts +++ b/src/model.ts @@ -19,7 +19,6 @@ function toCapeVertices(x1: number, y1: number, x2: number, y2: number): Array, bottom: Array, left: Array, front: Array, right: Array, back: Array): void { - box.faceVertexUvs[0] = []; box.faceVertexUvs[0][0] = [right[3], right[0], right[2]]; box.faceVertexUvs[0][1] = [right[0], right[1], right[2]]; diff --git a/src/viewer.ts b/src/viewer.ts index 8eb2144..ecfdebf 100644 --- a/src/viewer.ts +++ b/src/viewer.ts @@ -4,8 +4,11 @@ import { RootAnimation } from "./animation.js"; import { PlayerObject } from "./model.js"; export type LoadOptions = { + /** + * Whether to make the object visible after the texture is loaded. (default: true) + */ makeVisible?: boolean; -}; +} function toMakeVisible(options?: LoadOptions): boolean { if (options && options.makeVisible === false) { @@ -15,7 +18,6 @@ function toMakeVisible(options?: LoadOptions): boolean { } class SkinViewer { - readonly scene: Scene; readonly camera: PerspectiveCamera; readonly renderer: WebGLRenderer; @@ -29,8 +31,6 @@ class SkinViewer { private _disposed: boolean = false; private _renderPaused: boolean = false; - private _skinSet: boolean = false; - private _capeSet: boolean = false; constructor(readonly domElement: Node) { // texture @@ -44,7 +44,6 @@ class SkinViewer { this.capeTexture.magFilter = NearestFilter; this.capeTexture.minFilter = NearestFilter; - // scene this.scene = new Scene(); // Use smaller fov to avoid distortion