BaseEffectclass
A transient camera effect, living in the `Sandbox.CameraEffectSystem`. Targets one `Sandbox.CameraEffectSystem.BaseEffect.Camera`, every camera (null), or radiates from an `Sandbox.CameraEffectSystem.BaseEffect.Epicenter` with distance falloff. Derive to make your own effects.
Constructors1
Showing 1 constructors
protected BaseEffect()
No results match this filter.
Methods4
Showing 4 methods
public virtual void Evaluate(float scale, Vector3 position, Angles angles, float fieldOfView)
Accumulate this effect's contribution. `position` is camera-local - `Vector3.Forward` pushes the view forward, `Vector3.Up` up.
| Parameter | Type | Description |
|---|---|---|
| scale | float | — |
| position | Vector3 | — |
| angles | Angles | — |
| fieldOfView | float | — |
void—public virtual float ScaleFor(Sandbox.CameraComponent camera)
How strongly this effect applies to a camera - 0 when it targets a different camera, fading with distance from the `Sandbox.CameraEffectSystem.BaseEffect.Epicenter` when one is set. Override for custom falloff.
| Parameter | Type | Description |
|---|---|---|
| camera | CameraComponent | — |
float—public void Stop()
End the effect now.
void—public virtual void Update(float delta)
Advance the effect - called once a frame by the system.
| Parameter | Type | Description |
|---|---|---|
| delta | float | — |
void—No results match this filter.
Properties8
Showing 8 properties
public Sandbox.CameraComponent Sandbox.CameraEffectSystem.BaseEffect.Camera { get; set; }
The camera this applies to - null applies to every camera.
public float Sandbox.CameraEffectSystem.BaseEffect.Duration { get; set; }
Seconds the effect runs. Zero or less runs until `Sandbox.CameraEffectSystem.BaseEffect.Stop`.
float—public System.Nullable`1<Vector3> Sandbox.CameraEffectSystem.BaseEffect.Epicenter { get; set; }
When set, the effect radiates from this world position - full strength at the epicenter, nothing beyond `Sandbox.CameraEffectSystem.BaseEffect.Radius`.
protected float Sandbox.CameraEffectSystem.BaseEffect.Fraction { get; set; }
1 at the start of the effect's life falling to 0 at the end. Infinite effects hold 1.
float—public virtual bool Sandbox.CameraEffectSystem.BaseEffect.IsDone { get; set; }
True when the effect has expired or been stopped, and is about to be removed. An effect whose target camera has been destroyed is done too.
bool—public bool Sandbox.CameraEffectSystem.BaseEffect.IsInfinite { get; set; }
Runs until `Sandbox.CameraEffectSystem.BaseEffect.Stop` rather than expiring.
bool—public float Sandbox.CameraEffectSystem.BaseEffect.Radius { get; set; }
How far the effect reaches from `Sandbox.CameraEffectSystem.BaseEffect.Epicenter`.
float—public float Sandbox.CameraEffectSystem.BaseEffect.TimeAlive { get; set; }
Seconds this effect has been running.
float—No results match this filter.