public VoxLib(String VXLName, String HVAName) { MotLib = new HVA(FileSystem.LoadFile(HVAName)); Voxel = new VXL(FileSystem.LoadFile(VXLName)); Frame = 0; Voxel.SetHVA(MotLib); }
public void SetHVA(HVA Mot) { MotLib = Mot; foreach (var s in Sections) { s.FrameCount = (int)MotLib.Header.FrameCount; } }
public bool ReadFile(BinaryReader r) { id = HVA.ReadCString(r, 16); FrameCount = r.ReadUInt32(); SectionCount = r.ReadUInt32(); return(true); }
internal void GetVertices(HVA.Section MotLib, int FrameIdx, PAL Palette, List<VertexPositionColorNormal> Vertices, List<int> Indices) { if (ComputedFrames[FrameIdx] == null) { ComputeVerticesIndices(Palette); var computedF = new SectionFrame(); var rot = MotLib.GetRotation(FrameIdx); var pos = MotLib.GetPosition(FrameIdx); pos *= Tail.HVAMultiplier; computedF.ComputedVertices = ComputedVertices.Select(v => { v.Position = Vector3.Transform(v.Position, rot); v.Position += pos; return v; }).ToList(); computedF.ComputedIndices = ComputedIndices; ComputedFrames[FrameIdx] = computedF; } var cached = ComputedFrames[FrameIdx]; Vertices.AddRange(cached.ComputedVertices); Indices.AddRange(cached.ComputedIndices); }
public void ReadID(ArraySegment <byte> s) { id = HVA.ReadCString(s, 16); }