Vixen
02b45cc4
csharp
public struct CameraImpulse

Something that happened somewhere, hard enough to be felt through the camera.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

An impulse is an initial velocity, not a displacement. A shell landing gives the camera a shove of so many metres per second in some direction, and what is seen is the ring-down of that shove: a decaying oscillation whose amplitude is |Velocity| / 2πf. That is why doubling Frequency halves the visible kick from the same number — a high-frequency rattle and a low-frequency lurch are different events rather than the same one played at different speeds, and expressing them as an amplitude would make them the same one.

It has a place, so distance means something. Contributions fall off with DissipationDistance and arrive late by distance / PropagationSpeed — the far explosion is felt smaller and a moment after it is seen, which is free once the impulse knows where it happened.

Fields and properties (7)

  • public Vector3 Position

    Where it happened, in world space.

  • public Vector3 Velocity

    The shove, in world units per second. Its direction is the direction of the kick.

  • public float Duration

    How long the ring-down lasts, in seconds. The signal is exactly zero at the end.

  • public float Frequency

    How fast the camera rings, in cycles per second.

  • public float DissipationDistance

    The distance at which the impulse is no longer felt. Zero means it never fades.

  • public float PropagationSpeed

    How fast the impulse travels outward, in world units per second. Zero arrives everywhere at once.

  • public float Age

    How long ago it happened. Owned by CameraImpulses.

Methods (1)

  • public static CameraImpulse Bump(Vector3 position, Vector3 velocity, float duration = 0.5, float dissipation = 0)

    A short, sharp knock in one direction.

Used by (4)

  • CameraImpulsesVixen.Engine
  • TypeRegistrationVixen.Engine
  • VirtualCameraTestsVixen.Engine.Tests
  • Vixen_Engine_Cameras_CameraImpulseSerializerVixen.Engine