Emitter
Read more about creating and customising emitters here: Emitters.
public class Emitter
{
// Adds an emitter to this emitter's target list The target emitter to add
public void AddTarget(Emitter target);
// Indicates whether this Emitter's EAX is blended to produced grouped EAX. Set this to false for listener emitters
public bool AffectsGroupedEAX = true;
// Updates the custom formula for calculating ambient gain percentages. This is invoked for both low-frequency and high-frequency energy. Set to null to use the default formula. Parameters: (int ambientPermeationRayCount, int ambientPermeationBounceCount, float permeationEnergy) Returns: float
public Func<int, int, float, float> AmbientGainFormula;
// Number of bounces in each ambient permeation trail
public int AmbientPermeationBounceCount;
// True if both AmbientPermeationRayCount and AmbientPermeationBounceCount are greater than zero
public bool AmbientPermeationEnabled;
// High-frequency ambient gain, based on how much ambient energy permeated through the environment towards this emitter. Ranges from 0.0 to 1.0
public float AmbientPermeationGainHF;
// Low-frequency ambient gain, based on how much ambient energy permeated through the environment towards this emitter. Ranges from 0.0 to 1.0
public float AmbientPermeationGainLF;
// Number of ambient permeation rays cast
public int AmbientPermeationRayCount;
// Whether to clamp this emitter's position to the world bounds, to prevent it from going out of bounds
public bool ClampPosition;
// EAX reverb properties for the listener. Contains parameters compatible with EAX reverb effects
public EAXReverbResults EAX;
// The lower bound of the reverb pan directional blend range. Reverb pan is calculated by averaging the directions of all bounce rays reaching the listener. If the magnitude of this averaged direction vector is below this threshold, the reverb is considered fully diffuse and the EAX pan vector will have length 0 (reverb heard equally in all directions). Above this threshold, the pan begins blending toward directional.
public float EAXPanInnerThreshold = 0.6f;
// The upper bound of the reverb pan directional blend range. If the magnitude of the averaged bounce ray direction vector exceeds this threshold, the reverb is considered fully directional and the EAX pan vector will have length 1 (reverb heard from a specific direction). Between EAXPanInnerThreshold and this value, the pan magnitude is interpolated from 0 to 1.
public float EAXPanOuterThreshold = 0.8f;
// The length (in milliseconds) of each entry in the echogram. 10ms is recommended.
public int EchogramGranularity;
// Updates the custom formula for calculating this emitter's gain when it is the target of another emitter. This is invoked for both low-frequency and high-frequency energy. Set to null to use the default formula. Parameters: (int type, int occlusionRayCount, int permeationRayCount, float occlusionEnergy, float permeationEnergy) Returns: float
public Func<bool, int, int, int, float, float, float> GainFormula;
// Get the filter containing the LF and HF gain for a target emitter, to be applied to a low pass filter. Only access when HasRaytracedTarget(Emitter) is true.
public LowPassFilter GetTargetFilter(Emitter target);
// Represents how similar the target's reverb environment is to this emitter's. A value of 1.0 means identical reverb environment (fully wet), 0.0 means completely different (fully dry). Apply this to a low pass filter that only affects the wet signal of the reverb effect. Only access when HasRaytracedTarget(Emitter) is true.
public float GetTargetReverbWetness(Emitter target);
// Index indicating which GroupedEAX reverb effect should be used for this emitter
public int GroupedEAXIndex = -1;
// Returns whether a target emitter has been raytraced. If true, it is safe to check the filter and reverb wetness of the target.
public bool HasRaytracedTarget(Emitter target);
// Whether to calculate reverb pan for this emitter
public bool HasReverbPan;
// Returns whether the target emitter is in this emitter's target list
public bool HasTarget(Emitter target);
// True if this emitter hasn't cast its own rays yet.
public bool Initialising = true;
// A custom logging callback. Defaults to WriteLine()
public Action<string> LogCallback;
// A custom logging callback. Defaults to Error.WriteLine()
public Action<string> LogErrorCallback;
// How long (in milliseconds) the echogram records data for. Returning reverb rays after this period will be ignored.
public int MaxEchogramTime;
// The threshold below which permeation rays are cancelled to prevent unnecessary traversal. Clamped to minimum of 0
public float MinimumPermeationEnergy;
// User-defined name of this emitter
public string Name;
// Number of bounces in each occlusion trail
public int OcclusionBounceCount;
// True if both OcclusionRayCount and OcclusionBounceCount are greater than zero
public bool OcclusionEnabled;
// Number of occlusion rays cast
public int OcclusionRayCount;
// A callback that is invoked when each other emitter raytraces this emitter for the first time. The first argument is the other emitter that raytraced this emitter.
public Action<Emitter> OnRaytracedByAnotherEmitter;
// A callback that is invoked after this emitter casts its rays for the first time.
public Action OnRaytracingComplete;
// When defined, rays will be cast out of these positions rather than the default Position. Do not edit this array once set - you must provide an entire new array each time.
public Vector3F[] OverridePositions;
// When defined, rays will be cast in these directions rather than the default. Do not edit this array once set - you must provide an entire new array each time.
public Vector3F[] OverrideRayDirections;
// Number of bounces in each permeation trail
public int PermeationBounceCount;
// True if both PermeationRayCount and PermeationBounceCount are greater than zero
public bool PermeationEnabled;
// Number of permeation rays cast
public int PermeationRayCount;
// An interface that returns the 3D position for this emitter. This will be invoked when Update is called
public IPosition Position = Vector3F.Zero;
// Contains reverb data that has been transformed into more usable parameters
public ProcessedReverbResults ProcessedReverb;
// Raw reverb properties calculated directly from raytracing
public RawReverbResults RawReverb;
// Set this to true to refresh ray directions after modifying a RayDirectionHelperSettings setting
public bool RayDirectionsDirty;
// The number of trails that are rebuilt from scratch each frame to prevent staleness when the listener moves. Clamped to minimum of 0.
public int RefreshRayCount;
// Removes an emitter from this emitter's target list The target emitter to remove
public void RemoveTarget(Emitter target);
// The number of emitters that are allocated ahead of time, to prevent runtime allocations. Clamped to minimum of 0
public int ReservedEmitterTargets;
// Number of bounces in each reverb trail
public int ReverbBounceCount;
// True if both ReverbRayCount and ReverbBounceCount are greater than zero
public bool ReverbEnabled;
// The amount of returning energy required for reverb to be at maximum volume. Defaults to 100. Must adjust this setting if adjusting reverb ray and bounce counts.
public float ReverbEnergyCap;
// Number of reverb rays cast
public int ReverbRayCount;
// Number of bounces per trail
public int TrailBounceCount;
// Number of trails this emitter will create
public int TrailCount;
// User-defined type for this emitter
public int Type;
// Validates this emitter's configuration
public virtual void Validate();
// Number of times each visualisation ray bounces
public int VisualisationBounceCount;
// True if both VisualisationRayCount and VisualisationBounceCount are greater than zero
public bool VisualisationEnabled;
// Number of visualisation rays cast
public int VisualisationRayCount;
// Callback that is invoked with VisualisationData for each bounce produced by an emitter's visualisation rays. Do not modify the array or access it outside this callback.
public Action<VisualisationData[]> VisualisationUpdateCallback;
// How often - in milliseconds - to cast visualisation rays
public int VisualisationUpdateFrequency;
// Emitters outside the world bounds will not be raytraced. Set ClampPosition to true to keep this emitter inside the world bounds
public bool WithinWorldBounds;
}