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.

objectBaseEffect
Namespace
global
Assembly
Sandbox.Engine
Declaration
public abstract class Sandbox.CameraEffectSystem.BaseEffect

Constructors1

Showing 1 constructors

Methods4

Showing 4 methods

public virtual void Evaluate(float scale, Vector3 position, Angles angles, float fieldOfView)PUBLICVIRTUAL

Accumulate this effect's contribution. `position` is camera-local - `Vector3.Forward` pushes the view forward, `Vector3.Up` up.

ParameterTypeDescription
scalefloat
positionVector3
anglesAngles
fieldOfViewfloat
Returns:void

public virtual float ScaleFor(Sandbox.CameraComponent camera)PUBLICVIRTUAL

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.

ParameterTypeDescription
cameraCameraComponent
Returns:float

public void Stop()PUBLIC

End the effect now.

Returns:void

public virtual void Update(float delta)PUBLICVIRTUALPER-FRAME

Advance the effect - called once a frame by the system.

ParameterTypeDescription
deltafloat
Returns:void

Properties8

Showing 8 properties

public float Sandbox.CameraEffectSystem.BaseEffect.Duration { get; set; }PUBLICGETSET

Seconds the effect runs. Zero or less runs until `Sandbox.CameraEffectSystem.BaseEffect.Stop`.

Returns:float

public System.Nullable`1<Vector3> Sandbox.CameraEffectSystem.BaseEffect.Epicenter { get; set; }PUBLICGETSET

When set, the effect radiates from this world position - full strength at the epicenter, nothing beyond `Sandbox.CameraEffectSystem.BaseEffect.Radius`.

Returns:Nullable<Vector3>

protected float Sandbox.CameraEffectSystem.BaseEffect.Fraction { get; set; }PROTECTEDGETSET

1 at the start of the effect's life falling to 0 at the end. Infinite effects hold 1.

Returns:float

public virtual bool Sandbox.CameraEffectSystem.BaseEffect.IsDone { get; set; }PUBLICVIRTUALGETSET

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.

Returns:bool

public bool Sandbox.CameraEffectSystem.BaseEffect.IsInfinite { get; set; }PUBLICGETSET

Runs until `Sandbox.CameraEffectSystem.BaseEffect.Stop` rather than expiring.

Returns:bool

public float Sandbox.CameraEffectSystem.BaseEffect.Radius { get; set; }PUBLICGETSET

How far the effect reaches from `Sandbox.CameraEffectSystem.BaseEffect.Epicenter`.

Returns:float

On this page