using System; using System.Numerics; using AcDream.Core.Physics; using DatReaderWriter.Types; namespace AcDream.Core.Rendering; /// /// #188 — routes animation hooks to a /// . Retail's /// TransparentPartHook::Execute (0x00526cc0) is a one-liner calling /// CPhysicsObj::SetPartTranslucency(obj, part, start, end, time) — /// this sink is that same one-line forward. /// /// /// Whole-object and /// are deliberately NOT handled here. Retail's EtherealHook::Execute /// (0x00526bc0) touches only CPhysicsObj::set_ethereal — collision /// state, zero rendering coupling — and acdream's collision-passthrough /// already applies server-authoritative via the SetState wire /// message, independent of this hook firing client-side. /// /// public sealed class TranslucencyHookSink : IAnimationHookSink { private readonly TranslucencyFadeManager _fades; public TranslucencyHookSink(TranslucencyFadeManager fades) { _fades = fades ?? throw new ArgumentNullException(nameof(fades)); } public void OnHook(uint entityId, Vector3 entityWorldPosition, AnimationHook hook) { if (hook is not TransparentPartHook tph) return; _fades.StartPartFade(entityId, tph.PartIndex, tph.Start, tph.End, tph.Time); } }