Fix ambient flyer cadence and rotating shadows
This commit is contained in:
parent
9cd429dd73
commit
8b7b601b32
5 changed files with 239 additions and 3 deletions
|
|
@ -23,6 +23,15 @@ internal sealed class RetailStaticAnimatingObjectScheduler : ILiveStaticPartFram
|
|||
private const double FrameEpsilon = 0.000199999995;
|
||||
private const float MaximumElapsed = 2f;
|
||||
|
||||
// The eight retail SetOmega-authored ambient-flyer animations use their
|
||||
// vector as a per-animation-quantum turn. Their animation data is authored
|
||||
// at 30 fps; replaying that raw turn once per modern host/render frame
|
||||
// makes orbit speed scale with monitor refresh (6x at 180 Hz). Keep the
|
||||
// exact authored result at 30 Hz while making the DAT-scenery projection
|
||||
// independent of host cadence. Live PhysicsBody owners retain the literal
|
||||
// CPhysicsObj branch below and are deliberately not changed here.
|
||||
private const double DatStaticOmegaReferenceHz = 30d;
|
||||
|
||||
private sealed class Owner
|
||||
{
|
||||
public required WorldEntity Entity;
|
||||
|
|
@ -468,10 +477,17 @@ internal sealed class RetailStaticAnimatingObjectScheduler : ILiveStaticPartFram
|
|||
// static has no CPhysicsObj of its own, so the WorldEntity IS
|
||||
// the frame retail would be rotating — and the render
|
||||
// projection re-reads entity.Rotation every frame, so the
|
||||
// parts composed below orbit it.
|
||||
// parts composed below orbit it. SetOmega's authored vector is
|
||||
// a 30 Hz per-animation-quantum turn; normalize it at this
|
||||
// modern host boundary so monitor refresh cannot change the
|
||||
// flight period.
|
||||
owner.RootFrameScratch.Origin = owner.Entity.Position;
|
||||
owner.RootFrameScratch.Orientation = owner.Entity.Rotation;
|
||||
FrameOps.GRotate(owner.RootFrameScratch, owner.Omega);
|
||||
float omegaScale = (float)(
|
||||
ownerElapsed * DatStaticOmegaReferenceHz);
|
||||
FrameOps.GRotate(
|
||||
owner.RootFrameScratch,
|
||||
owner.Omega * omegaScale);
|
||||
owner.Entity.Rotation = owner.RootFrameScratch.Orientation;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue