Update Healer Man server
This commit is contained in:
1 parent
9c5fb4c614
commit
bd073fb00f
113 files changed
+4902
-273
No files matched your search
@@ -11,12 +11,13 @@ import { updateWowBoneMatrices, wowModelFrame, type OriginalWowModelGraph, type
|
||||
const blend = (mode: number) => [3, 4, 7].includes(mode) ? AdditiveBlending
|
||||
: [5, 6].includes(mode) ? MultiplyBlending : NormalBlending;
|
||||
|
||||
export const OriginalWowModel = memo(function OriginalWowModel({ graph, textures, active, playbackRef, loop }: {
|
||||
export const OriginalWowModel = memo(function OriginalWowModel({ graph, textures, active, playbackRef, loop, opacity = 1 }: {
|
||||
readonly graph: OriginalWowModelGraph;
|
||||
readonly textures: ReadonlyMap<number, Texture>;
|
||||
readonly active: boolean;
|
||||
readonly playbackRef: MutableRefObject<{ elapsedMs: number; decaying: boolean }>;
|
||||
readonly loop: boolean;
|
||||
readonly opacity?: number;
|
||||
}) {
|
||||
const root = useRef<Group>(null);
|
||||
const scratch = useMemo(() => ({
|
||||
@@ -111,7 +112,7 @@ export const OriginalWowModel = memo(function OriginalWowModel({ graph, textures
|
||||
const rgb = color ? sampleOriginalCombatMeshTrack(graph, color.color, frame) : undefined;
|
||||
material.color.setRGB(...(rgb ?? [1, 1, 1]));
|
||||
material.opacity = Math.max(0, Math.min(1, (color ? sampleOriginalCombatMeshTrack(graph, color.alpha, frame) ?? 32767 : 32767)
|
||||
* (weight ? sampleOriginalCombatMeshTrack(graph, weight, frame) ?? 32767 : 32767) / (32767 * 32767)));
|
||||
* (weight ? sampleOriginalCombatMeshTrack(graph, weight, frame) ?? 32767 : 32767) / (32767 * 32767))) * opacity;
|
||||
maps.forEach((texture, slot) => {
|
||||
const transform = graph.textureTransforms[layer.textureTransformIndices[slot]];
|
||||
if (!transform) return;
|
||||
@@ -127,14 +128,15 @@ export const OriginalWowModel = memo(function OriginalWowModel({ graph, textures
|
||||
{geometry && <mesh name="original-wow-animated-mesh" geometry={geometry}
|
||||
material={materials.map((entry) => entry.material)} frustumCulled={false} />}
|
||||
{graph.ribbons.map((ribbon, index) => <OriginalWowRibbon key={index} graph={graph} ribbon={ribbon}
|
||||
textures={textures} active={active} bones={scratch.bones} playbackRef={playbackRef} loop={loop} />)}
|
||||
textures={textures} active={active} bones={scratch.bones} playbackRef={playbackRef} loop={loop} opacity={opacity} />)}
|
||||
</group>;
|
||||
});
|
||||
|
||||
const OriginalWowRibbon = memo(function OriginalWowRibbon({ graph, ribbon, textures, active, bones, playbackRef, loop }: {
|
||||
const OriginalWowRibbon = memo(function OriginalWowRibbon({ graph, ribbon, textures, active, bones, playbackRef, loop, opacity }: {
|
||||
readonly graph: OriginalWowModelGraph; readonly ribbon: WowRibbon; readonly textures: ReadonlyMap<number, Texture>;
|
||||
readonly active: boolean; readonly bones: readonly Matrix4[];
|
||||
readonly playbackRef: MutableRefObject<{ elapsedMs: number; decaying: boolean }>; readonly loop: boolean;
|
||||
readonly opacity: number;
|
||||
}) {
|
||||
const root = useRef<Group>(null);
|
||||
const capacity = Math.min(128, Math.max(4, Math.ceil(ribbon.edgesPerSecond * ribbon.edgeLifetime) + 2));
|
||||
@@ -194,7 +196,7 @@ const OriginalWowRibbon = memo(function OriginalWowRibbon({ graph, ribbon, textu
|
||||
}
|
||||
});
|
||||
material.color.setRGB(...(sampleOriginalCombatMeshTrack(graph, ribbon.tracks.color, frame) ?? [1, 1, 1]));
|
||||
material.opacity = Math.max(0, Math.min(1, (sample("alpha") ?? 32767) / 32767));
|
||||
material.opacity = Math.max(0, Math.min(1, (sample("alpha") ?? 32767) / 32767)) * opacity;
|
||||
positions.needsUpdate = true; uv.needsUpdate = true;
|
||||
geometry.setDrawRange(0, Math.max(0, history.edges.length - 1) * 6);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user