feat(animation): script-playable skeletal animation via AnimSkin writeback

AnimSkin can now write CPU-skinning results back to the render mesh so skeletal animation actually plays from scripts:
- capture bind normals at fromModel and skin them per pose (updateSkinnedNormals / getSkinnedNormals, cofactor inverse-transpose + normalize)
- packed getSkinnedPositions() array getter, matching AnimLattice's script pattern
- one-call applyToMesh(gfx, mesh, pose): skin positions+normals then in-place gpu.updateMeshVertices
- Renderable3D.getMesh() script binding so createRenderable meshes are reachable
- Mesh::gpuVertexCount so getVertexCount() is correct for non-morph meshes (both backends)
- tests: packed positions == skinPositionsTo, normals follow pose and stay unit length, applyToMesh render test with in-place updates
- docs: animation/graphics user guides + design spec
This commit is contained in:
西风逍遥游 committed 2026-08-23 14:24:11 +08:00
1 parent cf41d1b5ae
commit c65daede2e
16 files changed
+628 -6

No files matched your search

+1
View File
@@ -2045,6 +2045,7 @@ Mesh *Graphics::newMeshFromArrays(const float *posXYZ, const float *nrmXYZ, cons
auto *mesh = new Mesh();
mesh->indexCount = indexCount;
mesh->gpuVertexCount = vertexCount;
mesh->gpuHandle = gpu.get();
mesh->computeBounds(posXYZ, vertexCount);
ownedGpuMeshes.push_back(std::move(gpu));