Struct LightPulse
- Namespace
- BSGameLib.Game
- Assembly
- BSGameLib.Game.dll
A light's pulse: its intensity, and optionally its radius, swing either way along a sine.
public readonly record struct LightPulse : IEquatable<LightPulse>
- Implements
- Inherited Members
Remarks
The pulse follows the game's total time, not when the light was added, so a light removed and added again every frame pulses smoothly. Give lights different Offsets so they don't pulse in step.
Constructors
LightPulse(float, float, float, float)
A light's pulse: its intensity, and optionally its radius, swing either way along a sine.
public LightPulse(float Frequency, float Amplitude, float RadiusAmplitude = 0, float Offset = 0)
Parameters
FrequencyfloatPulses a second.
AmplitudefloatHow far the intensity moves either way.
RadiusAmplitudefloatHow far the radius moves either way, as a multiple of the intensity's swing.
OffsetfloatSeconds to shift the pulse by.
Remarks
The pulse follows the game's total time, not when the light was added, so a light removed and added again every frame pulses smoothly. Give lights different Offsets so they don't pulse in step.
Properties
Amplitude
How far the intensity moves either way.
public float Amplitude { get; init; }
Property Value
Frequency
Pulses a second.
public float Frequency { get; init; }
Property Value
Offset
Seconds to shift the pulse by.
public float Offset { get; init; }
Property Value
RadiusAmplitude
How far the radius moves either way, as a multiple of the intensity's swing.
public float RadiusAmplitude { get; init; }