Version
menu_open
link
Wwise SDK 2018.1.11
AkSpatialAudioTypes.h
Go to the documentation of this file.
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 data type definitions.
30 
31 #pragma once
32 
34 #include <AK/Tools/Common/AkSet.h>
36 #include <AK/Tools/Common/AkLock.h>
37 
38 class AkAcousticRoom;
39 class AkAcousticPortal;
40 class AkImageSourceTriangle;
41 class AkImageSourcePlane;
42 
43 #define AK_MAX_REFLECT_ORDER 4
44 #define AK_MAX_REFLECTION_PATH_LENGTH (AK_MAX_REFLECT_ORDER + 2)
45 #define AK_MAX_SOUND_PROPAGATION_DEPTH 8
46 #define AK_DEFAULT_DIFFR_SHADOW_DEGREES (30.0f)
47 #define AK_DEFAULT_DIFFR_SHADOW_ATTEN (2.0f)
48 #define AK_SA_EPSILON (0.001f)
49 #define AK_SA_PLANE_THICKNESS_RATIO (0.005f)
50 
52 
54 
56 
57 AK_DEFINE_ARRAY_POOL(_ArrayPoolSpatialAudio, g_SpatialAudioPoolId);
60 
61 namespace AK
62 {
63  namespace SpatialAudio
64  {
65  typedef AkString<ArrayPoolSpatialAudio, wchar_t> WString; ///< Wide string type for use in Wwise Spatial Audio
66  typedef AkString<ArrayPoolSpatialAudio, AkOSChar> OsString; ///< OS string type for use in Wwise Spatial Audio
67  typedef AkString<ArrayPoolSpatialAudio, char> String; ///< String type for use in Wwise Spatial Audio
68  typedef AkDbString<ArrayPoolSpatialAudio, char, CAkLock> DbString; ///< Instanced string type.
69 
70  typedef AkUInt16 Idx;
71  }
72 }
73 
78 
79 #define AK_INVALID_VERTEX ((AkVertIdx)(-1))
80 #define AK_INVALID_TRIANGLE ((AkTriIdx)(-1))
81 #define AK_INVALID_SURFACE ((AkSurfIdx)(-1))
82 #define AK_INVALID_EDGE ((AkEdgeIdx)(-1))
83 
84 /// Base type for ID's used by Wwise spatial audio.
86 {
87  /// Default constructor. Creates an invalid ID.
89 
90  /// Construct from a 64-bit int.
91  AkSpatialAudioID(AkUInt64 _id) : id(_id) {}
92 
93  /// Conversion from a pointer to a AkSpatialAudioID
94  explicit AkSpatialAudioID(const void * ptr) : id(reinterpret_cast<AkUInt64>(ptr)) {}
95 
96  bool operator == (AkSpatialAudioID rhs) const { return id == rhs.id; }
97  bool operator != (AkSpatialAudioID rhs) const { return id != rhs.id; }
98  bool operator < (AkSpatialAudioID rhs) const { return id < rhs.id; }
99  bool operator > (AkSpatialAudioID rhs) const { return id > rhs.id; }
100  bool operator <= (AkSpatialAudioID rhs) const { return id <= rhs.id; }
101  bool operator >= (AkSpatialAudioID rhs) const { return id >= rhs.id; }
102 
103  /// Determine if this ID is valid.
104  bool IsValid() const { return id != (AkUInt64)-1; }
105 
106  /// Conversion function used internally to convert from a AkSpatialAudioID to a AkGameObjectID.
108 
109  operator</span> AkUInt64 () { return id; }
110 
112 };
113 
114 /// Spatial Audio Room ID type. This ID type exists in the same ID-space as game object ID's. The client is responsible for not choosing room ID's
115 /// that conflict with registered game objects' ID's. Internally, the spatial audio rooms and portals API manages registration and un-registration of game objects that
116 /// represent rooms using AkRoomID's provided by the client; AkRoomID's are convertied to AkGameObjectID's by calling AsGameObjectID().
117 /// \sa
118 /// - \ref AK::SpatialAudio::SetRoom
119 /// - \ref AK::SpatialAudio::RemoveRoom
120 struct AkRoomID : public AkSpatialAudioID
121 {
122  /// A game object ID that is in the reserved range, used for 'outdoor' rooms, ie when not in a room.
124 
125  /// Default constructor. Creates an invalid ID.
127 
128  /// Construct from a 64-bit int.
130 
131  /// Conversion from a pointer to a AkRoomID
132  explicit AkRoomID(const void * ptr) : AkSpatialAudioID(ptr) {}
133 
134  /// Conversion function used internally to convert AkRoomID's to AkGameObjectIDs.
136 };
137 
138 ///< Unique ID for portals. This ID type exists in the same ID-space as game object ID's. The client is responsible for not choosing portal ID's
139 /// that conflict with registered game objects' ID's. Internally, the spatial audio rooms and portals API manages registration and un-registration of game objects that
140 /// represent portals using AkPortalID's provided by the client; AkPortalID's are convertied to AkGameObjectID's by calling AsGameObjectID().
141 /// \sa
142 /// - \ref AK::SpatialAudio::SetPortal
143 /// - \ref AK::SpatialAudio::RemovePortal
145 
146 ///< Unique ID for identifying geometry sets. Chosen by the client using any means desired.
147 /// \sa
148 /// - \ref AK::SpatialAudio::SetGeometry
149 /// - \ref AK::SpatialAudio::RemoveGeometry
151 
152 
static const AkGameObjectID OutdoorsGameObjID
A game object ID that is in the reserved range, used for 'outdoor' rooms, ie when not in a room.
AkString< ArrayPoolSpatialAudio, char > String
String type for use in Wwise Spatial Audio.
AkGameObjectID AsGameObjectID() const
Conversion function used internally to convert from a AkSpatialAudioID to a AkGameObjectID.
uint16_t AkUInt16
Unsigned 16-bit integer.
Definition: AkTypes.h:78
AkUInt16 AkSurfIdx
bool operator !=(AkSpatialAudioID rhs) const
uint64_t AkUInt64
Unsigned 64-bit integer.
Definition: AkTypes.h:80
Audiokinetic namespace.
AkString< ArrayPoolSpatialAudio, AkOSChar > OsString
OS string type for use in Wwise Spatial Audio.
AK_DEFINE_ARRAY_POOL(_ArrayPoolSpatialAudio, g_SpatialAudioPoolId)
AkUInt16 AkVertIdx
bool operator==(AkSpatialAudioID rhs) const
AkSpatialAudioID(AkUInt64 _id)
Construct from a 64-bit int.
Definition: AkString.h:60
AkSpatialAudioID(const void *ptr)
Conversion from a pointer to a AkSpatialAudioID.
bool operator >=(AkSpatialAudioID rhs) const
AkDbString< ArrayPoolSpatialAudio, char, CAkLock > DbString
Instanced string type.
AkRoomID()
Default constructor. Creates an invalid ID.
const AkReal32 kDefaultMaxPathLength
AkUInt64 AkGameObjectID
Game object ID.
Definition: AkTypes.h:70
AkUInt16 AkEdgeIdx
AkString< ArrayPoolSpatialAudio, wchar_t > WString
Wide string type for use in Wwise Spatial Audio.
AkGameObjectID AsGameObjectID() const
Conversion function used internally to convert AkRoomID's to AkGameObjectIDs.
bool operator >(AkSpatialAudioID rhs) const
bool IsValid() const
Determine if this ID is valid.
AkSpatialAudioID AkGeometrySetID
bool operator<(AkSpatialAudioID rhs) const
AkRoomID(AkUInt64 _id)
Construct from a 64-bit int.
AkRoomID(const void *ptr)
Conversion from a pointer to a AkRoomID.
const AkReal32 kMaxDiffraction
Base type for ID's used by Wwise spatial audio.
AkSpatialAudioID AkPortalID
AkMemPoolId g_SpatialAudioPoolId
AkArrayAllocatorNoAlign< _ArrayPoolSpatialAudio > ArrayPoolSpatialAudio
float AkReal32
32-bit floating point
Definition: AkTypes.h:97
bool operator<=(AkSpatialAudioID rhs) const
AkUInt16 AkTriIdx
AkInt32 AkMemPoolId
Memory pool ID.
Definition: AkTypes.h:72
AkArrayAllocatorAlignedSimd< _ArrayPoolSpatialAudio > ArrayPoolSpatialAudioSIMD
AkSpatialAudioID()
Default constructor. Creates an invalid ID.

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise