3D 리플레이 실감 4단계: 1인칭 팔 · 총 · 동작 · 발로란트 조준점
- 추출기 viewmodels: 요원 1인칭 팔 fparms_* (30명) · 무기 1인칭 fpweapon_* (22종, 탄창 · 총 동작) · 팔 동작 fpanim_* (대기 · 사격 · 재장전 · 꺼내기 · 정조준 · 걷기 · 스파이크 작동). Agents.Skinned 로 스켈레탈 메시 내보내기를 나눠 3인칭 요원과 같이 쓴다 - pack.py · update.sh: viewmodels 압축 · index.json viewmodels, 갱신 때 같이 뽑는다 - 사이트 lib/viewmodel.ts: 카메라 공간 장면으로 맵 위에 그린다. 꺼내기 > 재장전 > 사격(총구 불꽃) > 걷기 > 정조준 > 대기를 리플레이 시각만으로 고른다 - 1인칭: 줌(소총 1.25배 · 저격 2.5/5배 + 조준경), 조준점을 발로란트 기본 십자(흰 선 · 틈 · 외곽선)로 - 작업 노트 docs/dev/replay-3d.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -138,6 +138,34 @@ public static class Weapons
|
||||
return tris;
|
||||
}
|
||||
|
||||
/// <summary>정적 메시(탄창)를 뼈 노드의 자식 메시로 붙인다 (뼈 공간 그대로). 붙인 삼각형 수</summary>
|
||||
public static int AttachStatic(IFileProvider provider, Glb glb, TexStore tex, UStaticMesh sm, int[] boneNode, MeshBoneDto[] bones, string bone)
|
||||
{
|
||||
var bi = Array.FindIndex(bones, b => b.Name.Equals(bone, StringComparison.OrdinalIgnoreCase));
|
||||
if (bi < 0 || sm.RenderData?.LODs?.FirstOrDefault(l => !l.SkipLod) is not { } ml || ml.PositionVertexBuffer?.Verts is not { Length: > 0 } mv || ml.IndexBuffer?.Buffer is not { } mib) return 0;
|
||||
var pos = new List<float>();
|
||||
var nrm = new List<float>();
|
||||
var uv = new List<float>();
|
||||
for (var i = 0; i < mv.Length; i++)
|
||||
{
|
||||
pos.AddRange([mv[i].X, mv[i].Y, mv[i].Z]);
|
||||
var it = ml.VertexBuffer?.UV is { } u && i < u.Length ? u[i] : null;
|
||||
var n = it?.Normal is { Length: >= 3 } nn ? (FVector)nn[2] : new FVector(0, 0, 1);
|
||||
nrm.AddRange([n.X, n.Y, n.Z]);
|
||||
uv.AddRange([it?.UV is { Length: > 0 } uu ? uu[0].U : 0, it?.UV is { Length: > 0 } uv2 ? uv2[0].V : 0]);
|
||||
}
|
||||
var secs = ml.Sections.Select(s => (s.FirstIndex, s.NumTriangles, Mat: (FPackageIndex?)(s.MaterialIndex < sm.StaticMaterials.Length ? sm.StaticMaterials[s.MaterialIndex].MaterialInterface : null))).ToList();
|
||||
var prims = new JsonArray();
|
||||
var tris = AddPrims(provider, glb, tex, prims, pos, nrm, uv, mib.Select(x => (uint)x).ToArray(), secs);
|
||||
if (prims.Count == 0) return 0;
|
||||
glb.Meshes.Add(new JsonObject { ["name"] = sm.Name, ["primitives"] = prims });
|
||||
glb.Nodes.Add(new JsonObject { ["name"] = sm.Name, ["mesh"] = glb.Meshes.Count - 1 });
|
||||
var parent = glb.Nodes[boneNode[bi]]!.AsObject();
|
||||
if (parent["children"] is not JsonArray ch) parent["children"] = ch = new JsonArray();
|
||||
ch.Add(glb.Nodes.Count - 1);
|
||||
return tris;
|
||||
}
|
||||
|
||||
private static int AddPrims(IFileProvider provider, Glb glb, TexStore tex, JsonArray prims, List<float> pos, List<float> nrm, List<float> uv, uint[] indices, List<(int First, int Faces, FPackageIndex? Mat)> secs)
|
||||
{
|
||||
var aPos = glb.Floats(pos.ToArray(), 3, bounds: true);
|
||||
|
||||
Reference in New Issue
Block a user