버전
menu_open
link
Wwise SDK 2023.1.2
AkReflectGameData.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  Copyright (c) 2024 Audiokinetic Inc.
25 *******************************************************************************/
26 
27 #ifndef _AK_REFLECT_GAMEDATA_H_
28 #define _AK_REFLECT_GAMEDATA_H_
29 
31 
32 #define AK_MAX_NUM_TEXTURE 4
33 
34 /// Data used to describe one image source in Reflect.
36 {
38  : uNumChar(0)
39  , pName(NULL)
40  {
41  }
42 
43  void SetName(const char * in_pName)
44  {
45  pName = in_pName;
46  if (pName)
47  {
48  uNumChar = (AkUInt32)strlen(in_pName);
49  }
50  else
51  {
52  uNumChar = 0;
53  }
54  }
55 
56  AkUInt32 uNumChar; ///< Number of characters in image source name.
57  const char * pName; ///< Optional image source name. Appears in Reflect's editor when profiling.
58 };
59 
61 {
63  : uNumTexture(1)
64  {
66  }
67 
68  AkUInt32 uNumTexture; ///< Number of valid textures in the texture array.
69  AkUniqueID arTextureID[AK_MAX_NUM_TEXTURE]; ///< Unique IDs of the Acoustics Texture ShareSets used to filter this image source.
70 };
71 
73 {
76  , fLevel(1.f)
77  , fDiffraction(0.f)
80  {
81  sourcePosition.X = 0.f;
82  sourcePosition.Y = 0.f;
83  sourcePosition.Z = 0.f;
84  }
85 
86  AkImageSourceParams(AkVector64 in_sourcePosition, AkReal32 in_fDistanceScalingFactor, AkReal32 in_fLevel)
87  : sourcePosition(in_sourcePosition)
88  , fDistanceScalingFactor(in_fDistanceScalingFactor)
89  , fLevel(in_fLevel)
90  , fDiffraction(0.f)
93  {
94  }
95 
96  AkVector64 sourcePosition; ///< Image source position, relative to the world.
97  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.
98  AkReal32 fLevel; ///< Game-controlled level for this source, linear.
99  AkReal32 fDiffraction; ///< Diffraction amount, normalized to the range [0,1].
100  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.
101  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.
102 };
103 
105 {
107  : uID((AkImageSourceID)-1)
108  , params()
109  , texture()
110  , name()
111  {}
112 
113  AkReflectImageSource(AkImageSourceID in_uID, AkVector64 in_sourcePosition, AkReal32 in_fDistanceScalingFactor, AkReal32 in_fLevel)
114  : uID(in_uID)
115  , params(in_sourcePosition, in_fDistanceScalingFactor, in_fLevel)
116  , texture()
117  , name()
118  {
119  }
120 
121  void SetName(const char * in_pName)
122  {
123  name.SetName(in_pName);
124  }
125 
126  AkImageSourceID uID; ///< Image source ID (for matching delay lines across frames)
127  AkImageSourceParams params; ///< Image source properties
128  AkImageSourceTexture texture; ///< Image source's acoustic textures. Note that changing any of these textures across frames for a given image source, identified by uID, may result in a discontinuity in the audio signal.
129  AkImageSourceName name; ///< Image source name, for profiling.
130 };
131 
132 /// Data structure sent by the game to an instance of the Reflect plug-in.
134 {
135  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.
136  AkUInt32 uNumImageSources; ///< Number of image sources passed in the variable array, below.
137  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.
138 
139  /// Default constructor.
142  , uNumImageSources(0)
143  {}
144 
145  /// Helper function for computing the size required to allocate the AkReflectGameData structure.
146  static AkUInt32 GetSize(AkUInt32 in_uNumSources)
147  {
148  return (in_uNumSources > 0) ? sizeof(AkReflectGameData) + (in_uNumSources - 1) * sizeof(AkReflectImageSource) : sizeof(AkReflectGameData);
149  }
150 };
151 #endif // _AK_REFLECT_GAMEDATA_H_
AkUInt32 uNumChar
Number of characters in image source name.
AkReflectImageSource(AkImageSourceID in_uID, AkVector64 in_sourcePosition, AkReal32 in_fDistanceScalingFactor, AkReal32 in_fLevel)
#define AK_MAX_NUM_TEXTURE
AkReflectImageSource arSources[1]
Variable array of image sources. You should allocate storage for the structure by calling AkReflectGa...
AkImageSourceTexture texture
Image source's acoustic textures. Note that changing any of these textures across frames for a given ...
Data used to describe one image source in Reflect.
AkUInt64 AkGameObjectID
Game object ID
Definition: AkTypes.h:142
AkUInt32 uNumTexture
Number of valid textures in the texture array.
AkReal32 fDiffraction
Diffraction amount, normalized to the range [0,1].
AkReal32 fLevel
Game-controlled level for this source, linear.
AkUInt32 AkImageSourceID
Image Source ID
Definition: AkTypes.h:166
AkReal32 fDistanceScalingFactor
Image source distance scaling. This number effectively scales the sourcePosition vector with respect ...
uint8_t AkUInt8
Unsigned 8-bit integer
AkUInt32 uNumImageSources
Number of image sources passed in the variable array, below.
void SetName(const char *in_pName)
#define NULL
Definition: AkTypes.h:46
float AkReal32
32-bit floating point
AkUInt32 AkUniqueID
Unique 32-bit ID
Definition: AkTypes.h:134
static AkUInt32 GetSize(AkUInt32 in_uNumSources)
Helper function for computing the size required to allocate the AkReflectGameData structure.
AkGameObjectID listenerID
ID of the listener used to compute spatialization and distance evaluation from within the targeted Re...
AkUInt8 uDiffractionListenerSide
If there is a shadow zone diffraction before reaching the listener in the reflection path,...
AkImageSourceID uID
Image source ID (for matching delay lines across frames)
Data structure sent by the game to an instance of the Reflect plug-in.
AkReflectGameData()
Default constructor.
static const AkUniqueID AK_INVALID_UNIQUE_ID
Invalid unique 32-bit ID
Definition: AkTypes.h:177
AkImageSourceParams(AkVector64 in_sourcePosition, AkReal32 in_fDistanceScalingFactor, AkReal32 in_fLevel)
const char * pName
Optional image source name. Appears in Reflect's editor when profiling.
AkReal64 Y
Y Position
Definition: AkTypes.h:438
AkImageSourceName name
Image source name, for profiling.
static const AkGameObjectID AK_INVALID_GAME_OBJECT
Invalid game object (may also mean all game objects)
Definition: AkTypes.h:176
3D 64-bit vector. Intended as storage for world positions of sounds and objects, benefiting from 64-b...
Definition: AkTypes.h:409
uint32_t AkUInt32
Unsigned 32-bit integer
AkVector64 sourcePosition
Image source position, relative to the world.
void SetName(const char *in_pName)
AkImageSourceParams params
Image source properties
AkReal64 Z
Z Position
Definition: AkTypes.h:439
AkUniqueID arTextureID[AK_MAX_NUM_TEXTURE]
Unique IDs of the Acoustics Texture ShareSets used to filter this image source.
AkReal64 X
X Position
Definition: AkTypes.h:437
AkUInt8 uDiffractionEmitterSide
If there is a shadow zone diffraction just after the emitter in the reflection path,...

이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요