Table of Contents

Wwise SDK 2019.1.6
AkReflectGameData.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 #ifndef _AK_REFLECT_GAMEDATA_H_
29 #define _AK_REFLECT_GAMEDATA_H_
30 
32 
33 #define AK_MAX_NUM_TEXTURE 4
34 
35 /// Data used to describe one image source in Wwise Reflect.
37 {
39  : uNumChar(0)
40  , pName(NULL)
41  {
42  }
43 
44  void SetName(const char * in_pName)
45  {
46  pName = in_pName;
47  if (pName)
48  {
49  uNumChar = (AkUInt32)strlen(in_pName);
50  }
51  else
52  {
53  uNumChar = 0;
54  }
55  }
56 
57  AkUInt32 uNumChar; ///< Number of characters in image source name.
58  const char * pName; ///< Optional image source name. Appears in Wwise Reflect's editor when profiling.
59 };
60 
62 {
64  : uNumTexture(1)
65  {
67  }
68 
69  AkUInt32 uNumTexture; ///< Number of valid textures in the texture array.
70  AkUniqueID arTextureID[AK_MAX_NUM_TEXTURE]; ///< Unique IDs of the Acoustics Texture ShareSets used to filter this image source.
71 };
72 
74 {
77  , fLevel(1.f)
78  , fDiffraction(0.f)
81  {
82  sourcePosition.X = 0.f;
83  sourcePosition.Y = 0.f;
84  sourcePosition.Z = 0.f;
85  }
86 
87  AkImageSourceParams(AkVector in_sourcePosition, AkReal32 in_fDistanceScalingFactor, AkReal32 in_fLevel)
88  : sourcePosition(in_sourcePosition)
89  , fDistanceScalingFactor(in_fDistanceScalingFactor)
90  , fLevel(in_fLevel)
91  , fDiffraction(0.f)
94  {
95  }
96 
97  AkVector sourcePosition; ///< Image source position, relative to the world.
98  AkReal32 fDistanceScalingFactor; ///< Image source distance scaling. This number effectively scales the sourcePosition vector with respect to the listener and, consequently, scales distance and preserves orientation.
99  AkReal32 fLevel; ///< Game-controlled level for this source, linear.
100  AkReal32 fDiffraction; ///< Diffraction amount, normalized to the range [0,1].
101  AkUInt8 uDiffractionEmitterSide; ///< If there is a shadow zone diffraction just after the emitter in the reflection path, indicates the number of diffraction edges, otherwise 0 if no diffraction.
102  AkUInt8 uDiffractionListenerSide; ///< If there is a shadow zone diffraction before reaching the listener in the reflection path, indicates the number of diffraction edges, otherwise 0 if no diffraction.
103 };
104 
106 {
108  : uID((AkImageSourceID)-1)
109  , params()
110  , texture()
111  , name()
112  {}
113 
114  AkReflectImageSource(AkImageSourceID in_uID, AkVector in_sourcePosition, AkReal32 in_fDistanceScalingFactor, AkReal32 in_fLevel)
115  : uID(in_uID)
116  , params(in_sourcePosition, in_fDistanceScalingFactor, in_fLevel)
117  , texture()
118  , name()
119  {
120  }
121 
122  void SetName(const char * in_pName)
123  {
124  name.SetName(in_pName);
125  }
126 
127  AkImageSourceID uID; ///< Image source ID (for matching delay lines across frames)
131 };
132 
133 /// Data structure sent by the game to an instance of the Wwise Reflect plug-in.
135 {
136  AkGameObjectID listenerID; ///< ID of the listener used to compute spatialization and distance evaluation from within the targeted Reflect plug-in instance. It needs to be one of the listeners that are listening to the game object associated with the targeted plug-in instance. See AK::SoundEngine::SetListeners and AK::SoundEngine::SetGameObjectAuxSendValues.
137  AkUInt32 uNumImageSources; ///< Number of image sources passed in the variable array, below.
138  AkReflectImageSource arSources[1]; ///< Variable array of image sources. You should allocate storage for the structure by calling AkReflectGameData::GetSize() with the desired number of sources.
139 
140  /// Default constructor.
143  , uNumImageSources(0)
144  {}
145 
146  /// Helper function for computing the size required to allocate the AkReflectGameData structure.
147  static AkUInt32 GetSize(AkUInt32 in_uNumSources)
148  {
149  return (in_uNumSources > 0) ? sizeof(AkReflectGameData) + (in_uNumSources - 1) * sizeof(AkReflectImageSource) : sizeof(AkReflectGameData);
150  }
151 };
152 #endif // _AK_REFLECT_GAMEDATA_H_
AkUniqueID arTextureID[AK_MAX_NUM_TEXTURE]
Unique IDs of the Acoustics Texture ShareSets used to filter this image source.
AkReflectImageSource(AkImageSourceID in_uID, AkVector in_sourcePosition, AkReal32 in_fDistanceScalingFactor, AkReal32 in_fLevel)
Data structure sent by the game to an instance of the Wwise Reflect plug-in.
AkUInt32 AkImageSourceID
Image Source ID.
Definition: AkTypes.h:93
AkUInt8 uDiffractionEmitterSide
If there is a shadow zone diffraction just after the emitter in the reflection path,...
AkImageSourceTexture texture
uint8_t AkUInt8
Unsigned 8-bit integer.
Definition: AkTypes.h:76
AkReal32 fDiffraction
Diffraction amount, normalized to the range [0,1].
AkReal32 fLevel
Game-controlled level for this source, linear.
AkUInt32 uNumTexture
Number of valid textures in the texture array.
AkReal32 X
X Position.
Definition: AkTypes.h:298
const char * pName
Optional image source name. Appears in Wwise Reflect's editor when profiling.
#define AK_MAX_NUM_TEXTURE
void SetName(const char *in_pName)
AkUInt32 AkUniqueID
Unique 32-bit ID.
Definition: AkTypes.h:62
AkUInt64 AkGameObjectID
Game object ID.
Definition: AkTypes.h:70
AkImageSourceID uID
Image source ID (for matching delay lines across frames)
AkUInt8 uDiffractionListenerSide
If there is a shadow zone diffraction before reaching the listener in the reflection path,...
AkGameObjectID listenerID
ID of the listener used to compute spatialization and distance evaluation from within the targeted Re...
#define NULL
Definition: AkTypes.h:49
AkImageSourceName name
Data used to describe one image source in Wwise Reflect.
void SetName(const char *in_pName)
static const AkGameObjectID AK_INVALID_GAME_OBJECT
Invalid game object (may also mean all game objects)
Definition: AkTypes.h:98
AkReal32 Z
Z Position.
Definition: AkTypes.h:300
3D vector.
Definition: AkTypes.h:280
AkReflectImageSource arSources[1]
Variable array of image sources. You should allocate storage for the structure by calling AkReflectGa...
uint32_t AkUInt32
Unsigned 32-bit integer.
Definition: AkTypes.h:78
static const AkUniqueID AK_INVALID_UNIQUE_ID
Invalid unique 32-bit ID.
Definition: AkTypes.h:99
static AkUInt32 GetSize(AkUInt32 in_uNumSources)
Helper function for computing the size required to allocate the AkReflectGameData structure.
float AkReal32
32-bit floating point
Definition: AkTypes.h:96
AkReal32 fDistanceScalingFactor
Image source distance scaling. This number effectively scales the sourcePosition vector with respect ...
AkVector sourcePosition
Image source position, relative to the world.
AkImageSourceParams(AkVector in_sourcePosition, AkReal32 in_fDistanceScalingFactor, AkReal32 in_fLevel)
AkUInt32 uNumChar
Number of characters in image source name.
AkImageSourceParams params
AkUInt32 uNumImageSources
Number of image sources passed in the variable array, below.
AkReal32 Y
Y Position.
Definition: AkTypes.h:299
AkReflectGameData()
Default constructor.