Vixen
02b45cc4
csharp
public struct AudioSpatial

Makes an AudioSource a thing in the world rather than a sound in the room.

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

Remarks

Its presence is the switch: an entity with this component is spatialised, and one without it is not. That makes "is this sound positional" an archetype question rather than a boolean the mixer has to read per voice, and it means a UI click does not carry sixty bytes of cone and doppler settings it will never use.

Position comes from WorldTransform and never from here, so a sound moves because the thing making it moved.

Fields and properties (14)

  • public float MinDistance

    The distance at which it plays at full volume.

  • public float MaxDistance

    Where it stops getting quieter.

  • public AttenuationModel Attenuation

    Which curve it follows.

  • public float RolloffFactor

    How hard that curve bites.

  • public float ConeInnerAngle

    The full angle, in degrees, inside which it is at full volume. 360 means no cone.

  • public float ConeOuterAngle

    The full angle, in degrees, outside which it is at ConeOuterGain.

  • public float ConeOuterGain

    How loud it is outside the cone.

  • public float DopplerFactor

    How much pitch shift movement causes. Zero switches doppler off.

  • public float Spread

    How big the source is, from a point at 0 to everywhere at 1.

  • public bool AutoVelocity

    Whether the system works velocity out from how far the entity moved.

  • public Vector3 Velocity

    How fast it is moving, in units a second.

  • public Vector3 PreviousPosition

    Where it was last frame, for AutoVelocity. Owned by the system.

  • public bool HasPreviousPosition

    Whether PreviousPosition means anything yet.

  • public static AudioSpatial Default

    A point source with an inverse rolloff from one unit, no cone, and doppler on.

Methods (1)

Used by (8)

  • AudioEventSystemTestsVixen.Audio.Tests
  • AudioSystemVixen.Audio
  • AudioSystemTestsVixen.Audio.Tests
  • ComponentRegistrationVixen.Audio
  • TypeRegistrationVixen.Audio
  • Vixen_Audio_Ecs_AudioSpatialSerializerVixen.Audio
  • ComponentTestsVixen.Editor.App.Tests
  • MaterialIconsVixen.Editor.App