Table of Contents

Wwise SDK 2019.2.6
AkSpatialAudio.h
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24 Version: <VERSION> Build: <BUILDNUMBER>
25 Copyright (c) <COPYRIGHTYEAR> Audiokinetic Inc.
26 *******************************************************************************/
27 
28 /// \file
29 /// Spatial Audio interface.
30 
31 #pragma once
32 
33 #include <AK/SpatialAudio/Common/AkSpatialAudioTypes.h>
34 #include <AK/Plugin/AkReflectGameData.h>
35 #include <AK/SoundEngine/Common/AkSoundEngine.h>
36 
37 template<AkUInt32 TSize>
39 {
40  static AkUInt32 GrowBy(AkUInt32 /*in_CurrentArraySize*/) { return TSize; }
41 };
42 
43 /// AkDiffractionFlags determine if diffraction values for sound passing through portals will be calculated, and how to apply those calculations to Wwise parameters.
44 enum AkDiffractionFlags
45 {
46  DiffractionFlags_UseBuiltInParam = 1 << 0, ///< Set the Wwise built-in game parameter value for diffraction angle. This is a flexible approach that can be mapped to any Wwise parameter. Can also be used simply to monitor diffraction using the game object profiler in Wwise.
47  DiffractionFlags_UseObstruction = 1 << 1, ///< Use Wwise obstruction for dry-path diffraction. Dry-path diffraction is related to the angle off of a straight line of sight to a sound emitter.
48  DiffractionFlags_CalcEmitterVirtualPosition = 1 << 3, ///< An emitter that is not in the same room as the listener will have its apparent or virtual position calculated by Wwise spatial audio and passed on to the sound engine.
49 
50  DefaultDiffractionFlags = DiffractionFlags_UseBuiltInParam | DiffractionFlags_UseObstruction | DiffractionFlags_CalcEmitterVirtualPosition
51 };
52 
53 /// Initialization settings of the spatial audio module.
55 {
57  : uMaxSoundPropagationDepth(AK_MAX_SOUND_PROPAGATION_DEPTH)
58  , uDiffractionFlags((AkUInt32)DefaultDiffractionFlags)
59  , fDiffractionShadowAttenFactor(AK_DEFAULT_DIFFR_SHADOW_ATTEN)
60  , fDiffractionShadowDegrees(AK_DEFAULT_DIFFR_SHADOW_DEGREES)
61  , fMovementThreshold(AK_DEFAULT_MOVEMENT_THRESHOLD)
64  , fMaxPathLength(10000.0f)
67  , bEnableTransmission(true)
68  {}
69 
70  AkUInt32 uMaxSoundPropagationDepth; ///< Maximum number of portals that sound can propagate through; must be less than or equal to AK_MAX_SOUND_PROPAGATION_DEPTH.
71  AkUInt32 uDiffractionFlags; ///< Enable or disable specific diffraction features. See AkDiffractionFlags.
72  AkReal32 fDiffractionShadowAttenFactor; ///< Multiplier that is applied to the distance attenuation of diffracted sounds (sounds that are in the 'shadow region') to simulate the phenomenon where by diffracted sound waves decay faster than incident sound waves.
73  AkReal32 fDiffractionShadowDegrees; ///< Interpolation angle, in degrees, over which the fDiffractionShadowAttenFactor is applied.
74  ///< At a diffraction of 0, a multiplier of 1 (ie. none) is applied, and at an angle of fDiffractionShadowDegrees or greater, fDiffractionShadowAttenFactor is applied.
75  ///< A linear interpolation between 1 and fDiffractionShadowAttenFactor is applied when the angle is between 0 and fDiffractionShadowDegrees.
76 
77  AkReal32 fMovementThreshold; ///< Amount that an emitter or listener has to move to trigger a recalculation of reflections/diffraction. Larger values can reduce the CPU load at the cost of reduced accuracy.
78 
79  AkUInt32 uNumberOfPrimaryRays; ///< The number of primary rays used in stochastic ray casting
80  AkUInt32 uMaxReflectionOrder; ///< Maximum reflection order [1, 4] - the number of 'bounces' in a reflection path. A higher reflection order renders more details at the expense of higher CPU usage.
81  AkReal32 fMaxPathLength; ///< The length of rays that are cast inside Spatial Audio. This effectively caps the maximum length of individual segments in reflection or diffraction paths.
82  ///< Each individual sound is also affected by its maximum attenuation distance, specified in the Authoring tool. Reflection or diffraction paths, calculated inside Spatial Audio, will never exceed a sound's maximum attenuation distance.
83  ///< Note, however, that attenuation is considered infinite if the furthest point is above the audibility threshold.
84  bool bEnableDiffractionOnReflection; ///< Enable diffraction at the end/beginning of reflection paths. Diffraction on reflection causes reflections to fade in and out smoothly as the listener or emitter move in and out of the reflection's shadow zone.
85  bool bEnableDirectPathDiffraction; ///< Enable computation of geometric direct path diffraction for all sources that have diffraction enabled in the positioning tab of the authoring tab.
86  ///< This flag enables sounds to diffract around geometry (see \c AK::SpatialAudio::SetGeometry) that have diffraction edges.
87  ///< Diffraction edges must be enabled for sounds to diffract around geometry (see \c AkGeometryParams).
88  ///< If \c bEnableDirectPathDiffraction is false but a sound has "Enable Diffraction" ticked in the positioning tab of the authoring tool, the sound will only diffract through portals but pass through geometry as if it is not there.
89  bool bEnableTransmission; ///< Enable modeling of transmission of sound through walls.
90 };
91 
92 // Settings for individual image sources.
94 {
96 
97  AkImageSourceSettings(AkVector in_sourcePosition, AkReal32 in_fDistanceScalingFactor, AkReal32 in_fLevel)
98  : params(in_sourcePosition, in_fDistanceScalingFactor, in_fLevel)
99  , texture()
100  , name()
101  {
102  }
103 
105  {
106  name.Term();
107  }
108 
109  /// Operator =
111  {
112  params = src.params;
113  texture = src.texture;
114  name = src.name;
115  name.AllocCopy();
116  return *this;
117  }
118 
119  void SetOneTexture(AkUniqueID in_texture)
120  {
121  texture.uNumTexture = 1;
122  texture.arTextureID[0] = in_texture;
123  }
124 
125  void SetName(const char* in_pName)
126  {
127  name = in_pName;
128  name.AllocCopy();
129  }
130 
131  /// Image source parameters.
133 
134  /// Acoustic texture that goes with this image source.
136 
137  /// Name given to image source, can be used to identify the image source in the AK Reflect plugin UI.
139 };
140 
141 /// Vertex for a spatial audio mesh.
142 struct AkVertex
143 {
144  /// Constructor
145  AkVertex() : X(0.f), Y(0.f), Z(0.f) {}
146 
147  /// Constructor
148  AkVertex(AkReal32 in_X, AkReal32 in_Y, AkReal32 in_Z) : X(in_X), Y(in_Y), Z(in_Z) {}
149 
150  AkReal32 X; ///< X coordinate
151  AkReal32 Y; ///< Y coordinate
152  AkReal32 Z; ///< Z coordinate
153 };
154 
155 /// Triangle for a spatial audio mesh.
156 struct AkTriangle
157 {
158  /// Constructor
159  AkTriangle() : point0(AK_INVALID_VERTEX)
160  , point1(AK_INVALID_VERTEX)
161  , point2(AK_INVALID_VERTEX)
162  , surface(AK_INVALID_SURFACE)
163  {}
164 
165  /// Constructor
166  AkTriangle(AkVertIdx in_pt0, AkVertIdx in_pt1, AkVertIdx in_pt2, AkSurfIdx in_surfaceInfo)
167  : point0(in_pt0)
168  , point1(in_pt1)
169  , point2(in_pt2)
170  , surface(in_surfaceInfo)
171  {}
172 
173  /// Index into the vertex table passed into \c AkGeometryParams that describes the first vertex of the triangle. Triangles are double-sided, so vertex order in not important.
174  AkVertIdx point0;
175 
176  /// Index into the vertex table passed into \c AkGeometryParams that describes the second vertex of the triangle. Triangles are double-sided, so vertex order in not important.
177  AkVertIdx point1;
178 
179  /// Index into the vertex table passed into \c AkGeometryParams that describes the third vertex of the triangle. Triangles are double-sided, so vertex order in not important.
180  AkVertIdx point2;
181 
182  /// Index into the surface table passed into \c AkGeometryParams that describes the surface properties of the triangle.
183  /// If this field is left as \c AK_INVALID_SURFACE, then a default-constructed \c AkAcousticSurface is used.
184  AkSurfIdx surface;
185 };
186 
187 /// Describes the acoustic surface properties of one or more triangles.
188 /// An single acoustic surface may describe any number of triangles, depending on the granularity desired. For example, if desired for debugging, one could create a unique
189 /// \c AkAcousticSurface struct for each triangle, and define a unique name for each. Alternatively, a single \c AkAcousticSurface could be used to describe all triangles.
190 /// In fact it is not necessary to define any acoustic surfaces at all. If the \c AkTriangle::surface field is left as \c AK_INVALID_SURFACE, then a default-constructed \c AkAcousticSurface is used.
192 {
193  /// Constructor
194  AkAcousticSurface(): textureID(AK_INVALID_UNIQUE_ID)
195  , occlusion(1.0f)
196  , strName(NULL)
197  {}
198 
199  /// Acoustic texture ShareSet ID for the surface. The acoustic texture is authored in Wwise, and the shareset ID may be obtained by calling \c AK::SoundEngine::GetIDFromString
200  /// \sa <tt>\ref AK::SoundEngine::GetIDFromString()</tt>
201  AkUInt32 textureID;
202 
203  /// Occlusion value to set when modeling sound transmission through geometry. Transmission is modeled only when the sound emitted enables diffraction and there is no direct line of sight from the emitter to the listener.
204  /// If more that one surface is between the emitter and the listener, the maximum of each surface's occlusion value is used. If the emitter and listener are in different rooms, then the rooms' WallOcclusion is taken into account.
205  /// The maximum of all the surfaces' occlusion value, and the WallOcclusion value (see \c AkRoomParams) is used to render the transmission path.
206  /// Valid range: (0.f-1.f)
207  /// - \ref AkRoomParams
208  AkReal32 occlusion;
209 
210  /// Name to describe this surface
211  const char* strName;
212 };
213 
214 /// Structure for retrieving information about the indirect paths of a sound that have been calculated via the geometric reflections API. Useful for debug draw applications.
216 {
217  /// Apparent source of the reflected sound that follows this path.
219 
220  /// Vertices of the indirect path.
221  /// pathPoint[0] is closest to the emitter, pathPoint[numPathPoints-1] is closest to the listener.
222  AkVector pathPoint[AK_MAX_REFLECTION_PATH_LENGTH];
223 
224  /// The surfaces that were hit in the path.
225  /// surfaces[0] is closest to the emitter, surfaces[numPathPoints-1] is closest to the listener.
226  AkAcousticSurface surfaces[AK_MAX_REFLECTION_PATH_LENGTH];
227 
228  /// Number of valid elements in the \c pathPoint[], \c surfaces[], and \c diffraction[] arrays.
229  AkUInt32 numPathPoints;
230 
231  /// Number of reflections in the \c pathPoint[] array. Shadow zone diffraction does not count as a reflection. If there is no shadow zone diffraction, \c numReflections is equal to \c numPathPoints.
232  AkUInt32 numReflections;
233 
234  /// Diffraction amount, normalized to the range [0,1]
235  AkReal32 diffraction[AK_MAX_REFLECTION_PATH_LENGTH];
236 
237  /// Linear gain applied to image source.
238  AkReal32 level;
239 
240  /// True if the sound path was occluded. Note that the spatial audio library must be recompiled with \c \#define AK_DEBUG_OCCLUSION to enable generation of occluded paths.
242 };
243 
244 /// Structure for retrieving information about diffraction paths for a given emitter.
245 /// The diffraction paths represent indirect sound paths from the emitter to the listener, whether they go through portals
246 /// (via the rooms and portals API) or are diffracted around edges (via the geometric diffraction API).
248 {
249  /// Defines the maximum number of nodes that a user can retrieve information about. Longer paths will be truncated.
250  static const AkUInt32 kMaxNodes = AK_MAX_SOUND_PROPAGATION_DEPTH;
251 
252  /// Diffraction points along the path. nodes[0] is the point closest to the listener; nodes[numNodes-1] is the point closest to the emitter.
253  /// Neither the emitter position nor the listener position are represented in this array.
255 
256  /// Raw diffraction angles at each point, in radians.
257  AkReal32 angles[kMaxNodes];
258 
259  /// ID of the portals that the path passes through. For a given node at position i (in the nodes array), if the path diffracts on a geometric edge, then portals[i] will be an invalid portal ID (ie. portals[i].IsValid() will return false).
260  /// Otherwise, if the path diffracts through a portal at position i, then portals[i] will be the ID of that portal.
261  /// portal[0] represents the node closest to the listener; portal[numNodes-1] represents the node closest to the emitter.
263 
264  /// ID's of the rooms that the path passes through. For a given node at position i, room[i] is the room on the listener's side of the node. If node i diffracts through a portal,
265  /// then rooms[i] is on the listener's side of the portal, and rooms[i+1] is on the emitters side of the portal.
266  /// There is always one extra slot for a room so that the emitters room is always returned in slot room[numNodes] (assuming the path has not been truncated).
268 
269  /// Virtual emitter position. This is the position that is passed to the sound engine to render the audio using multi-positioning, for this particular path.
271 
272  /// Total number of nodes in the path. Defines the number of valid entries in the \c nodes, \c angles, and \c portals arrays. The \c rooms array has one extra slot to fit the emitter's room.
273  AkUInt32 nodeCount;
274 
275  /// Calculated total diffraction from this path, normalized to the range [0,1]
276  /// The diffraction amount is calculated from the sum of the deviation angles from a straight line, of all angles at each nodePoint.
277  // Can be thought of as how far into the 'shadow region' the sound has to 'bend' to reach the listener.
278  /// Depending on the spatial audio initialization settings, this value is applied internally, by spatial audio, to the obstruction or built-in parameter of the emitter game object.
279  /// \sa
280  /// - \ref AkDiffractionFlags
281  /// - \ref AkSpatialAudioInitSettings
282  AkReal32 diffraction;
283 
284  /// Total path length
285  /// Represents the sum of the length of the individual segments between nodes, with a correction factor applied for diffraction.
286  /// The correction factor simulates the phenomenon where by diffracted sound waves decay faster than incident sound waves and can be customized in the spatial audio init settings.
287  /// \sa
288  /// - \ref AkSpatialAudioInitSettings
289  AkReal32 totLength;
290 
291  /// Obstruction value for this path
292  /// This value includes the accumulated portal obstruction for all portals along the path.
294 };
295 
296 /// Parameters passed to \c SetPortal
298 {
299  /// Constructor
301  bEnabled(false)
302  {}
303 
304  /// Portal's position and orientation in the 3D world.
305  /// Position vector is the center of the opening.
306  /// OrientationFront vector must be unit-length and point along the normal of the portal, and must be orthogonal to Up. It defines the local positive-Z dimension (depth/transition axis) of the portal, used by Extent.
307  /// OrientationTop vector must be unit-length and point along the top of the portal (tangent to the wall), must be orthogonal to Front. It defines the local positive-Y direction (height) of the portal, used by Extent.
309 
310  /// Portal extent. Defines the dimensions of the portal relative to its center; all components must be positive numbers. The local X and Y dimensions (side and top) are used in diffraction calculations,
311  /// whereas the Z dimension (front) defines a depth value which is used to implement smooth transitions between rooms. It is recommended that users experiment with different portal depths to find a value
312  /// that results in appropriately smooth transitions between rooms.
314 
315  /// Whether or not the portal is active/enabled. For example, this parameter may be used to simulate open/closed doors.
316  /// Portal diffraction is simulated when at least one portal exists and is active between an emitter and the listener.
317  /// Diffraction uses obstruction or the diffraction built-in game parameter, while transmission uses occlusion.
318  bool bEnabled;
319 
320  /// Name used to identify portal (optional).
322 
323  /// ID of the room to which the portal connects, in the direction of the Front vector. If a room with this ID has not been added via AK::SpatialAudio::SetRoom,
324  /// a room will be created with this ID and with default AkRoomParams. If you would later like to update the AkRoomParams, simply call AK::SpatialAudio::SetRoom again with this same ID.
325  /// - \ref AK::SpatialAudio::SetRoom
326  /// - \ref AK::SpatialAudio::RemoveRoom
327  /// - \ref AkRoomParams
329 
330  /// ID of the room to which the portal connects, in the direction opposite to the Front vector. If a room with this ID has not been added via AK::SpatialAudio::SetRoom,
331  /// a room will be created with this ID and with default AkRoomParams. If you would later like to update the AkRoomParams, simply call AK::SpatialAudio::SetRoom again with this same ID.
332  /// - \ref AK::SpatialAudio::SetRoom
333  /// - \ref AK::SpatialAudio::RemoveRoom
334  /// - \ref AkRoomParams
336 };
337 
338 /// Parameters passed to \c SetRoom
340 {
341  /// Constructor
342  AkRoomParams() : ReverbAuxBus(AK_INVALID_AUX_ID)
343  , ReverbLevel(1.f)
344  , WallOcclusion(1.f)
347 
348  {
349  Up.X = 0.f;
350  Up.Y = 1.f;
351  Up.Z = 0.f;
352  Front.X = 0.f;
353  Front.Y = 0.f;
354  Front.Z = 1.f;
355  }
356 
357  /// Copy Constructor
358  AkRoomParams(const AkRoomParams& in_rhs)
359  : Up(in_rhs.Up)
360  , Front(in_rhs.Front)
361  , ReverbAuxBus(in_rhs.ReverbAuxBus)
362  , ReverbLevel(in_rhs.ReverbLevel)
363  , WallOcclusion(in_rhs.WallOcclusion)
364  , strName(in_rhs.strName)
367  {
368  strName.AllocCopy();
369  }
370 
371  /// Assignment operator</span>
373  {
374  Up = in_rhs.Up;
375  Front = in_rhs.Front;
376  ReverbAuxBus = in_rhs.ReverbAuxBus;
377  ReverbLevel = in_rhs.ReverbLevel;
378  WallOcclusion = in_rhs.WallOcclusion;
379 
380  strName = in_rhs.strName;
381  strName.AllocCopy();
382 
385 
386  return *this;
387  }
388 
389  /// Room Orientation. Up and Front must be orthonormal.
390  /// Room orientation has an effect when the associated aux bus (see ReverbAuxBus) is set with 3D Spatialization in Wwise, as 3D Spatialization implements relative rotation of the emitter (room) and listener.
393 
394  /// The reverb aux bus that is associated with this room.
395  /// When Spatial Audio is told that a game object is in a particular room via SetGameObjectInRoom, a send to this aux bus will be created to model the reverb of the room.
396  /// Using a combination of Rooms and Portals, Spatial Audio manages which game object the aux bus is spawned on, and what control gain is sent to the bus.
397  /// When a game object is inside a connected portal, as defined by the portal's orientation and extent vectors, both this aux send and the aux send of the adjacent room are active.
398  /// Spatial audio modulates the control value for each send based on the game object's position, in relation to the portal's z-azis and extent, to crossfade the reverb between the two rooms.
399  /// If more advanced control of reverb is desired, SetGameObjectAuxSendValues can be used to add additional sends on to a game object.
400  /// - \ref AK::SpatialAudio::SetGameObjectInRoom
401  /// - \ref AK::SoundEngine::SetGameObjectAuxSendValues
402  AkAuxBusID ReverbAuxBus;
403 
404  /// The reverb control value for the send to ReverbAuxBus. Valid range: (0.f-1.f)
405  /// Can be used to implement multiple rooms that share the same aux bus, but have different reverb levels.
406  AkReal32 ReverbLevel;
407 
408  /// Occlusion level to set when modeling transmission through walls. Transmission is modeled only when the sound emitted enables diffraction and there is no direct line of sight from the emitter to the listener.
409  /// This occlusion value is only applied when the listener and the emitter are in different rooms; it is taken as the maximum between the emitter's room's WallOcclusion and the listener's room's WallOcclusion.
410  /// If there is geometry in between the listener and the emitter, then the occlusion value assigned to surfaces hit by the ray between the emitter and listener is also taken into account.
411  /// The maximum of all the surfaces' occlusion value (see \c AkAcousticSurface), and the WallOcclusion value is used to render the transmission path.
412  /// Valid range: (0.f-1.f)
413  /// - \ref AkAcousticSurface
414  AkReal32 WallOcclusion;
415 
416  /// Name used to identify room (optional)
418 
419  /// Send level for sounds that are posted on the room game object; adds reverb to ambience and room tones. Valid range: (0.f-1.f). Set to a value greater than 0 to have spatial audio create a send on the room game object,
420  /// where the room game object itself is specified as the listener and ReverbAuxBus is specified as the aux bus. A value of 0 disables the aux send. This should not be confused with ReverbLevel, which is the send level
421  /// for spatial audio emitters sending to the room game object.
422  /// \aknote The room game object can be accessed though the ID that is passed to \c SetRoom() and the \c AkRoomID::AsGameObjectID() method. Posting an event on the room game object leverages automatic room game object placement
423  /// by spatial audio so that when the listener is inside the room, the sound comes from all around the listener, and when the listener is outside the room, the sound comes from the portal(s). Typically, this would be used for
424  /// surround ambiance beds or room tones. Point source sounds should use separate game objects that are registered as spatial audio emitters.
425  /// \sa
426  /// - \ref AkRoomParams::RoomGameObj_KeepRegistered
427  /// - \ref AkRoomID
429 
430  /// If set to true, the room game object will be registered on calling \c SetRoom(), and not released untill the room is deleted or removed with \c RemoveRoom(). If set to false, spatial audio will register
431  /// the room object only when it is needed by the sound propagation system for the purposes of reverb, and will unregister the game object when all reverb tails have finished.
432  /// If the game intends to post events on the room game object for the purpose of ambiance or room tones, RoomGameObj_KeepRegistered should be set to true.
433  /// \aknote The room game object can be accessed though the ID that is passed to \c SetRoom() and the \c AkRoomID::AsGameObjectID() method. Posting an event on the room game object leverages automatic room game object placement
434  /// by spatial audio so that when the listener is inside the room, the sound comes from all around the listener, and when the listener is outside the room, the sound comes from the portal(s). Typically, this would be used for
435  /// surround ambiance beds or room tones. Point source sounds should use separate game objects that are registered as spatial audio emitters.
436  /// \sa
437  /// - \ref AkRoomParams::RoomGameObj_AuxSendLevelToSelf
438  /// - \ref AkRoomID
440 
441 
442 };
443 
444 /// Parameters passed to \c SetGeometry
446 {
447  /// Constructor
449 
450  /// Pointer to an array of AkTriangle structures.
451  /// This array will be copied into spatial audio memory and will not be accessed after \c SetGeometry returns.
452  /// - \ref AkTriangle
453  /// - \ref AK::SpatialAudio::SetGeometry
454  /// - \ref AK::SpatialAudio::RemoveGeometry
456 
457  /// Number of triangles in Triangles.
458  AkTriIdx NumTriangles;
459 
460  /// Pointer to an array of AkVertex structures.
461  /// This array will be copied into spatial audio memory and will not be accessed after \c SetGeometry returns.
462  /// - \ref AkVertex
463  /// - \ref AK::SpatialAudio::SetGeometry
464  /// - \ref AK::SpatialAudio::RemoveGeometry
466 
467  ///< Number of vertices in Vertices.
468  AkVertIdx NumVertices;
469 
470  ///< Pointer to an array of AkAcousticSurface structures.
471  /// This array will be copied into spatial audio memory and will not be accessed after \c SetGeometry returns.
472  /// - \ref AkVertex
473  /// - \ref AK::SpatialAudio::SetGeometry
474  /// - \ref AK::SpatialAudio::RemoveGeometry
476 
477  /// Number of of AkTriangleInfo structures in in_pTriangleInfo and number of AkTriIdx's in in_infoMap.
478  AkSurfIdx NumSurfaces;
479 
480  /// Associate this geometry set with the room \c RoomID. Associating a geometry set with a particular room will limit the scope in which the geometry is visible/accessible. \c RoomID can be left as default (-1), in which case
481  /// this geometry set will have a global scope. It is recommended to associate geometry with a room when the geometry is (1) fully contained within the room (ie. not visible to other rooms accept by portals),
482  /// and (2) the room does not share geometry with other rooms. Doing so reduces the search space for ray casting performed by reflection and diffraction calculations. Take note that once one or more geometry sets
483  /// are associated with a room, that room will no longer be able to access geometry that is in the global scope.
484  /// - \ref AK::SpatialAudio::SetRoom
485  /// - \ref AkRoomParams
487 
488  /// Switch to enable or disable geometric diffraction for this Geometry.
490 
491  /// Switch to enable or disable geometric diffraction on boundary edges for this Geometry. Boundary edges are edges that are connected to only one triangle.
493 };
494 
495 /// Audiokinetic namespace
496 namespace AK
497 {
498  /// Audiokinetic spatial audio namespace
499  namespace SpatialAudio
500  {
501  ////////////////////////////////////////////////////////////////////////
502  /// @name Basic functions.
503  /// In order to use SpatialAudio, you need to initalize it using Init, and register the listeners that you plan on using with any of the services offered by SpatialAudio, using
504  /// RegisterListener respectively, _after_ having registered their corresponding game object to the sound engine.
505  /// \akwarning At the moment, there can be only one Spatial Audio listener registered at any given time.
506  //@{
507 
508  /// Initialize the SpatialAudio API.
509  AK_EXTERNAPIFUNC(AKRESULT, Init)(const AkSpatialAudioInitSettings& in_initSettings);
510 
511  /// Assign a game object as the Spatial Audio listener. There can be only one Spatial Audio listener registered at any given time; in_gameObjectID will replace any previously set Spatial Audio listener.
512  /// The game object passed in must be registered by the client, at some point, for sound to be heard. It is not necessary to be registered at the time of calling this function.
513  /// If not listener is explicitly registered to spatial audio, then a default listener (set via \c AK::SoundEngine::SetDefaultListeners()) is selected. If the are no default listeners, or there are more than one
514  /// default listeners, then it is necessary to call RegisterListener() to specify which listener to use with Spatial Audio.
515  AK_EXTERNAPIFUNC(AKRESULT, RegisterListener)(
516  AkGameObjectID in_gameObjectID ///< Game object ID
517  );
518 
519  /// Unregister a game object as a listener in the SpatialAudio API; clean up Spatial Audio listener data associated with in_gameObjectID.
520  /// If in_gameObjectID is the current registered listener, calling this function will clear the Spatial Audio listener and
521  /// Spatial Audio features will be disabled until another listener is registered.
522  /// This function is optional - listener are automatically unregistered when their game object is deleted in the sound engine.
523  /// \sa
524  /// - \ref AK::SpatialAudio::RegisterListener
525  AK_EXTERNAPIFUNC(AKRESULT, UnregisterListener)(
526  AkGameObjectID in_gameObjectID ///< Game object ID
527  );
528 
529  //@}
530 
531  ////////////////////////////////////////////////////////////////////////
532  /// @name Helper functions for passing game data to the Wwise Reflect plug-in.
533  /// Use this API for detailed placement of reflection image sources.
534  /// \aknote These functions are low-level and useful when your game engine already implements a geometrical approach to sound propagation such as an image-source or a ray tracing algorithm.
535  /// Functions of Geometry are preferred and easier to use with the Wwise Reflect plug-in. \endaknote
536  //@{
537 
538  /// Add or update an individual image source for processing via the AkReflect plug-in. Use this API for detailed placement of
539  /// reflection image sources, whose positions have been determined by the client, such as from the results of a ray cast, computation or by manual placement. One possible
540  /// use case is generating reflections that originate far enough away that they can be modeled as a static point source, for example, off of a distant mountain.
541  /// The SpatialAudio API manages image sources added via SetImageSource() and sends them to the AkReflect plug-in that is on the aux bus with ID \c in_AuxBusID.
542  /// The image source will apply only to the the game object specified by \c in_gameObjectID.
543  /// SetImageSource takes a room ID to indicate which room the reflection is logically part of, even though the position of the image source may be outside of the extents of the room.
544  /// This ID is used as a filter, so that it is not possible to hear reflections for rooms that the emitter and listener are not both inside. To use this feature, the emitter's and listener's rooms must also be
545  /// specified using SetGameObjectInRoom. If you are not using the rooms and portals API, or the image source is not associated with a room, pass a default-constructed room ID.
546  /// \aknote The \c AkImageSourceSettings struct passed in \c in_info must contain a unique image source ID to be able to identify this image source across frames and when updating and/or removing it later.
547  /// Each instance of AkReflect has its own set of data, so you may reuse ID, if desired, as long as \c in_gameObjectID and \c in_AuxBusID are different.
548  /// \endaknote
549  /// \aknote Early reflection send level and bus in the authoring tool do not apply to image sources set with \c SetImageSource(). When using this function, the Reflect bus and send level
550  /// may only be set programmatically. Also, it is not possible to use the geometric reflections API on the same aux bus and game object. If using the geometric reflections API and the SetImageSource API in conjunction, be sure to specify an
551  /// aux bus to \c SetImageSource that is unique from the aux bus(es) defined in the authoring tool, and from those passed to \c SetEarlyReflectionsAuxSend.
552  /// \endaknote
553  /// \aknote For proper operation with AkReflect and the SpatialAudio API, any aux bus using AkReflect should have 'Listener Relative Routing' checked and the 3D Spatialization set to None in the Wwise authoring tool. See \ref spatial_audio_wwiseprojectsetup_businstances for more details. \endaknote
554  /// \sa
555  /// - \ref AK::SpatialAudio::RemoveImageSource
556  /// - \ref AK::SpatialAudio::ClearImageSources
557  /// - \ref AK::SpatialAudio::SetGameObjectInRoom
558  /// - \ref AK::SpatialAudio::SetEarlyReflectionsAuxSend
559  AK_EXTERNAPIFUNC(AKRESULT, SetImageSource)(
560  AkImageSourceID in_srcID, ///< The ID of the image source being added.
561  const AkImageSourceSettings& in_info, ///< Image source information.
562  AkUniqueID in_AuxBusID, ///< Aux bus that has the AkReflect plug in for early reflection DSP.
563  AkRoomID in_roomID, ///< The ID of the room that the image source is logically a part of; pass a default-constructed ID if not in, or not using, a room.
564  AkGameObjectID in_gameObjectID ///< The ID of the emitter game object to which the image source applies. Must be a valid and registered game object.
565  );
566 
567  /// Remove an individual reflection image source that was previously added via \c SetImageSource.
568  /// \sa
569  /// - \ref AK::SpatialAudio::SetImageSource
570  /// - \ref AK::SpatialAudio::ClearImageSources
571  AK_EXTERNAPIFUNC(AKRESULT, RemoveImageSource)(
572  AkImageSourceID in_srcID, ///< The ID of the image source to remove.
573  AkUniqueID in_AuxBusID, ///< Aux bus that was passed to SetImageSource.
574  AkGameObjectID in_gameObjectID ///< Game object ID that was passed to SetImageSource.
575  );
576 
577  /// Remove all image sources matching \c in_AuxBusID and \c in_gameObjectID that were previously added via \c SetImageSource.
578  /// Both \c in_AuxBusID and \c in_gameObjectID can be treated as wild cards matching all aux buses and/or all game object, by passing \c AK_INVALID_AUX_ID and/or \c AK_INVALID_GAME_OBJECT, respectively.
579  /// \sa
580  /// - \ref AK::SpatialAudio::SetImageSource
581  /// - \ref AK::SpatialAudio::RemoveImageSource
582  AK_EXTERNAPIFUNC(AKRESULT, ClearImageSources)(
583  AkUniqueID in_AuxBusID = AK_INVALID_AUX_ID, ///< Aux bus that was passed to SetImageSource, or AK_INVALID_AUX_ID to match all aux buses.
584  AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT ///< Game object ID that was passed to SetImageSource, or AK_INVALID_GAME_OBJECT to match all game objects.
585  );
586 
587  //@}
588 
589  ////////////////////////////////////////////////////////////////////////
590  /// @name Geometry
591  /// Geometry API for early reflection processing using Wwise Reflect.
592  //@{
593 
594  /// Add or update a set of geometry from the \c SpatialAudio module for geometric reflection and diffaction processing. A geometry set is a logical set of vertices, triangles, and acoustic surfaces,
595  /// which are referenced by the same \c AkGeometrySetID. The ID (\c in_GeomSetID) must be unique and is also chosen by the client in a manner similar to \c AkGameObjectID's.
596  /// \sa
597  /// - \ref AkGeometryParams
598  /// - \ref AK::SpatialAudio::RemoveGeometry
599  AK_EXTERNAPIFUNC(AKRESULT, SetGeometry)(
600  AkGeometrySetID in_GeomSetID, ///< Unique geometry set ID, chosen by client.
601  const AkGeometryParams& in_params ///< Geometry parameters to set.
602  );
603 
604  /// Remove a set of geometry to the SpatialAudio API.
605  /// \sa
606  /// - \ref AK::SpatialAudio::SetGeometry
607  AK_EXTERNAPIFUNC(AKRESULT, RemoveGeometry)(
608  AkGeometrySetID in_SetID ///< ID of geometry set to be removed.
609  );
610 
611  /// Query information about the reflection paths that have been calculated via geometric reflection processing in the SpatialAudio API. This function can be used for debugging purposes.
612  /// This function must acquire the global sound engine lock and therefore, may block waiting for the lock.
613  /// \sa
614  /// - \ref AkReflectionPathInfo
615  AK_EXTERNAPIFUNC(AKRESULT, QueryReflectionPaths)(
616  AkGameObjectID in_gameObjectID, ///< The ID of the game object that the client wishes to query.
617  AkVector& out_listenerPos, ///< Returns the position of the listener game object that is associated with the game object \c in_gameObjectID.
618  AkVector& out_emitterPos, ///< Returns the position of the emitter game object \c in_gameObjectID.
619  AkReflectionPathInfo* out_aPaths, ///< Pointer to an array of \c AkReflectionPathInfo's which will be filled after returning.
620  AkUInt32& io_uArraySize ///< The number of slots in \c out_aPaths, after returning the number of valid elements written.
621  );
622 
623  //@}
624 
625  ////////////////////////////////////////////////////////////////////////
626  /// @name Rooms and Portals
627  /// Sound Propagation API using rooms and portals.
628  //@{
629 
630  /// Add or update a room. Rooms are used to connect portals and define an orientation for oriented reverbs. This function may be called multiple times with the same ID to update the parameters of the room.
631  /// The ID (\c in_RoomID) must be chosen in the same manner as \c AkGameObjectID's, as they are in the same ID-space. The spatial audio lib manages the
632  /// registration/unregistration of internal game objects for rooms that use these IDs and, therefore, must not collide.
633  /// \sa
634  /// - \ref AkRoomID
635  /// - \ref AkRoomParams
636  /// - \ref AK::SpatialAudio::RemoveRoom
637  AK_EXTERNAPIFUNC(AKRESULT, SetRoom)(
638  AkRoomID in_RoomID, ///< Unique room ID, chosen by the client.
639  const AkRoomParams& in_Params ///< Parameter for the room.
640  );
641 
642  /// Remove a room.
643  /// \sa
644  /// - \ref AkRoomID
645  /// - \ref AK::SpatialAudio::SetRoom
646  AK_EXTERNAPIFUNC(AKRESULT, RemoveRoom)(
647  AkRoomID in_RoomID ///< Room ID that was passed to \c SetRoom.
648  );
649 
650  /// Add or update an acoustic portal. A portal is an opening that connects two or more rooms to simulate the transmission of reverberated (indirect) sound between the rooms.
651  /// This function may be called multiple times with the same ID to update the parameters of the portal. The ID (\c in_PortalID) must be chosen in the same manner as \c AkGameObjectID's,
652  /// as they are in the same ID-space. The spatial audio lib manages the registration/unregistration of internal game objects for portals that use these IDs, and therefore must not collide.
653  /// \sa
654  /// - \ref AkPortalID
655  /// - \ref AkPortalParams
656  /// - \ref AK::SpatialAudio::RemovePortal
657  AK_EXTERNAPIFUNC(AKRESULT, SetPortal)(
658  AkPortalID in_PortalID, ///< Unique portal ID, chosen by the client.
659  const AkPortalParams& in_Params ///< Parameter for the portal.
660  );
661 
662  /// Remove a portal.
663  /// \sa
664  /// - \ref AkPortalID
665  /// - \ref AK::SpatialAudio::SetPortal
666  AK_EXTERNAPIFUNC(AKRESULT, RemovePortal)(
667  AkPortalID in_PortalID ///< ID of portal to be removed, which was originally passed to SetPortal.
668  );
669 
670  /// Set the room that the game object is currently located in - usually the result of a containment test performed by the client. The room must have been registered with \c SetRoom.
671  /// Setting the room for a game object provides the basis for the sound propagation service, and also sets which room's reverb aux bus to send to. The sound propagation service traces the path
672  /// of the sound from the emitter to the listener, and calculates the diffraction as the sound passes through each portal. The portals are used to define the spatial location of the diffracted and reverberated
673  /// audio.
674  /// \sa
675  /// - \ref AK::SpatialAudio::SetRoom
676  /// - \ref AK::SpatialAudio::RemoveRoom
677  AK_EXTERNAPIFUNC(AKRESULT, SetGameObjectInRoom)(
678  AkGameObjectID in_gameObjectID, ///< Game object ID
679  AkRoomID in_CurrentRoomID ///< RoomID that was passed to \c AK::SpatialAudio::SetRoom
680  );
681 
682  /// Set the early reflections order for reflection calculation. The reflections order indicates the number of times sound can bounce off of a surface.
683  /// A higher number requires more CPU resources but results in denser early reflections. Set to 0 to globally disable reflections processing.
684  AK_EXTERNAPIFUNC(AKRESULT, SetReflectionsOrder)(
685  AkUInt32 in_uReflectionsOrder, ///< Number of reflections to calculate. Valid range [0,4]
686  bool in_bUpdatePaths ///< Set to true to clear existing higher-order paths and to force the re-computation of new paths. If false, existing paths will remain and new paths will be computed when the emitter or listener moves.
687  );
688 
689  /// Set the number of rays cast from the listener by the stochastic ray casting engine.
690  /// A higher number requires more CPU resources but provides more accurate results. Default value (100) should be good for most applications.
691  ///
692  AK_EXTERNAPIFUNC(AKRESULT, SetNumberOfPrimaryRays)(
693  AkUInt32 in_uNbPrimaryRays ///< Number of rays cast from the listener
694  );
695 
696  /// Set an early reflections auxiliary bus for a particular game object.
697  /// Geometrical reflection calculation inside spatial audio is enabled for a game object if any sound playing on the game object has a valid early reflections aux bus specified in the authoring tool,
698  /// or if an aux bus is specified via \c SetEarlyReflectionsAuxSend.
699  /// The \c in_auxBusID parameter of SetEarlyReflectionsAuxSend applies to sounds playing on the game object \c in_gameObjectID which have not specified an early reflection bus in the authoring tool -
700  /// the parameter specified on individual sounds' reflection bus takes priority over the value passed in to \c SetEarlyReflectionsAuxSend.
701  /// \aknote
702  /// Users may apply this function to avoid duplicating sounds in the actor-mixer hierarchy solely for the sake of specifying a unique early reflection bus, or in any situation where the same
703  /// sound should be played on different game objects with different early reflection aux buses (the early reflection bus must be left blank in the authoring tool if the user intends to specify it through the API). \endaknote
704  AK_EXTERNAPIFUNC(AKRESULT, SetEarlyReflectionsAuxSend)(
705  AkGameObjectID in_gameObjectID, ///< Game object ID
706  AkAuxBusID in_auxBusID ///< Auxiliary bus ID. Applies only to sounds which have not specified an early reflection bus in the authoring tool. Pass \c AK_INVALID_AUX_ID to set only the send volume.
707  );
708 
709  /// Set an early reflections send volume for a particular game object.
710  /// The \c in_fSendVolume parameter is used to control the volume of the early reflections send. It is combined with the early reflections volume specified in the authoring tool, and is applied to all sounds
711  /// playing on the game object.
712  /// Setting \c in_fSendVolume to 0.f will disable all reflection processing for this game object.
713  AK_EXTERNAPIFUNC(AKRESULT, SetEarlyReflectionsVolume)(
714  AkGameObjectID in_gameObjectID, ///< Game object ID
715  AkReal32 in_fSendVolume ///< Send volume (linear) for auxiliary send. Set 0.f to disable reflection processing. Valid range 0.f-1.f.
716  );
717 
718  /// Set the obstruction and occlusion value for a portal that has been registered with Spatial Audio.
719  /// Portal obstruction is used to simulate objects between the portal and the listener that are obstructing the sound coming from the portal.
720  /// The obstruction value affects only the portals dry path, and should relate to how much of the opening
721  /// is obstructed, and must be calculated by the client. It is applied to the room's game object, as well as to all the emitters virtual positions
722  /// which propagate from that room through this portal.
723  /// Portal occlusion is applied only on the room game object, and affects both the wet and dry path of the signal emitted from the room's bus.
724  AK_EXTERNAPIFUNC(AKRESULT, SetPortalObstructionAndOcclusion)(
725  AkPortalID in_PortalID, ///< Portal ID.
726  AkReal32 in_fObstruction, ///< Obstruction value. Valid range 0.f-1.f
727  AkReal32 in_fOcclusion ///< Occlusion value. Valid range 0.f-1.f
728  );
729 
730  /// Query information about the wet diffraction amount for the portal \c in_portal, returned as a normalized value \c out_wetDiffraction in the range [0,1].
731  /// The wet diffraction is calculated from how far into the 'shadow region' the listener is from the portal. Unlike dry diffraction, the
732  /// wet diffraction does not depend on the incident angle, but only the normal of the portal.
733  /// Depending on the spatial audio initialization settings, this value is applied by spatial audio, to the obstruction and/or built-in game parameter of the room game object that is
734  /// on the other side of the portal (relative to the listener).
735  /// This function must acquire the global sound engine lock and therefore, may block waiting for the lock.
736  /// \sa
737  /// - \ref AkDiffractionFlags
738  /// - \ref AkSpatialAudioInitSettings
739  AK_EXTERNAPIFUNC(AKRESULT, QueryWetDiffraction)(
740  AkPortalID in_portal, ///< The ID of the game object that the client wishes to query.
741  AkReal32& out_wetDiffraction ///< The number of slots in \c out_aPaths, after returning the number of valid elements written.
742  );
743 
744  /// Query information about the diffraction state for a particular listener and emitter, which has been calculated using the data provided via the spatial audio emitter API. This function can be used for debugging purposes.
745  /// Returned in \c out_aPaths, this array contains the sound paths calculated from diffraction around a geometric edge and/or diffraction through portals connecting rooms.
746  /// No paths will be returned in any of the following conditions: (1) the emitter game object has a direct line of sight to the listener game object, (2) the emitter and listener are in the same room, and the listener is completely outside the radius of the emitter,
747  /// or (3) The emitter and listener are in different rooms, but there are no paths found via portals between the emitter and the listener.
748  /// A single path with zero diffraction nodes is returned when all of the following conditions are met: (1) the emitter and listener are in the same room, (2) there is no direct line of sight, and (3) either the Voice's Attenuation's curve max distance is exceeded or the accumulated diffraction coefficient exceeds 1.0.
749  /// This function must acquire the global sound engine lock and, therefore, may block waiting for the lock.
750  /// \sa
751  /// - \ref AkDiffractionPathInfo
752  AK_EXTERNAPIFUNC(AKRESULT, QueryDiffractionPaths)(
753  AkGameObjectID in_gameObjectID, ///< The ID of the game object that the client wishes to query.
754  AkVector& out_listenerPos, ///< Returns the position of the listener game object that is associated with the game object \c in_gameObjectID.
755  AkVector& out_emitterPos, ///< Returns the position of the emitter game object \c in_gameObjectID.
756  AkDiffractionPathInfo* out_aPaths, ///< Pointer to an array of \c AkDiffractionPathInfo's which will be filled on return.
757  AkUInt32& io_uArraySize ///< The number of slots in \c out_aPaths, after returning the number of valid elements written.
758  );
759 
760  //@}
761  }
762 };
AkTransform virtualPos
Virtual emitter position. This is the position that is passed to the sound engine to render the audio...
Definition: AkSpatialAudio.h:270
bool RoomGameObj_KeepRegistered
Definition: AkSpatialAudio.h:439
AKSOUNDENGINE_API AKRESULT QueryWetDiffraction(AkPortalID in_portal, AkReal32 &out_wetDiffraction)
AkRoomParams(const AkRoomParams &in_rhs)
Copy Constructor.
Definition: AkSpatialAudio.h:358
AKSOUNDENGINE_API AKRESULT UnregisterListener(AkGameObjectID in_gameObjectID)
Triangle for a spatial audio mesh.
Definition: AkSpatialAudio.h:156
AkUInt32 numPathPoints
Number of valid elements in the pathPoint[], surfaces[], and diffraction[] arrays.
Definition: AkSpatialAudio.h:229
AkReal32 fDiffractionShadowAttenFactor
Multiplier that is applied to the distance attenuation of diffracted sounds (sounds that are in the '...
Definition: AkSpatialAudio.h:72
AkVertex(AkReal32 in_X, AkReal32 in_Y, AkReal32 in_Z)
Constructor.
Definition: AkSpatialAudio.h:148
AkImageSourceParams params
Image source parameters.
Definition: AkSpatialAudio.h:132
AKSOUNDENGINE_API AKRESULT QueryReflectionPaths(AkGameObjectID in_gameObjectID, AkVector &out_listenerPos, AkVector &out_emitterPos, AkReflectionPathInfo *out_aPaths, AkUInt32 &io_uArraySize)
Parameters passed to SetPortal.
Definition: AkSpatialAudio.h:297
Audiokinetic namespace.
AkVector imageSource
Apparent source of the reflected sound that follows this path.
Definition: AkSpatialAudio.h:218
AKSOUNDENGINE_API AKRESULT RemovePortal(AkPortalID in_PortalID)
AkVector Front
Definition: AkSpatialAudio.h:392
AkTriIdx NumTriangles
Number of triangles in Triangles.
Definition: AkSpatialAudio.h:458
AkVector Up
Definition: AkSpatialAudio.h:391
AK::SpatialAudio::String name
Name given to image source, can be used to identify the image source in the AK Reflect plugin UI.
Definition: AkSpatialAudio.h:138
AkVertIdx point2
Index into the vertex table passed into AkGeometryParams that describes the third vertex of the trian...
Definition: AkSpatialAudio.h:180
AkReal32 RoomGameObj_AuxSendLevelToSelf
Definition: AkSpatialAudio.h:428
AKSOUNDENGINE_API AKRESULT SetGameObjectInRoom(AkGameObjectID in_gameObjectID, AkRoomID in_CurrentRoomID)
AkAcousticSurface()
Constructor.
Definition: AkSpatialAudio.h:194
AkTriangle(AkVertIdx in_pt0, AkVertIdx in_pt1, AkVertIdx in_pt2, AkSurfIdx in_surfaceInfo)
Constructor.
Definition: AkSpatialAudio.h:166
AkReal32 Z
Z coordinate.
Definition: AkSpatialAudio.h:152
AKSOUNDENGINE_API AKRESULT Init(const AkSpatialAudioInitSettings &in_initSettings)
Initialize the SpatialAudio API.
AkPortalParams()
Constructor.
Definition: AkSpatialAudio.h:300
AkImageSourceSettings(AkVector in_sourcePosition, AkReal32 in_fDistanceScalingFactor, AkReal32 in_fLevel)
Definition: AkSpatialAudio.h:97
AkVector pathPoint[AK_MAX_REFLECTION_PATH_LENGTH]
Definition: AkSpatialAudio.h:222
AkAuxBusID ReverbAuxBus
Definition: AkSpatialAudio.h:402
AkUInt32 textureID
Definition: AkSpatialAudio.h:201
AkRoomID FrontRoom
Definition: AkSpatialAudio.h:328
AkRoomParams()
Constructor.
Definition: AkSpatialAudio.h:342
AkUInt32 nodeCount
Total number of nodes in the path. Defines the number of valid entries in the nodes,...
Definition: AkSpatialAudio.h:273
AKSOUNDENGINE_API AKRESULT SetEarlyReflectionsAuxSend(AkGameObjectID in_gameObjectID, AkAuxBusID in_auxBusID)
AK::SpatialAudio::OsString strName
Name used to identify portal (optional).
Definition: AkSpatialAudio.h:321
AkUInt32 uNumTexture
Number of valid textures in the texture array.
const char * strName
Name to describe this surface.
Definition: AkSpatialAudio.h:211
AkVector nodes[kMaxNodes]
Definition: AkSpatialAudio.h:254
AkAcousticSurface surfaces[AK_MAX_REFLECTION_PATH_LENGTH]
Definition: AkSpatialAudio.h:226
AkAcousticSurface * Surfaces
Definition: AkSpatialAudio.h:475
AkReal32 X
X coordinate.
Definition: AkSpatialAudio.h:150
AKSOUNDENGINE_API AKRESULT RemoveImageSource(AkImageSourceID in_srcID, AkUniqueID in_AuxBusID, AkGameObjectID in_gameObjectID)
AkVertIdx NumVertices
Definition: AkSpatialAudio.h:468
AkReal32 ReverbLevel
Definition: AkSpatialAudio.h:406
AK::SpatialAudio::OsString strName
Name used to identify room (optional)
Definition: AkSpatialAudio.h:417
AKSOUNDENGINE_API AKRESULT SetGeometry(AkGeometrySetID in_GeomSetID, const AkGeometryParams &in_params)
Structure for retrieving information about the indirect paths of a sound that have been calculated vi...
Definition: AkSpatialAudio.h:215
AkSurfIdx surface
Definition: AkSpatialAudio.h:184
AKSOUNDENGINE_API AKRESULT SetPortal(AkPortalID in_PortalID, const AkPortalParams &in_Params)
AkRoomID RoomID
Definition: AkSpatialAudio.h:486
bool isOccluded
True if the sound path was occluded. Note that the spatial audio library must be recompiled with #def...
Definition: AkSpatialAudio.h:241
AkReal32 Y
Y Position.
Definition: AkTypes.h:316
AkRoomParams & operator=(const AkRoomParams &in_rhs)
Assignment operator.
Definition: AkSpatialAudio.h:372
void SetOneTexture(AkUniqueID in_texture)
Definition: AkSpatialAudio.h:119
AkReal32 angles[kMaxNodes]
Raw diffraction angles at each point, in radians.
Definition: AkSpatialAudio.h:257
bool bEnableTransmission
Enable modeling of transmission of sound through walls.
Definition: AkSpatialAudio.h:89
AkReal32 X
X Position.
Definition: AkTypes.h:315
AkReal32 Y
Y coordinate.
Definition: AkSpatialAudio.h:151
AKSOUNDENGINE_API AKRESULT ClearImageSources(AkUniqueID in_AuxBusID=AK_INVALID_AUX_ID, AkGameObjectID in_gameObjectID=AK_INVALID_GAME_OBJECT)
AkRoomID BackRoom
Definition: AkSpatialAudio.h:335
AkPortalID portals[kMaxNodes]
Definition: AkSpatialAudio.h:262
AkTriangle * Triangles
Definition: AkSpatialAudio.h:455
AkUInt32 uNumberOfPrimaryRays
The number of primary rays used in stochastic ray casting.
Definition: AkSpatialAudio.h:79
AkReal32 Z
Z Position.
Definition: AkTypes.h:317
AkUInt32 uMaxReflectionOrder
Maximum reflection order [1, 4] - the number of 'bounces' in a reflection path. A higher reflection o...
Definition: AkSpatialAudio.h:80
AkTriangle()
Constructor.
Definition: AkSpatialAudio.h:159
void SetName(const char *in_pName)
Definition: AkSpatialAudio.h:125
Initialization settings of the spatial audio module.
Definition: AkSpatialAudio.h:54
Vertex for a spatial audio mesh.
Definition: AkSpatialAudio.h:142
AkReal32 diffraction[AK_MAX_REFLECTION_PATH_LENGTH]
Diffraction amount, normalized to the range [0,1].
Definition: AkSpatialAudio.h:235
AKSOUNDENGINE_API AKRESULT RemoveRoom(AkRoomID in_RoomID)
AkVertex()
Constructor.
Definition: AkSpatialAudio.h:145
AKSOUNDENGINE_API AKRESULT SetReflectionsOrder(AkUInt32 in_uReflectionsOrder, bool in_bUpdatePaths)
AkVertIdx point0
Index into the vertex table passed into AkGeometryParams that describes the first vertex of the trian...
Definition: AkSpatialAudio.h:174
Base type for ID's used by Wwise spatial audio.
AkUInt32 numReflections
Number of reflections in the pathPoint[] array. Shadow zone diffraction does not count as a reflectio...
Definition: AkSpatialAudio.h:232
bool EnableDiffraction
Switch to enable or disable geometric diffraction for this Geometry.
Definition: AkSpatialAudio.h:489
AkSurfIdx NumSurfaces
Number of of AkTriangleInfo structures in in_pTriangleInfo and number of AkTriIdx's in in_infoMap.
Definition: AkSpatialAudio.h:478
AkReal32 level
Linear gain applied to image source.
Definition: AkSpatialAudio.h:238
AkReal32 WallOcclusion
Definition: AkSpatialAudio.h:414
static const AkUInt32 kMaxNodes
Defines the maximum number of nodes that a user can retrieve information about. Longer paths will be ...
Definition: AkSpatialAudio.h:250
AkReal32 fMovementThreshold
Amount that an emitter or listener has to move to trigger a recalculation of reflections/diffraction....
Definition: AkSpatialAudio.h:77
static AkUInt32 GrowBy(AkUInt32)
Definition: AkSpatialAudio.h:40
AkImageSourceSettings & operator=(const AkImageSourceSettings &src)
Operator =.
Definition: AkSpatialAudio.h:110
AkRoomID rooms[kMaxNodes+1]
Definition: AkSpatialAudio.h:267
bool EnableDiffractionOnBoundaryEdges
Switch to enable or disable geometric diffraction on boundary edges for this Geometry....
Definition: AkSpatialAudio.h:492
AKRESULT AllocCopy()
Definition: AkString.h:79
AKSOUNDENGINE_API AKRESULT SetImageSource(AkImageSourceID in_srcID, const AkImageSourceSettings &in_info, AkUniqueID in_AuxBusID, AkRoomID in_roomID, AkGameObjectID in_gameObjectID)
AkImageSourceTexture texture
Acoustic texture that goes with this image source.
Definition: AkSpatialAudio.h:135
AkReal32 occlusion
Definition: AkSpatialAudio.h:208
AkUInt32 uDiffractionFlags
Enable or disable specific diffraction features. See AkDiffractionFlags.
Definition: AkSpatialAudio.h:71
AkVertex * Vertices
Number of vertices in Vertices.
Definition: AkSpatialAudio.h:465
AkUInt32 uMaxSoundPropagationDepth
Maximum number of portals that sound can propagate through; must be less than or equal to AK_MAX_SOUN...
Definition: AkSpatialAudio.h:70
3D vector.
Definition: AkTypes.h:297
AKSOUNDENGINE_API AKRESULT QueryDiffractionPaths(AkGameObjectID in_gameObjectID, AkVector &out_listenerPos, AkVector &out_emitterPos, AkDiffractionPathInfo *out_aPaths, AkUInt32 &io_uArraySize)
bool bEnableDiffractionOnReflection
Enable diffraction at the end/beginning of reflection paths. Diffraction on reflection causes reflect...
Definition: AkSpatialAudio.h:84
AkTransform Transform
Definition: AkSpatialAudio.h:308
AkVector Extent
Definition: AkSpatialAudio.h:313
AKSOUNDENGINE_API AKRESULT SetEarlyReflectionsVolume(AkGameObjectID in_gameObjectID, AkReal32 in_fSendVolume)
AkGeometryParams()
Constructor.
Definition: AkSpatialAudio.h:448
AkReal32 diffraction
Definition: AkSpatialAudio.h:282
void Term()
Definition: AkString.h:65
AKSOUNDENGINE_API AKRESULT SetPortalObstructionAndOcclusion(AkPortalID in_PortalID, AkReal32 in_fObstruction, AkReal32 in_fOcclusion)
AkReal32 fDiffractionShadowDegrees
Definition: AkSpatialAudio.h:73
AkReal32 obstructionValue
Definition: AkSpatialAudio.h:293
AKSOUNDENGINE_API AKRESULT RemoveGeometry(AkGeometrySetID in_SetID)
AkUniqueID arTextureID[AK_MAX_NUM_TEXTURE]
Unique IDs of the Acoustics Texture ShareSets used to filter this image source.
AKSOUNDENGINE_API AKRESULT SetRoom(AkRoomID in_RoomID, const AkRoomParams &in_Params)
Parameters passed to SetRoom.
Definition: AkSpatialAudio.h:339
Position and orientation of game objects.
Definition: AkTypes.h:321
Parameters passed to SetGeometry.
Definition: AkSpatialAudio.h:445
AkVertIdx point1
Index into the vertex table passed into AkGeometryParams that describes the second vertex of the tria...
Definition: AkSpatialAudio.h:177
AKSOUNDENGINE_API AKRESULT RegisterListener(AkGameObjectID in_gameObjectID)
AKSOUNDENGINE_API AKRESULT SetNumberOfPrimaryRays(AkUInt32 in_uNbPrimaryRays)