vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::PlaySoundEvent Struct Reference

A request to hear a clip once, from gameplay that owns no entity for it. More...

#include <audio_events.h>

Static Public Member Functions

static PlaySoundEvent at (AudioClipHandle clip, const glm::vec3 &position, float volume=1.0f)
 A request to hear clip once, from position.

Detailed Description

A request to hear a clip once, from gameplay that owns no entity for it.

For when no AudioSource fits: a sound on an entity about to go, or one that must overlap itself. There is no id, so it cannot be stopped or moved; loop is ignored. A request made during Simulation is heard the same frame; at the voice ceiling it is dropped.

events().emit(PlaySoundEvent::at(m_chime, transform->position));

Member Function Documentation

◆ at()

PlaySoundEvent Vkm::Engine::PlaySoundEvent::at ( AudioClipHandle clip,
const glm::vec3 & position,
float volume = 1.0f )
inlinestatic

A request to hear clip once, from position.

Parameters
clipClip to play; an invalid handle is heard as nothing.
positionWhere it sounds from, in world space.
volumeLinear gain, multiplied into the master.
Returns
The request, spatial, with every other parameter at its default.

The documentation for this struct was generated from the following file: