Drag[en]gine Script Module DragonScript
1.23
|
Sound level meter Resource. More...
Public Member Functions | |
Constructors | |
SoundLevelMeter | new () |
Create sound level meter. More... | |
Management | |
SoundLevelMeterType | getType () |
Type. More... | |
void | setType (SoundLevelMeterType type) |
Set type. More... | |
DVector | getPosition () |
Position. More... | |
void | setPosition (DVector position) |
Set position. More... | |
Quaternion | getOrientation () |
Orientation. More... | |
void | setOrientation (Quaternion orientation) |
Set orientation. More... | |
float | getConeAngle () |
Cone angle in radians measured from cone center to outer hull. More... | |
void | setConeAngle (float angle) |
Set cone angle in radians measured from cone center to outer hull. More... | |
float | getAudibleDistance () |
Audible distance in meters. More... | |
void | setAudibleDistance (float audibleDistance) |
Set audible distance in meters. More... | |
LayerMask | getLayerMask () |
Layer mask. More... | |
void | setLayerMask (LayerMask layerMask) |
Set layer mask. More... | |
bool | getEnabled () |
Measuring is enabled. More... | |
void | setEnabled (bool enabled) |
Set if measuring is enabled. More... | |
int | getAudibleSpeakerCount () |
Number of audible speakers. More... | |
SoundLevelMeterSpeaker | getAudibleSpeakerAt (int index) |
Audible speaker at index. More... | |
SoundLevelMeterListener | getListener () |
Sound level meter listener or null if not set. More... | |
void | setListener (SoundLevelMeterListener listener) |
Set sound level meter listener or null if not set. More... | |
Sound level meter Resource.
Sound level meters are sensors to measure the sound level present in a specific spot in the game world. The meter also stores a list of all speakers contributing to the sound level. Sound level meters allow adding sound sensing capabilities to game entities.
To use a sound level meter place the resource in the game world and set the desired audible range and directivity. The audio module updates the metering results as soon as possible. This can happen the next frame or a couple of frames later depending on how the audio module operates internally.
Sound level meters are only affected by speakers and components matching the layer mask set in the meter. Furthermore meters can be enabled and disabled to stop measuring while not in use without needing to remove and add the meter from the game all the time.
This is a native class.
float Dragengine.Scenery.SoundLevelMeter.getAudibleDistance | ( | ) |
Audible distance in meters.
SoundLevelMeterSpeaker Dragengine.Scenery.SoundLevelMeter.getAudibleSpeakerAt | ( | int | index | ) |
Audible speaker at index.
int Dragengine.Scenery.SoundLevelMeter.getAudibleSpeakerCount | ( | ) |
Number of audible speakers.
float Dragengine.Scenery.SoundLevelMeter.getConeAngle | ( | ) |
Cone angle in radians measured from cone center to outer hull.
bool Dragengine.Scenery.SoundLevelMeter.getEnabled | ( | ) |
Measuring is enabled.
LayerMask Dragengine.Scenery.SoundLevelMeter.getLayerMask | ( | ) |
Layer mask.
SoundLevelMeterListener Dragengine.Scenery.SoundLevelMeter.getListener | ( | ) |
Sound level meter listener or null if not set.
Quaternion Dragengine.Scenery.SoundLevelMeter.getOrientation | ( | ) |
Orientation.
DVector Dragengine.Scenery.SoundLevelMeter.getPosition | ( | ) |
Position.
SoundLevelMeterType Dragengine.Scenery.SoundLevelMeter.getType | ( | ) |
Type.
SoundLevelMeter Dragengine.Scenery.SoundLevelMeter.new | ( | ) |
Create sound level meter.
void Dragengine.Scenery.SoundLevelMeter.setAudibleDistance | ( | float | audibleDistance | ) |
Set audible distance in meters.
void Dragengine.Scenery.SoundLevelMeter.setConeAngle | ( | float | angle | ) |
Set cone angle in radians measured from cone center to outer hull.
void Dragengine.Scenery.SoundLevelMeter.setEnabled | ( | bool | enabled | ) |
Set if measuring is enabled.
void Dragengine.Scenery.SoundLevelMeter.setLayerMask | ( | LayerMask | layerMask | ) |
Set layer mask.
void Dragengine.Scenery.SoundLevelMeter.setListener | ( | SoundLevelMeterListener | listener | ) |
Set sound level meter listener or null if not set.
void Dragengine.Scenery.SoundLevelMeter.setOrientation | ( | Quaternion | orientation | ) |
Set orientation.
void Dragengine.Scenery.SoundLevelMeter.setPosition | ( | DVector | position | ) |
Set position.
void Dragengine.Scenery.SoundLevelMeter.setType | ( | SoundLevelMeterType | type | ) |
Set type.