ShadowUI 使用文档

模型数据与运行契约:公开签名参考

状态待核对Minecraft 1.21.10 · Forge / Bukkit
本页目录

本文对应 1.21.10 现代框架。文档中的接口与配置按当前文档快照核对;完整框架仍在开发验收。接口可编译、配置可解析与游戏内效果验证分别记录。

先读开发入门,再按下方类型查阅精确签名。

本章收录声明为 public 的类型和配对编译产物中的公开成员。公开可见性不自动代表稳定扩展点;平台服务应通过既有注册入口获取,底层类型仅供明确契约的扩展使用。构造器、record 访问器与枚举生成方法均保留。没有注解承诺的成员状态为未分类。

FirstPersonArmPose

com.heartlion.shadowui.modelcore.FirstPersonArmPose

Stable authored hand reference for an arm view. Never cancel motion with the current grip inverse. The platform applies equip/swing and configured view transforms outside these model-space matrices.

JAVA
public final class com.heartlion.shadowui.modelcore.FirstPersonArmPose {
    public com.heartlion.shadowui.modelcore.FirstPersonArmPose(com.heartlion.shadowui.modelcore.ModelAsset, com.heartlion.shadowui.modelcore.ModelMeshSelection, java.lang.String, java.lang.String, double);
    public com.heartlion.shadowui.modelcore.FirstPersonArmPose(com.heartlion.shadowui.modelcore.ModelAsset, com.heartlion.shadowui.modelcore.ModelMeshSelection, java.lang.String, com.heartlion.shadowui.modelcore.ModelInstance);
    public com.heartlion.shadowui.modelcore.ModelMeshSelection selection();
    public void copyModelToView(float[]);
    public void copyItemToView(com.heartlion.shadowui.modelcore.ModelInstance, float[]);
}

FirstPersonArmPose

public FirstPersonArmPose(ModelAsset asset, ModelMeshSelection selection, String grip, ModelInstance sampledReference)

Copies an already sampled, asset-bound reference. The evaluator remains owned by the caller.

copyModelToView

public void copyModelToView(float[] destination)

Model-root transform applied before drawing the selected arm geometry.

copyItemToView

public void copyItemToView(ModelInstance pose, float[] destination)

Item transform in that same arm view, retaining the current authored grip animation.

GlbInspect

com.heartlion.shadowui.modelcore.GlbInspect

Offline diagnostic using the same loader and CPU skinning as the client.

JAVA
public final class com.heartlion.shadowui.modelcore.GlbInspect {
    public static void main(java.lang.String[]) throws java.lang.Exception;
}

GlbLoader

com.heartlion.shadowui.modelcore.GlbLoader

GLB-only boundary. Never resolves a file/HTTP URI outside the active resource provider.

JAVA
public final class com.heartlion.shadowui.modelcore.GlbLoader {
    public static final int MAX_FILE_BYTES;
    public com.heartlion.shadowui.modelcore.GlbLoader();
    public com.heartlion.shadowui.modelcore.ModelAsset read(com.heartlion.shadowui.modelcore.ModelResourceSource, java.lang.String) throws java.lang.Exception;
    public com.heartlion.shadowui.modelcore.ModelAsset read(java.io.InputStream) throws java.io.IOException;
}

read

public ModelAsset read(ModelResourceSource source, String resource) throws Exception

Closes the provider stream and rejects a resource view changed during parsing or close.

ModelAnimationProgram

com.heartlion.shadowui.modelcore.ModelAnimationProgram

Immutable clip schedule. Timing, pose and queries belong to each controller, never this value.

JAVA
public final class com.heartlion.shadowui.modelcore.ModelAnimationProgram {
    public static final int MAX_QUEUE;
    public static final int MAX_PARALLEL;
    public com.heartlion.shadowui.modelcore.ModelAnimationProgram(java.lang.String, java.util.List<java.lang.String>, java.util.List<java.lang.String>);
    public java.lang.String clip();
    public java.util.List<java.lang.String> queue();
    public java.util.List<java.lang.String> parallel();
    public int layerCount();
    public double duration(com.heartlion.shadowui.modelcore.ModelAsset);
    public boolean equals(java.lang.Object);
    public int hashCode();
}

duration

public double duration(ModelAsset asset)

Validates every referenced clip, including layers not reached by the current frame.

ModelAnimationSampler

com.heartlion.shadowui.modelcore.ModelAnimationSampler

声明注解:@FunctionalInterface。

An instance-owned evaluator for clips whose curves are not baked core channels. Query snapshots, expressions and mutable variables belong to its owner, never the shared asset. Called during pose sampling before transition blending; draw/anchor queries never evaluate it.

JAVA
public interface com.heartlion.shadowui.modelcore.ModelAnimationSampler {
    public abstract void sample(java.lang.String, double, double, com.heartlion.shadowui.modelcore.ModelAnimationSampler$PoseWriter);
    public default void sampleLayer(int, java.lang.String, double, double, com.heartlion.shadowui.modelcore.ModelAnimationSampler$PoseWriter);
}

sample

public void sample(String clip, double elapsedSeconds, double clipSeconds, PoseWriter out)

Times are seconds. elapsedSeconds is the nonnegative speed-adjusted playback clock; clipSeconds is looped/clamped against the immutable clip duration.

sampleLayer

public default void sampleLayer(int slot, String clip, double elapsedSeconds, double clipSeconds, PoseWriter out)

Opt-in program composition: write only authored channels for this slot. Each slot must have independent expression state. Existing single-clip implementations reject programs explicitly instead of silently evaluating several layers through one mutable session.

ModelAnimationSampler.PoseWriter

com.heartlion.shadowui.modelcore.ModelAnimationSampler.PoseWriter

Temporary, asset-bound writer of absolute local TRS. Each destination may be written once. Values are copied/validated, and writes are committed only after the callback succeeds. Retaining this writer or using it after the callback returns is rejected.

JAVA
public interface com.heartlion.shadowui.modelcore.ModelAnimationSampler$PoseWriter {
    public abstract void translation(int, float, float, float);
    public abstract void rotation(int, float, float, float, float);
    public abstract void scale(int, float, float, float);
}

ModelAsset

com.heartlion.shadowui.modelcore.ModelAsset

Immutable CPU asset shared by instances and by both Forge backends. Units are metres.

JAVA
public final class com.heartlion.shadowui.modelcore.ModelAsset {
    public java.util.Set<java.lang.String> animations();
    public double animationDuration(java.lang.String);
    public java.util.List<java.lang.String> warnings();
    public int nodeCount();
    public boolean nodeUsesXyzProjection(int);
    public boolean hasXyzProjection();
    public int vertexCount();
    public int triangleCount();
    public com.heartlion.shadowui.modelcore.ModelInstance newInstance();
    public com.heartlion.shadowui.modelcore.ModelInstance newInstance(com.heartlion.shadowui.modelcore.ModelAnimationSampler);
    public boolean requiresExternalSampler(java.lang.String);
    public long estimatedCpuBytes();
}

nodeUsesXyzProjection

public boolean nodeUsesXyzProjection(int nodeId)

True when this node's path contains an explicit full-matrix/xyz-only projection node. An affine descendant does not erase an ancestor's declared evaluation semantics.

estimatedCpuBytes

public long estimatedCpuBytes()

Conservative array/object accounting for admission; excludes platform GPU textures and instance poses.

ModelAssetBuilder

com.heartlion.shadowui.modelcore.ModelAssetBuilder

Format-independent, single-use assembler. Coordinates are right-handed metres, +Y up, matrices are column-major and UV (0,0) addresses the image's top-left corner. Inputs are copied; build freezes the draft. Pixel/pivot/Euler conversion belongs to the producer.

JAVA
public final class com.heartlion.shadowui.modelcore.ModelAssetBuilder {
    public static final int MAX_NODES;
    public static final int MAX_VERTICES;
    public static final int MAX_SKIN_JOINTS;
    public static final long MAX_COMPONENTS;
    public static final long MAX_CPU_BYTES;
    public com.heartlion.shadowui.modelcore.ModelAssetBuilder();
    public com.heartlion.shadowui.modelcore.ModelAssetBuilder(long);
    public int node(java.lang.String, float[], float[], float[], boolean);
    public int matrixNode(java.lang.String, float[], boolean);
    public int xyzMatrixNode(java.lang.String, float[], boolean);
    public com.heartlion.shadowui.modelcore.ModelAssetBuilder parent(int, int);
    public com.heartlion.shadowui.modelcore.ModelAssetBuilder triangles(int, float[], float[], float[], int[], com.heartlion.shadowui.modelcore.ModelMaterial);
    public com.heartlion.shadowui.modelcore.ModelAssetBuilder skin(int, int[], float[]);
    public com.heartlion.shadowui.modelcore.ModelAssetBuilder skinnedTriangles(int, float[], float[], float[], int[], int[], float[], com.heartlion.shadowui.modelcore.ModelMaterial);
    public com.heartlion.shadowui.modelcore.ModelAssetBuilder clip(java.lang.String, double);
    public com.heartlion.shadowui.modelcore.ModelAssetBuilder externalClip(java.lang.String, double);
    public com.heartlion.shadowui.modelcore.ModelAssetBuilder channel(java.lang.String, int, com.heartlion.shadowui.modelcore.ModelAssetBuilder$Target, com.heartlion.shadowui.modelcore.ModelAssetBuilder$Interpolation, float[], float[]);
    public com.heartlion.shadowui.modelcore.ModelAsset build();
}

ModelAssetBuilder

public ModelAssetBuilder(long maxCpuBytes)

A caller may impose a smaller admission budget; fixed structural ceilings remain active.

xyzMatrixNode

public int xyzMatrixNode(String name, float[] matrix, boolean visible)

Explicit full MAT4 hierarchy with final xyz-only vertex evaluation, without a perspective divide. All 16 finite components participate in parent multiplication, including the bottom row. This does not repair a source's M44, represent a projective camera, or change affine matrixNode. The path is static/read-only like other matrix nodes. Skins and affine inverse-based consumers reject paths containing this explicit mode; query ModelAsset.nodeUsesXyzProjection before adapting.

skin

public ModelAssetBuilder skin(int node, int[] jointNodes, float[] inverseBindMatrices)

Palette entries refer to node IDs, not to a particular mesh's four-influence indices.

skinnedTriangles

public ModelAssetBuilder skinnedTriangles(int node, float[] positions, float[] normals, float[] uv, int[] indices, int[] paletteIndices, float[] weights, ModelMaterial material)

Four palette indices/weights per vertex. Weights are normalized in an owned copy.

externalClip

public ModelAssetBuilder externalClip(String name, double durationSeconds)

Registers metadata only. Sampling it without an instance-owned evaluator is an error.

ModelAssetBuilder.Target

com.heartlion.shadowui.modelcore.ModelAssetBuilder.Target

JAVA
public final class com.heartlion.shadowui.modelcore.ModelAssetBuilder$Target extends java.lang.Enum<com.heartlion.shadowui.modelcore.ModelAssetBuilder$Target> {
    public static final com.heartlion.shadowui.modelcore.ModelAssetBuilder$Target TRANSLATION;
    public static final com.heartlion.shadowui.modelcore.ModelAssetBuilder$Target ROTATION;
    public static final com.heartlion.shadowui.modelcore.ModelAssetBuilder$Target SCALE;
    public static com.heartlion.shadowui.modelcore.ModelAssetBuilder$Target[] values();
    public static com.heartlion.shadowui.modelcore.ModelAssetBuilder$Target valueOf(java.lang.String);
}

ModelAssetBuilder.Interpolation

com.heartlion.shadowui.modelcore.ModelAssetBuilder.Interpolation

JAVA
public final class com.heartlion.shadowui.modelcore.ModelAssetBuilder$Interpolation extends java.lang.Enum<com.heartlion.shadowui.modelcore.ModelAssetBuilder$Interpolation> {
    public static final com.heartlion.shadowui.modelcore.ModelAssetBuilder$Interpolation STEP;
    public static final com.heartlion.shadowui.modelcore.ModelAssetBuilder$Interpolation LINEAR;
    public static final com.heartlion.shadowui.modelcore.ModelAssetBuilder$Interpolation CUBICSPLINE;
    public static com.heartlion.shadowui.modelcore.ModelAssetBuilder$Interpolation[] values();
    public static com.heartlion.shadowui.modelcore.ModelAssetBuilder$Interpolation valueOf(java.lang.String);
}

ModelAssetBuilder.BudgetException

com.heartlion.shadowui.modelcore.ModelAssetBuilder.BudgetException

Distinguishes admission from structural errors without changing legacy catch compatibility.

JAVA
public final class com.heartlion.shadowui.modelcore.ModelAssetBuilder$BudgetException extends java.lang.IllegalArgumentException {
    public final java.lang.String code;
}

ModelClipController

com.heartlion.shadowui.modelcore.ModelClipController

Platform-independent command override over ordinary state animation. Uses the supplied game clock.

JAVA
public final class com.heartlion.shadowui.modelcore.ModelClipController {
    public com.heartlion.shadowui.modelcore.ModelClipController(com.heartlion.shadowui.modelcore.ModelAsset);
    public com.heartlion.shadowui.modelcore.ModelClipController(com.heartlion.shadowui.modelcore.ModelAsset, com.heartlion.shadowui.modelcore.ModelAnimationSampler);
    public com.heartlion.shadowui.modelcore.ModelInstance instance();
    public double elapsedSeconds();
    public double transitionProgress();
    public com.heartlion.shadowui.modelcore.ModelPlayback$State playbackState();
    public java.util.List<com.heartlion.shadowui.modelcore.ModelPlayback$Layer> playbackLayers();
    public boolean hasProgram();
    public com.heartlion.shadowui.modelcore.ModelClipController$CommandState commandState(double);
    public java.util.List<com.heartlion.shadowui.modelcore.ModelPlayback$Layer> commandLayers(double);
    public void play(java.lang.String, double, boolean, float, boolean);
    public void play(java.lang.String, double, boolean, float, boolean, double);
    public void playProgram(com.heartlion.shadowui.modelcore.ModelAnimationProgram, double, boolean, float, boolean, double);
    public boolean active(double);
    public boolean stop();
    public void update(java.lang.String, double, boolean, float, long);
    public void update(java.lang.String, double, boolean, float, long, double);
}

commandState

public CommandState commandState(double now)

Read-only command facts at the caller's game time, including an expired command's final interval. Does not sample, advance the stored clock, or clear the command as active/update may do.

commandLayers

public List<ModelPlayback.Layer> commandLayers(double now)

Projected layer clocks. Does not sample, clear an expired command or change accepted facts.

ModelClipController.CommandState

com.heartlion.shadowui.modelcore.ModelClipController.CommandState

JAVA
public final class com.heartlion.shadowui.modelcore.ModelClipController$CommandState {
    public final long sequence;
    public final java.lang.String clip;
    public final boolean loop;
    public final boolean active;
    public final double elapsedSeconds;
    public final double durationSeconds;
    public final float speed;
}

speed

public final float speed

Accepted playback speed; elapsed and duration remain authored clip seconds.

ModelInstance

com.heartlion.shadowui.modelcore.ModelInstance

Mutable pose belonging to exactly one entity/item, never to the cached asset. Not thread-safe.

JAVA
public final class com.heartlion.shadowui.modelcore.ModelInstance {
    public void sample(java.lang.String, double, boolean);
    public void sampleLayers(java.util.List<com.heartlion.shadowui.modelcore.ModelPlayback$Layer>, com.heartlion.shadowui.modelcore.ModelInstance$PoseSnapshot, double);
    public com.heartlion.shadowui.modelcore.ModelInstance$PoseSnapshot capturePose();
    public void blendFrom(com.heartlion.shadowui.modelcore.ModelInstance$PoseSnapshot, double);
    public boolean nodeTransform(java.lang.String, float[]);
    public boolean belongsTo(com.heartlion.shadowui.modelcore.ModelAsset);
    public void draw(com.heartlion.shadowui.modelcore.ModelInstance$MeshConsumer);
    public void draw(com.heartlion.shadowui.modelcore.ModelInstance$MeshConsumer, com.heartlion.shadowui.modelcore.ModelMeshSelection);
}

sample

public void sample(String animation, double seconds, boolean loop)

Absolute clip time in seconds. Null selects rest pose; unknown clips fail explicitly.

sampleLayers

public void sampleLayers(List<ModelPlayback.Layer> layers, PoseSnapshot source, double weight)

Sample accepted/remapped sparse layers and a transition atomically, without owning or advancing a clock. Layers must be ordered by their original contiguous slot; source belongs to this asset.

blendFrom

public void blendFrom(PoseSnapshot source, double targetWeight)

Blend the currently sampled target pose from a prior displayed pose, then update all anchors and skins.

nodeTransform

public boolean nodeTransform(String name, float[] result)

Explicit named anchor query, complete column-major model-space matrix copied into the caller's buffer. Explicit xyz-projection paths retain their bottom row; this query does not make them affine. Consumers needing an affine inverse must check the owning asset's path capability first.

draw

public void draw(MeshConsumer consumer, ModelMeshSelection selection)

Draw a precomputed triangle view in the current pose; null retains the full-mesh API. Only referenced vertices of a selection are updated. Consumers must follow its index buffer.

ModelInstance.MeshConsumer

com.heartlion.shadowui.modelcore.ModelInstance.MeshConsumer

JAVA
public interface com.heartlion.shadowui.modelcore.ModelInstance$MeshConsumer {
    public abstract void draw(com.heartlion.shadowui.modelcore.ModelMaterial, float[], float[], float[], int[]);
}

draw

public void draw(ModelMaterial material, float[] positions, float[] normals, float[] uv, int[] indices)

Borrowed arrays: consume synchronously, do not retain or modify. UVs use glTF image origin.

ModelInstance.PoseSnapshot

com.heartlion.shadowui.modelcore.ModelInstance.PoseSnapshot

Immutable local pose tied to its source asset; no mesh buffers are copied.

JAVA
public final class com.heartlion.shadowui.modelcore.ModelInstance$PoseSnapshot {
}

ModelLoadException

com.heartlion.shadowui.modelcore.ModelLoadException

Stable diagnostic at the resource boundary; never expose a partial model.

JAVA
public final class com.heartlion.shadowui.modelcore.ModelLoadException extends java.io.IOException {
    public com.heartlion.shadowui.modelcore.ModelLoadException(java.lang.String, java.lang.String);
    public com.heartlion.shadowui.modelcore.ModelLoadException(java.lang.String, java.lang.String, java.lang.Throwable);
    public java.lang.String getCode();
}

ModelMaterial

com.heartlion.shadowui.modelcore.ModelMaterial

Platform-independent material. Image decoding/upload belongs to the backend.

JAVA
public final class com.heartlion.shadowui.modelcore.ModelMaterial {
    public static final int MAX_ENCODED_IMAGE_BYTES;
    public final com.heartlion.shadowui.modelcore.ModelMaterial$AlphaMode alphaMode;
    public final boolean doubleSided;
    public final boolean unlit;
    public final float alphaCutoff;
    public final com.heartlion.shadowui.modelcore.ModelMaterial$Texture baseColorTexture;
    public final com.heartlion.shadowui.modelcore.ModelMaterial$Texture emissiveTexture;
    public static com.heartlion.shadowui.modelcore.ModelMaterial$Texture encodedTexture(byte[], int, int, int, int);
    public static com.heartlion.shadowui.modelcore.ModelMaterial material(com.heartlion.shadowui.modelcore.ModelMaterial$AlphaMode, boolean, float, float[], float[], com.heartlion.shadowui.modelcore.ModelMaterial$Texture, com.heartlion.shadowui.modelcore.ModelMaterial$Texture);
    public static com.heartlion.shadowui.modelcore.ModelMaterial material(com.heartlion.shadowui.modelcore.ModelMaterial$AlphaMode, boolean, float, float[], float[], com.heartlion.shadowui.modelcore.ModelMaterial$Texture, com.heartlion.shadowui.modelcore.ModelMaterial$Texture, boolean);
    public float color(int);
    public int sourceIndex();
    public float emissive(int);
}

encodedTexture

public static Texture encodedTexture(byte[] image, int wrapS, int wrapT, int minFilter, int magFilter)

Copies encoded PNG/JPEG data; validates its signature, not decoded pixels.

material

public static ModelMaterial material(AlphaMode mode, boolean doubleSided, float cutoff, float[] rgba, float[] emissive, Texture base, Texture glow)

Color factors are linear RGBA; emissive factors are finite and nonnegative.

material

public static ModelMaterial material(AlphaMode mode, boolean doubleSided, float cutoff, float[] rgba, float[] emissive, Texture base, Texture glow, boolean unlit)

Generic illumination policy; default callers retain normal lighting.

sourceIndex

public int sourceIndex()

Original material-table index, or -1 when no source material was assigned.

ModelMaterial.AlphaMode

com.heartlion.shadowui.modelcore.ModelMaterial.AlphaMode

JAVA
public final class com.heartlion.shadowui.modelcore.ModelMaterial$AlphaMode extends java.lang.Enum<com.heartlion.shadowui.modelcore.ModelMaterial$AlphaMode> {
    public static final com.heartlion.shadowui.modelcore.ModelMaterial$AlphaMode OPAQUE;
    public static final com.heartlion.shadowui.modelcore.ModelMaterial$AlphaMode MASK;
    public static final com.heartlion.shadowui.modelcore.ModelMaterial$AlphaMode BLEND;
    public static com.heartlion.shadowui.modelcore.ModelMaterial$AlphaMode[] values();
    public static com.heartlion.shadowui.modelcore.ModelMaterial$AlphaMode valueOf(java.lang.String);
}

ModelMaterial.Texture

com.heartlion.shadowui.modelcore.ModelMaterial.Texture

JAVA
public final class com.heartlion.shadowui.modelcore.ModelMaterial$Texture {
    public final int wrapS;
    public final int wrapT;
    public final int minFilter;
    public final int magFilter;
    public byte[] encodedImage();
    public int encodedBytes();
}

ModelMeshSelection

com.heartlion.shadowui.modelcore.ModelMeshSelection

Immutable, asset-bound triangle view. Sampling and skinning still use the original body pose. Intended for authored first-person arm views as well as explicitly separated mesh parts.

JAVA
public final class com.heartlion.shadowui.modelcore.ModelMeshSelection {
    public static com.heartlion.shadowui.modelcore.ModelMeshSelection nodes(com.heartlion.shadowui.modelcore.ModelAsset, java.util.Collection<java.lang.String>);
    public static com.heartlion.shadowui.modelcore.ModelMeshSelection boundedSubtrees(com.heartlion.shadowui.modelcore.ModelAsset, java.util.Collection<java.lang.String>, java.util.Collection<java.lang.String>);
    public static com.heartlion.shadowui.modelcore.ModelMeshSelection withoutNodeGeometry(com.heartlion.shadowui.modelcore.ModelAsset, java.util.Collection<java.lang.String>, boolean);
    public com.heartlion.shadowui.modelcore.ModelMeshSelection withoutNodeGeometry(java.util.Collection<java.lang.String>, boolean);
    public static com.heartlion.shadowui.modelcore.ModelMeshSelection skinJoints(com.heartlion.shadowui.modelcore.ModelAsset, java.util.Collection<java.lang.String>, float);
    public int triangleCount();
    public int vertexCount();
    public long estimatedCpuBytes();
}

nodes

public static ModelMeshSelection nodes(ModelAsset asset, Collection<String> roots)

Select all triangles on the named mesh-node subtrees, including rigid geometry.

boundedSubtrees

public static ModelMeshSelection boundedSubtrees(ModelAsset asset, Collection<String> selectedRoots, Collection<String> boundaryRoots)

Select subtrees, stopping inherited selection at explicit boundaries. A boundary is included only when also selected; selected descendants can start a new subtree below an excluded part. This supports independently authored equipment parts without changing the asset's visibility. Empty geometry is allowed; names still must resolve uniquely in this exact asset.

withoutNodeGeometry

public static ModelMeshSelection withoutNodeGeometry(ModelAsset asset, Collection<String> names, boolean normalized)

Hide only geometry directly on matching nodes, never their children or evaluation paths. Missing names are harmless; an entirely hidden view is valid. Matching can normalize ASCII letters/digits for legacy author names without mutating the shared asset or changing other consumers.

withoutNodeGeometry

public ModelMeshSelection withoutNodeGeometry(Collection<String> names, boolean normalized)

Restrict this triangle view without expanding it back to whole mesh nodes (for example an arm view).

skinJoints

public static ModelMeshSelection skinJoints(ModelAsset asset, Collection<String> roots, float minimumWeight)

Select a triangle only if every vertex has at least minimumWeight in the named joint subtrees. The strict > 0.5 threshold keeps disjoint anatomical selections from sharing a boundary vertex. Rigid primitives are deliberately excluded: authors can select their mesh nodes explicitly.

vertexCount

public int vertexCount()

Counts referenced vertices per mesh instance, not the size of the original position buffers.

ModelPlayback

com.heartlion.shadowui.modelcore.ModelPlayback

One object's clock. Time comes from the platform; assets and other objects are never mutated.

JAVA
public final class com.heartlion.shadowui.modelcore.ModelPlayback {
    public com.heartlion.shadowui.modelcore.ModelPlayback(com.heartlion.shadowui.modelcore.ModelAsset);
    public com.heartlion.shadowui.modelcore.ModelPlayback(com.heartlion.shadowui.modelcore.ModelAsset, com.heartlion.shadowui.modelcore.ModelAnimationSampler);
    public com.heartlion.shadowui.modelcore.ModelInstance instance();
    public double elapsedSeconds();
    public double transitionProgress();
    public com.heartlion.shadowui.modelcore.ModelPlayback$State state();
    public java.util.List<com.heartlion.shadowui.modelcore.ModelPlayback$Layer> layers();
    public void update(java.lang.String, double, boolean, float, long);
    public void update(java.lang.String, double, boolean, float, long, double);
    public void updateProgram(com.heartlion.shadowui.modelcore.ModelAnimationProgram, double, boolean, float, long, double);
}

state

public State state()

Immutable facts from the last successful sample; reading never advances playback.

layers

public List<Layer> layers()

Last accepted layers. This immutable snapshot never samples or retains a native actor.

updateProgram

public void updateProgram(ModelAnimationProgram next, double now, boolean loop, float speed, long restart, double transitionSeconds)

One integrated clock for a primary queue and bounded parallel layers.

ModelPlayback.Layer

com.heartlion.shadowui.modelcore.ModelPlayback.Layer

JAVA
public final class com.heartlion.shadowui.modelcore.ModelPlayback$Layer {
    public final int slot;
    public final int segment;
    public final java.lang.String clip;
    public final double elapsedSeconds;
    public final double durationSeconds;
    public final boolean loop;
    public com.heartlion.shadowui.modelcore.ModelPlayback$Layer remap(com.heartlion.shadowui.modelcore.ModelAsset, java.lang.String);
}

remap

public Layer remap(ModelAsset target, String targetClip)

Copy an accepted layer to an explicitly named target clip; keep time, queue and slot identity.

ModelPlayback.State

com.heartlion.shadowui.modelcore.ModelPlayback.State

JAVA
public final class com.heartlion.shadowui.modelcore.ModelPlayback$State {
    public final java.lang.String clip;
    public final long epoch;
    public final boolean loop;
    public final double elapsedSeconds;
    public final double durationSeconds;
    public final double sampleTime;
}

ModelResourceSource

com.heartlion.shadowui.modelcore.ModelResourceSource

Platform-owned resource view. Change generation whenever its active contents change.

JAVA
public interface com.heartlion.shadowui.modelcore.ModelResourceSource {
    public abstract long generation();
    public abstract java.io.InputStream open(java.lang.String) throws java.lang.Exception;
}

PlayerClipProfile

com.heartlion.shadowui.modelcore.PlayerClipProfile

Authored player clips and anatomical hand locators shared by platform adapters.

JAVA
public final class com.heartlion.shadowui.modelcore.PlayerClipProfile {
    public com.heartlion.shadowui.modelcore.PlayerClipProfile(java.lang.String, java.lang.String, java.lang.String, java.util.Map<com.heartlion.shadowui.modelcore.PlayerClipProfile$Motion, java.lang.String>);
    public java.lang.String clip(com.heartlion.shadowui.modelcore.PlayerClipProfile$Motion);
    public com.heartlion.shadowui.modelcore.SemanticSkeleton prepare(com.heartlion.shadowui.modelcore.ModelAsset);
    public static com.heartlion.shadowui.modelcore.PlayerClipProfile$Motion motion(boolean, boolean, boolean, boolean);
    public static java.lang.String grip(boolean, boolean);
}

PlayerClipProfile.Motion

com.heartlion.shadowui.modelcore.PlayerClipProfile.Motion

JAVA
public final class com.heartlion.shadowui.modelcore.PlayerClipProfile$Motion extends java.lang.Enum<com.heartlion.shadowui.modelcore.PlayerClipProfile$Motion> {
    public static final com.heartlion.shadowui.modelcore.PlayerClipProfile$Motion IDLE;
    public static final com.heartlion.shadowui.modelcore.PlayerClipProfile$Motion WALK;
    public static final com.heartlion.shadowui.modelcore.PlayerClipProfile$Motion RUN;
    public static final com.heartlion.shadowui.modelcore.PlayerClipProfile$Motion CROUCH;
    public static final com.heartlion.shadowui.modelcore.PlayerClipProfile$Motion JUMP;
    public static com.heartlion.shadowui.modelcore.PlayerClipProfile$Motion[] values();
    public static com.heartlion.shadowui.modelcore.PlayerClipProfile$Motion valueOf(java.lang.String);
}

SemanticSkeleton

com.heartlion.shadowui.modelcore.SemanticSkeleton

Explicit semantic-to-node binding, validated once against a particular immutable asset.

JAVA
public final class com.heartlion.shadowui.modelcore.SemanticSkeleton {
    public com.heartlion.shadowui.modelcore.SemanticSkeleton(com.heartlion.shadowui.modelcore.ModelAsset, java.util.Map<java.lang.String, java.lang.String>);
    public java.util.Set<java.lang.String> semantics();
    public void copyTransform(com.heartlion.shadowui.modelcore.ModelInstance, java.lang.String, float[]);
    public void copySampledTransform(com.heartlion.shadowui.modelcore.ModelInstance, java.lang.String, float[]);
    public void copyLocalTransform(com.heartlion.shadowui.modelcore.ModelInstance, java.lang.String, float[]);
    public void copyLocalRotation(com.heartlion.shadowui.modelcore.ModelInstance, java.lang.String, float[]);
    public void replaceLocalRotations(com.heartlion.shadowui.modelcore.ModelInstance, java.util.Map<java.lang.String, float[]>);
    public void applyTransforms(com.heartlion.shadowui.modelcore.ModelInstance, java.util.Map<java.lang.String, float[]>);
    public boolean isInSubtree(java.lang.String, java.lang.String);
    public void applyLocalRotations(com.heartlion.shadowui.modelcore.ModelInstance, java.util.Map<java.lang.String, float[]>);
}

copyTransform

public void copyTransform(ModelInstance instance, String semantic, float[] result)

Returns an owned copy in glTF model space; the platform supplies the outer entity/world transform.

copySampledTransform

public void copySampledTransform(ModelInstance instance, String semantic, float[] result)

Copies the model-space transform rebuilt from the current local pose, ignoring global overrides. This includes clip blending and explicit local offsets; it is not the asset's rest pose. All 16 components are retained, including explicit xyz-projection paths. The caller owns result.

copyLocalTransform

public void copyLocalTransform(ModelInstance instance, String semantic, float[] result)

Copies this node's sampled local MAT4, excluding parents and global overrides. Baked matrices retain all 16 components; no decomposition or inverse is required.

copyLocalRotation

public void copyLocalRotation(ModelInstance instance, String semantic, float[] result)

Copies the current local quaternion (x,y,z,w). Baked-matrix nodes reject this query.

replaceLocalRotations

public void replaceLocalRotations(ModelInstance instance, Map<String, float[]> rotations)

Replaces explicitly mapped local rotations after sampling; preserves translation, scale and unmapped rotations. The batch is atomic, input arrays are copied and quaternions normalized. Rebuilds globals/skin palettes and clears global overrides, like applyLocalRotations. The next sample restores authored pose; this does not change clip clocks or the shared asset.

applyTransforms

public void applyTransforms(ModelInstance instance, Map<String, float[]> transforms)

Replaces this instance's global overrides with owned finite model-space MAT4 values. Descendants and skin palettes are rebuilt atomically from the current local pose. Local TRS, clip clocks and transition snapshots are not changed. An empty map restores sampled globals. This is not a merging layer: consumers that combine drivers supply their complete set once. No affine restriction, node-role policy or animation/format default is imposed here.

isInSubtree

public boolean isInSubtree(String root, String candidate)

Immutable asset relationship, inclusive of root itself. Unknown semantics are rejected.

applyLocalRotations

public void applyLocalRotations(ModelInstance instance, Map<String, float[]> offsets)

Applies normalized local quaternion offsets after clip sampling (R_clip * R_offset). All inputs are validated before any pose is changed. The next sample resets the layer. Keys are explicit semantics, not guessed humanoid bone names. Matrix-only nodes are read-only.

SkinPoseBinding

com.heartlion.shadowui.modelcore.SkinPoseBinding

Follows body pose deltas while preserving a garment's bind shape and optional sampled secondary motion. Assets must use the same authored model-space units/basis. One binding is render-thread confined.

JAVA
public final class com.heartlion.shadowui.modelcore.SkinPoseBinding {
    public com.heartlion.shadowui.modelcore.SkinPoseBinding(com.heartlion.shadowui.modelcore.ModelAsset, com.heartlion.shadowui.modelcore.ModelAsset, java.util.Map<java.lang.String, java.lang.String>);
    public com.heartlion.shadowui.modelcore.SkinPoseBinding(com.heartlion.shadowui.modelcore.ModelAsset, java.util.Map<java.lang.String, java.lang.String>);
    public com.heartlion.shadowui.modelcore.ModelMeshSelection selectForBodyJoints(java.util.Collection<java.lang.String>, float);
    public void apply(com.heartlion.shadowui.modelcore.ModelInstance, com.heartlion.shadowui.modelcore.ModelInstance);
    public void apply(java.util.Map<java.lang.String, float[]>, java.util.Map<java.lang.String, float[]>, com.heartlion.shadowui.modelcore.ModelInstance);
}

SkinPoseBinding

public SkinPoseBinding(ModelAsset garment, Map<String, String> garmentToSource)

Follows named external global matrices, in a common model-space basis. The names have no skeleton or platform semantics. Input maps and matrices are not retained.

selectForBodyJoints

public ModelMeshSelection selectForBodyJoints(Collection<String> bodyRoots, float minimumWeight)

Projects anatomical body subtrees through the explicit mapping, without assuming garment hierarchy parity. A valid empty view means this garment has no geometry on that arm (for example trousers). Rigid children follow their nearest mapped ancestor, so a differently mapped child is a boundary.

apply

public void apply(Map<String, float[]> sourceRest, Map<String, float[]> sourceCurrent, ModelInstance garmentInstance)

Applies current * inverse(rest) to the garment's unlinked sampled pose. Rest matrices must be invertible; all inputs must be finite affine column-major MAT4 values. Validation and inherited palette preparation complete before any visible pose is replaced.