Release Healer Man 0.1.30
This commit is contained in:
1 parent
544c1bee91
commit
7d7fd567f0
845 files changed
+2040
-87
No files matched your search
@@ -401,7 +401,7 @@ export function parseOriginalCombatMeshGraph(value: unknown): OriginalCombatMesh
|
||||
};
|
||||
}
|
||||
|
||||
type OriginalCombatMeshSampleValue = number | readonly [number, number, number];
|
||||
type OriginalCombatMeshSampleValue = number | readonly [number, number, number] | readonly [number, number, number, number];
|
||||
|
||||
function baseTrackValue<T extends OriginalCombatMeshSampleValue>(
|
||||
value: OriginalCombatMeshTrackValue<T>,
|
||||
@@ -428,14 +428,14 @@ function combineTrackValues<T extends OriginalCombatMeshSampleValue>(
|
||||
total + (value as number) * coefficients[index]
|
||||
), 0) as T;
|
||||
}
|
||||
return [0, 1, 2].map((component) => values.reduce<number>((total, value, index) => (
|
||||
return (values[0] as readonly number[]).map((_, component) => values.reduce<number>((total, value, index) => (
|
||||
total + (value as readonly number[])[component] * coefficients[index]
|
||||
), 0)) as unknown as T;
|
||||
}
|
||||
|
||||
/** Sample one source M2 track for a selected animation sequence. */
|
||||
export function sampleOriginalCombatMeshTrack<T extends OriginalCombatMeshSampleValue>(
|
||||
graph: OriginalCombatMeshGraph,
|
||||
graph: Pick<OriginalCombatMeshGraph, "globalSequences">,
|
||||
track: OriginalCombatMeshTrack<T>,
|
||||
frame: OriginalCombatMeshPlaybackFrame,
|
||||
): T | undefined {
|
||||
@@ -467,6 +467,10 @@ export function sampleOriginalCombatMeshTrack<T extends OriginalCombatMeshSample
|
||||
const upperValue = baseTrackValue(upper);
|
||||
if (track.interpolation === 0) return lowerValue;
|
||||
if (track.interpolation === 1) {
|
||||
if (Array.isArray(lowerValue) && lowerValue.length === 4 && Array.isArray(upperValue)) {
|
||||
const dot = lowerValue.reduce((sum, value, index) => sum + value * upperValue[index], 0);
|
||||
return combineTrackValues([lowerValue as T, upperValue as T], [1 - progress, dot < 0 ? -progress : progress]);
|
||||
}
|
||||
return combineTrackValues([lowerValue, upperValue], [1 - progress, progress]);
|
||||
}
|
||||
const lowerSpline = splineTrackValue(lower);
|
||||
@@ -489,7 +493,7 @@ export function sampleOriginalCombatMeshTrack<T extends OriginalCombatMeshSample
|
||||
|
||||
/** Select Stand once, Hold in a loop, or Decay once from the source M2. */
|
||||
export function originalCombatMeshPlaybackFrame(
|
||||
graph: OriginalCombatMeshGraph,
|
||||
graph: Pick<OriginalCombatMeshGraph, "animations">,
|
||||
elapsedMs: number,
|
||||
decaying = false,
|
||||
): OriginalCombatMeshPlaybackFrame {
|
||||
|
||||
Reference in new issue
Block a user