public struct AudioSpatialMakes 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 MinDistanceThe distance at which it plays at full volume.
public float MaxDistanceWhere it stops getting quieter.
public AttenuationModel AttenuationWhich curve it follows.
public float RolloffFactorHow hard that curve bites.
public float ConeInnerAngleThe full angle, in degrees, inside which it is at full volume. 360 means no cone.
public float ConeOuterAngleThe full angle, in degrees, outside which it is at ConeOuterGain.
public float ConeOuterGainHow loud it is outside the cone.
public float DopplerFactorHow much pitch shift movement causes. Zero switches doppler off.
public float SpreadHow big the source is, from a point at 0 to everywhere at 1.
public bool AutoVelocityWhether the system works velocity out from how far the entity moved.
public Vector3 VelocityHow fast it is moving, in units a second.
public Vector3 PreviousPositionWhere it was last frame, for AutoVelocity. Owned by the system.
public bool HasPreviousPositionWhether PreviousPosition means anything yet.
public static AudioSpatial DefaultA point source with an inverse rolloff from one unit, no cone, and doppler on.
Methods (1)
public readonly SpatialSettings ToSettings(Vector3 position, Vector3 coneDirection)These settings, at a position, as the mixer wants them.
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