class MAGES::Interaction::LocomotionVignette

Overview

A comfort effect that narrows the user’s field of view with a soft vignette while a locomotion provider is moving or turning the rig, to reduce motion sickness. More…

class LocomotionVignette: public MonoBehaviour
{
public:
    // classes

    class ProviderOverride;

    // properties

    LocomotionSystem LocomotionSystem;
    LocomotionVignetteSettings Settings;
    List<ProviderOverride> ProviderOverrides;
    Material Material;
    Camera TargetCamera;
    float Intensity;
    bool IsVisible;

    // methods

    void Pulse(LocomotionVignetteSettings settings = null);
};

Detailed Documentation

A comfort effect that narrows the user’s field of view with a soft vignette while a locomotion provider is moving or turning the rig, to reduce motion sickness.

The vignette reacts to every ILocomotionProvider registered with its LocomotionSystem whose ILocomotionProvider.LocomotionPhase is not MAGES.LocomotionPhase.Idle for at least LocomotionVignetteSettings.MinimumDuration, so it works with any combination of SmoothMovementProvider, SmoothTurnProvider or custom providers, without them knowing about it. Locomotions that are over in an instant, like the ones of the SnapTurnProvider, are ignored by default.

Everything it needs to render is created on demand as a hidden child of the rig’s head camera and is drawn by that camera only.

Properties

LocomotionSystem LocomotionSystem

Gets or sets the locomotion system whose providers trigger the vignette. If null, every active locomotion provider triggers it.

LocomotionVignetteSettings Settings

Gets or sets the default look and timing of the vignette, used for every provider without an entry in ProviderOverrides.

List<ProviderOverride> ProviderOverrides

Gets or sets the providers that use their own settings, or do not trigger the vignette at all. When several providers move the rig at the same time, the one with the smallest aperture wins.

Material Material

Gets or sets the material the vignette is drawn with. Leave empty to use the default one that ships with the SDK.

Camera TargetCamera

Gets or sets the camera the vignette is drawn for. Leave empty to use the head camera of the rig.

float Intensity

Gets the current strength of the vignette, from 0 (not visible) to 1 (fully applied).

bool IsVisible

Gets a value indicating whether the vignette is currently visible.

Methods

void Pulse(LocomotionVignetteSettings settings = null)

Shows the vignette as if a locomotion had just happened, e.g. to accompany a teleport.

Parameters:

settings

The settings to use. null uses Settings.