CRI ADX  Last Updated: 2024-07-17 10:48 p
3D定位
示例目录
/cri/pc/samples/criatomex/control_3d_pos
示例描述
3D定位 执行"3D定位" 必须要有以下元素。 必须将这些注册到AtomExPlayer(::CriAtomExPlayerHn )中。注册函数如下。 使用以下函数设置收听者和声源参数,例如位置信息。 设置参数后,使用以下函数实际反映参数。 另外,可以为收听者和声源设置几个参数。
执行3D定位的代码如下。
listener = criAtomEx3dListener_Create(NULL, NULL, 0);
source = criAtomEx3dSource_Create(NULL, NULL, 0);
player = criAtomExPlayer_Create(NULL, NULL, 0);
pos.x = 0.0f;
pos.y = 0.0f;
pos.z = 0.0f;
// Start playback
id = criAtomExPlayer_Start(player);
:
pos.x += 10.0f;
void criAtomEx3dSource_Update(CriAtomEx3dSourceHn ex_3d_source)
Update a 3D sound source
CriAtomEx3dListenerObj * CriAtomEx3dListenerHn
3D listener handle
Definition: cri_le_atom_ex.h:4622
CriAtomEx3dListenerHn criAtomEx3dListener_Create(const CriAtomEx3dListenerConfig *config, void *work, CriSint32 work_size)
Create a 3D listener handle
CriAtomEx3dSourceObj * CriAtomEx3dSourceHn
3D sound source handle
Definition: cri_le_atom_ex.h:4596
void criAtomEx3dSource_SetPosition(CriAtomEx3dSourceHn ex_3d_source, const CriAtomExVector *position)
Set the position of a 3D sound source
CriAtomEx3dSourceHn criAtomEx3dSource_Create(const CriAtomEx3dSourceConfig *config, void *work, CriSint32 work_size)
Create a 3D sound source
CriAtomExPlaybackId criAtomExPlayer_Start(CriAtomExPlayerHn player)
Start the playback
CriAtomExPlayerHn criAtomExPlayer_Create(const CriAtomExPlayerConfig *config, void *work, CriSint32 work_size)
Create an AtomEx player
void criAtomExPlayer_Set3dSourceHn(CriAtomExPlayerHn player, CriAtomEx3dSourceHn source)
Set the 3D sound source handle
void criAtomExPlayer_Set3dListenerHn(CriAtomExPlayerHn player, CriAtomEx3dListenerHn listener)
Set the 3D listener handle
3D vector structure
Definition: cri_le_atom_ex.h:4504
CriFloat32 z
Definition: cri_le_atom_ex.h:4507
CriFloat32 y
Definition: cri_le_atom_ex.h:4506
CriFloat32 x
Definition: cri_le_atom_ex.h:4505


示例使用的数据中AtomCraft项目的目录

/cri/tools/criatomex/examples/tutorial_data_for_runtime