Version
menu

Wwise SDK 2025.1.4
AkCmd_SA_SetGameObjectRadius Struct Reference

#include AkCommandTypes.h>

Public Attributes

AkGameObjectID gameObjectID
 Game object ID. More...
 
AkReal32 outerRadius
 Outer radius around each sound position, defining 50% spread. Must satisfy innerRadius outerRadius. More...
 
AkReal32 innerRadius
 Inner radius around each sound position, defining 100% spread and 0 attenuation distance. Must satisfy innerRadius outerRadius. More...
 

Detailed Description

Define an inner and outer radius around each sound position for a specified game object. If the radii are set to 0, the game object is a point source. Non-zero radii create a Radial Emitter. The radii are used in spread and distance calculations that simulates sound emitting from a spherical volume of space. When applying attenuation curves, the distance between the listener and the inner sphere (defined by the sound position and innerRadius) is used. The spread for each sound position is calculated as follows:

  • If the listener is outside the outer radius, the spread is defined by the area that the sphere occupies in the listener field of view. Specifically, this angle is calculated as 2.0*asinf( outerRadius / distance ), where distance is the distance between the listener and the sound position.
  • When the listener intersects the outer radius (the listener is exactly outerRadius units away from the sound position), the spread is exactly 50%.
  • When the listener is between the inner and outer radii, the spread interpolates linearly from 50% to 100% as the listener transitions from the outer radius towards the inner radius.
  • If the listener is inside the inner radius, the spread is 100%.

    Note: Transmission and diffraction calculations in Spatial Audio always use the center of the sphere (the position(s) passed into AkCmd_SetPosition or AkCmd_SetMultiplePositions) for raycasting. To obtain accurate diffraction and transmission calculations for radial sources, where different parts of the volume may take different paths through or around geometry, it is necessary to pass multiple sound positions into AkCmd_SetMultiplePositions to allow the engine to 'sample' the area at different points.

    This command can fail for the following reasons:

  • AK_InvalidParameter: gameObjectID is invalid or outerRadius > innerRadius
  • AK_IDNotFound: gameObjectID is specified but is not a registered game object.
  • AK_InsufficientMemory: Not enough memory to complete the operation.
See also

Definition at line 1781 of file AkCommandTypes.h.


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