CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
[CriAtom] 3D positioning

Description of the sample

Overview

cri4u_samples_criatom_scene02_game_mini.png

This sample demonstrates 3D positioning by using distance attenuation.
As the cube rotates, the sound of a helicopter moves.
A sound source ( Cri Atom Source ) is attached to the cube. A listener ( Cri Atom Listener ) is attached to the main camera.

Scene information


Middleware CRI ADX (CRI Atom)
Sample Basic sample
Location /CRIWARE/SDK/unity/samples/UnityProject/Assets/Scenes/criatom/basic/
Scene file Scene_02_3DPosition.unity


Description of the program

CriAtomListener component

The CRI Atom Listener is assigned to the main camera.
Based on the relative position between the Game Object that holds the CRI Atom Source component and the camera (object that has a CRI Atom Listener component),
the distance attenuation is automatically calculated.
In CRI Atom Craft, it is possible to set many parameters to configure the 3D positioning, such as the minimum and maximum distances, cone, Doppler, distance attenuation curve, and sound cross-fading at short and long distances.

Data that supports 3D positioning

If 3D-related settings are already configured in CRI Atom Craft, you can play the data directly from your program.

Note
If the panning setting for the data is not 3D positioning, the data is not affected by 3D.
In that case, use panning 3D for control.

void Update()
{
/* Rotate around a center position */
this.gameObject.transform.RotateAround(centerPosition, new Vector3(0, 1, 0), Time.deltaTime * RotateSpeed);
}