/** * @file Model.ts * @description This file defines the 3D model classes for Minecraft-style player models, including skin, cape, elytra, and ears. * @author Cosmic-fi * @license MIT */ import type { ModelType } from "skinview-utils"; import { Group, Mesh, Object3D, Texture } from "three"; /** * Represents a body part with an inner and outer layer. * For example, the head with the hat 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. * Supports "default" and "slim" model types. */ 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. * @return The texture map for the skin. */ get map(): Texture | null; /** * Set the texture map for the skin. * @param newMap The new texture map. */ set map(newMap: Texture | null); /** * The model type ("default" or "slim"). * @return The model type. */ get modelType(): ModelType; /** * Set the model type. * @param value The new model type. */ set modelType(value: ModelType); /** * Get all body parts in this skin. * @return An array of all body parts. */ private getBodyParts; /** * Show or hide the inner layer of all body parts. * @param value Whether to show the inner layer. */ setInnerLayerVisible(value: boolean): void; /** * Show or hide the outer layer of all body parts. * @param value Whether to show the outer layer. */ 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(); /** * The texture map for the cape. * @return The texture map for the cape. */ get map(): Texture | null; /** * Set the texture map for the cape. * @param newMap The new texture map. */ 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; /** * The texture map for the elytra. * @return The texture map for the elytra. */ get map(): Texture | null; /** * Set the texture map for the elytra. * @param newMap The new texture map. */ 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(); /** * The texture map for the ears. * @return The texture map for the ears. */ get map(): Texture | null; /** * Set the texture map for the ears. * @param newMap The new texture map. */ set map(newMap: Texture | null); } /** * Options for configuring a NameTagObject. */ 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). * @return The currently visible back equipment. */ get backEquipment(): BackEquipment | null; /** * Set which back equipment is visible. * @param value The back equipment to show, or null to hide both. */ set backEquipment(value: BackEquipment | null); /** * Reset all joints and positions to default. */ resetJoints(): void; }