Animators and coilhead animations

This commit is contained in:
2026-11-21 21:54:02 -03:00
parent 69ad4b80d0
commit 0c711b8163
21 changed files with 960 additions and 34 deletions
+4 -3
View File
@@ -11,7 +11,7 @@ import type { Texture } from "@/client/renderer/mod.ts";
import { get_sprite_region } from "@/client/sprites.ts";
import { EverythingRegistry, type ItemRegistry } from "@/common/everything_registry.ts";
import type { EntityBoneJson, EntityModelJson } from "@/common/mod_data.ts";
import { IDENTITY, type Vec3 } from "./model_math.ts";
import { bone_matrices, IDENTITY, type Vec3 } from "./model_math.ts";
import { push_model } from "./model_renderer.ts";
import type { VertexSink } from "./player_renderer.ts";
import { on_part, type PlayerPose, pose_to_world, right_arm, worn_bone_pose, worn_look } from "./player_model.ts";
@@ -34,7 +34,7 @@ export function push_worn(worn_items: ItemStack[], pose: PlayerPose, tint?: Vec3
if (!model) continue;
push_model(
model,
worn_bone_pose(pose),
bone_matrices(model, worn_bone_pose(pose)),
atlas,
get_sprite_region(look.texture),
to_world,
@@ -59,6 +59,7 @@ export function render_worn_arm(player: Player, transform: (x: number, y: number
const model = EverythingRegistry.get<EntityModelJson>("entity_models", look.model);
if (!model) continue;
const only = (bone: EntityBoneJson) => on_part(model, bone, "right_arm");
push_model(model, () => IDENTITY, atlas, get_sprite_region(look.texture), to_arm, tint, only);
const bones = bone_matrices(model, () => IDENTITY);
push_model(model, bones, atlas, get_sprite_region(look.texture), to_arm, tint, only);
}
}