fix(vfx #C.1.5a): seed entity rotation in activator so hook offset rotates
Visual verification at the Holtburg Town network portal revealed the swirl was oriented along world axes (NS) instead of the portal's actual facing (EW), and partially buried in the ground because the hook's local-frame Offset.Origin was being applied in world axes too. Root cause: EntityScriptActivator.OnCreate fired _scriptRunner.Play but never called _particleSink.SetEntityRotation. When the runner's CreateParticleHook fires, the sink reads per-entity rotation from _rotationByEntity (defaults to Quaternion.Identity for unknown entities) and uses it to transform the hook's Offset.Origin from entity-local to world space. Without the seed call, the rotation lookup falls through to Identity and the offset goes off along world XYZ. Fix is a single SetEntityRotation call before the Play call. Added a 4th unit test that constructs an entity with a 90 deg yaw and asserts the spawned particle's world position reflects the rotated offset. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
849690c814
commit
334f0c6a26
2 changed files with 66 additions and 0 deletions
|
|
@ -68,6 +68,14 @@ public sealed class EntityScriptActivator
|
|||
uint scriptId = _defaultScriptResolver(entity);
|
||||
if (scriptId == 0) return;
|
||||
|
||||
// Seed the sink's per-entity rotation so CreateParticleHook.Offset.Origin
|
||||
// (in entity-local frame) transforms correctly to world space when the
|
||||
// hook fires. Without this, the sink falls through to Quaternion.Identity
|
||||
// and the offset gets applied in world axes — visual symptom for portals:
|
||||
// swirl oriented along world XYZ instead of the portal's facing, partially
|
||||
// buried because the local-Z lift becomes a world-axis offset.
|
||||
_particleSink.SetEntityRotation(entity.ServerGuid, entity.Rotation);
|
||||
|
||||
_scriptRunner.Play(scriptId, entity.ServerGuid, entity.Position);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue