skin3d
Version:
A fast, customizable Minecraft skin viewer powered by Three.js. Easily render and preview Minecraft skins in 3D for your projects.
98 lines (97 loc) • 3.01 kB
TypeScript
import type { ModelType } from "skinview-utils";
import { Group, Mesh, Object3D, Texture } from "three";
/**
* Represents a body part with an inner and outer layer.
*/
export declare class BodyPart extends Group {
readonly innerLayer: Object3D;
readonly outerLayer: Object3D;
constructor(innerLayer: Object3D, outerLayer: Object3D);
}
/**
* Represents the player's skin model, including all body parts.
*/
export declare class SkinObject extends Group {
readonly head: BodyPart;
readonly body: BodyPart;
readonly rightArm: BodyPart;
readonly leftArm: BodyPart;
readonly rightLeg: BodyPart;
readonly leftLeg: BodyPart;
private modelListeners;
private slim;
private _map;
private layer1Material;
private layer1MaterialBiased;
private layer2Material;
private layer2MaterialBiased;
constructor();
/** The texture map for the skin. */
get map(): Texture | null;
set map(newMap: Texture | null);
/** The model type ("default" or "slim"). */
get modelType(): ModelType;
set modelType(value: ModelType);
/** Get all body parts in this skin. */
private getBodyParts;
/** Show or hide the inner layer of all body parts. */
setInnerLayerVisible(value: boolean): void;
/** Show or hide the outer layer of all body parts. */
setOuterLayerVisible(value: boolean): void;
/** Reset all joint rotations and positions to default. */
resetJoints(): void;
}
/**
* Represents a Minecraft-style cape.
*/
export declare class CapeObject extends Group {
readonly cape: Mesh;
private material;
constructor();
get map(): Texture | null;
set map(newMap: Texture | null);
}
/**
* Represents a Minecraft-style elytra (wings).
*/
export declare class ElytraObject extends Group {
readonly leftWing: Group;
readonly rightWing: Group;
private material;
constructor();
/** Reset wing rotations to default. */
resetJoints(): void;
/**
* Mirror the left wing's position and rotation to the right wing.
*/
updateRightWing(): void;
get map(): Texture | null;
set map(newMap: Texture | null);
}
/**
* Represents a pair of ears (for skin with ears).
*/
export declare class EarsObject extends Group {
readonly rightEar: Mesh;
readonly leftEar: Mesh;
private material;
constructor();
get map(): Texture | null;
set map(newMap: Texture | null);
}
export type BackEquipment = "cape" | "elytra";
/**
* Represents a full player model, including skin, cape, elytra, and ears.
*/
export declare class PlayerObject extends Group {
readonly skin: SkinObject;
readonly cape: CapeObject;
readonly elytra: ElytraObject;
readonly ears: EarsObject;
constructor();
/** Which back equipment is visible ("cape", "elytra", or null). */
get backEquipment(): BackEquipment | null;
set backEquipment(value: BackEquipment | null);
/** Reset all joints and positions to default. */
resetJoints(): void;
}