An Unreal Engine 5 Plugin for in-air acoustic simulation using Hardware-Accelerated Ray Tracing, an Unreal Engine implementation of the original SonoTraceLab.
This branch has the plugin source code and is packaged in a sample Unreal Project with some example levels for testing the plugin. See other branches that only include the plugin so you can easily checkout those branches into your own Unreal projects.
SonoTraceUE is a high-fidelity acoustic simulation plugin for Unreal Engine 5 that leverages hardware-accelerated ray tracing to simulate ultrasonic sensor behavior in complex 3D environments. The plugin provides physically-based acoustic propagation modeling, including specular reflection, diffraction components, and direct path transmission, making it suitable for research in robotics, autonomous systems, and acoustic sensor development. It has an API extension so it can be interfaced with from a external API client.
- Unreal Engine Version: 5.4 or higher
- Hardware Requirements:
- GPU with hardware ray tracing support
- DirectX 12 support
- Operating System: Windows for now due to DirectX 12 requirement
Hardware ray tracing must be enabled in Unreal Engine for this plugin to function correctly:
- Open Project Settings → Engine → Rendering
- Under Hardware Ray Tracing, enable:
- ☑ Support Hardware Ray Tracing
- ☑ Ray Traced Shadows
- Restart the editor after enabling these settings
You can add it directly through the Place Actors panel or through a blueprint as a component for example.
- In the Content Browser, create a new Data Asset of type
SonoTraceUEInputSettingsData - Configure all settings such as the the emitter and receiver positions (see Input Settings Configuration), simulation parameters, object configuration and optionally visualisation and debugging settings.
- Assign this Data Asset to the
InputSettingsproperty of your SonoTraceUEActor.
- Automatic Mode: Set
EnableRunSimulationOnlyOnTriggertofalsefor continuous simulation at the specified rate - Manual Mode: Keep
EnableRunSimulationOnlyOnTriggerastrueand callTriggerSimulation()via Blueprint or C++ or the API.
There are 3 levels in this sample Unreal Project. They can all be found in the /Content/SonoTraceUE/Levels folder. They all us the same InterfaceSettings and CustomObjectSettings to load in the API and objects settings respectively.
- Default: Loaded by default in the Unreal Editor. Mostly tests different mesh types and uses an active sensor controlled by the user input.
- Passive: as the name says, it uses only direct mode to sense passive with a moving source and a static receiver array.
- Test: a simple scene with some objects types, no simulation is performed. Only to show the curvature calculation for certain object types and how they are made.
In this mode the SonoTraceUEActor is attached to the player UPawn. It is using the ActiveInputSettings as found in the /Content/SonoTraceUE/ folder. The environement is filled with objects of different types (static, skeletal, landscape, with/without nanite,etc.) for testing purposes. There are also a few custom blueprints that dynamicly spawn and move objects.
When pressing play, the user can test a of the functions of the SonoTraceUEActor class. For the source code, check the Event Graph of /Content/SonoTraceUE/Blueprints/SonoTraceUEPawn.
- Pressing Y toggles the measurement triggers through mouse clicking
- Pressing the left mouse button triggers a measurement with the default active emitter
- Pressing the right mouse button triggers a measurement with the override emitter index
- Use + & - on the numpad to control the override active emitter index
- Use / & * on the numpad to control the default active emitter index
- Pressing U will change the sensor's relative transform with a small fixed offset
- Pressing I will change the sensor's world transform with a small fixed offset
- Pressing O will change the sensor's owner (the Pawn) transform with a small fixed offset
In this mode the SonoTraceUEActor is a component of a blueprint actor in the world, see the Event Graph in the /Content/SonoTraceUE/Blueprints/PassiveStaticSonoTraceUEObject blueprint. It is using the PassiveInputSettings as found in the /Content/SonoTraceUE/ folder.
In this environment, a static receiver array is laying on the ground surface. An emitter source is constantly moving at a fixed rate between a left and right limit next to the cone (which blocks the line of sight between receivers and emitter). In this mode only direct path simulation is done. Additional blueprint code makes one single receiver also move up and down to show this blueprint functionality as well.
In this mode the SonoTraceUEActor is directly placed in the world. It is using the TestInputSettings as found in the /Content/SonoTraceUE/ folder. The simulation is disabled as this environment is mostly to show the curvature calculation with the debug visualisation of different mesh objects. It shows the limitations of the curvature calculation for very simplistic low resolution meshes compared to more custom-made meshes with more definition near edges.
By default, skeletal meshes should have diffraction disabled as the diffraction is based on the initial frame pre-calculation location of all triangles, and animations and deformations are not taking into account. Enable with:
InputSettings->EnableDiffractionForDynamicObjects = true;While within Unreal Engine (c++ and blueprint), all data uses the Unreal Engine coordinate system and its units: Left-handed Z-up coordinate system
- X: Forward
- Y: Right
- Z: Up All coordinates use centimeters unless otherwise specified.
Sensor Frame vs World Frame:
- Set
PointsInSensorFrame = truefor ego-centric coordinates (robotics applications) - Set
PointsInSensorFrame = falsefor world-space coordinates
Emitter signals are defined as FloatCurve objects. You can load them in from CSV files. To do so, drag in a CSV file into the content browser and choose the FloatCurve class. An example CSV file can be found here.
To easily load in coordinates one can use our custom DataTable structure called SonoTraceUECoordinateTable. You can load them in from CSV files. To do so, drag in a CSV file into the content browser and choose the DataTable class and set the row type to SonoTraceUECoordinateTable. An example CSV file can be found here.
To define the BRDF properties of objects one can use our custom DataTable structure called FSonoTraceUEObjectSettingsTable. To create one:
- Create a
DataTablewith row structureFSonoTraceUEObjectSettingsTable - Add rows for each mesh asset (StaticMesh or SkeletalMesh)
- Configure BRDF and material properties per object. You can also set other settings like a description.
all other objects will use the default settings as set in the Input Settings.
The primary actor class that manages the entire acoustic simulation pipeline. This section will go over its properties and functions.
| Property | Type | Description |
|---|---|---|
InputSettings |
USonoTraceUEInputSettingsData* |
Main configuration data asset for simulation parameters |
InterfaceSettings |
USonoTraceUEInterfaceSettingsData* |
Configuration for TCP/IP interface |
EnableSimulationEnableOverride |
bool |
Override simulation enable state from InputSettings |
EnableInterfaceEnableOverride |
bool |
Override interface settings |
GeneratedSettings |
FSonoTraceUEGeneratedInputStruct |
Read-only generated/processed settings |
CurrentOutput |
FSonoTraceUEOutputStruct |
Most recent simulation output |
bool TriggerSimulation()Triggers a single execution of the simulation. Requires EnableRunSimulationOnlyOnTrigger to be enabled.
Returns: true if simulation was successfully triggered.
bool TriggerSimulationOverrideEmitterSignals(const TArray<int32> OverrideEmitterSignalIndexes)Triggers simulation with temporary override of which signal each emitter uses. The override is only active for this single measurement.
Parameters:
OverrideEmitterSignalIndexes: Array of signal indices matching the number of emitters
Returns: true if successful.
bool SetCurrentEmitterSignalIndexes(TArray<int32> EmitterSignalIndexes)Sets the active emitter signal for all emitters persistently.
Parameters:
EmitterSignalIndexes: Array of signal indices (must match emitter count)
Returns: true if all indices were valid and set successfully.
TArray<int32> GetCurrentEmitterSignalIndexes()Returns the currently active emitter signal index for each emitter.
bool SetCurrentEmitterSignalIndexForSpecificEmitter(int32 EmitterIndex, int32 EmitterSignalIndex)Sets the emitter signal for a single specific emitter.
Parameters:
EmitterIndex: Index of the emitter to modifyEmitterSignalIndex: Index of the signal to use
int32 GetCurrentEmitterSignalIndexForSpecificEmitter(int32 EmitterIndex)Gets the active signal index for a specific emitter.
int32 GetEmitterSignalCount() constReturns the total number of available emitter signals defined in InputSettings.
bool AddActor(AActor* Actor)Adds an actor and all its mesh components to the acoustic simulation. The plugin automatically parses child components and generates mesh data for acoustic analysis.
Parameters:
Actor: The actor to add to simulation
Returns: true if successfully added.
bool AddStaticMeshComponent(UStaticMeshComponent* MeshComponent, FString ObjectNamePrefix)Manually adds a specific static mesh component to the simulation.
Parameters:
MeshComponent: The static mesh component to addObjectNamePrefix: Prefix for labeling (typically the owning actor's name)
bool AddSkeletalMeshComponent(USkeletalMeshComponent* MeshComponent, FString ObjectNamePrefix)Manually adds a specific skeletal mesh component to the simulation.
bool RemoveActor(AActor* Actor)Removes an actor and all its mesh components from simulation.
bool RemoveStaticMeshComponent(UStaticMeshComponent* MeshComponent)Removes a specific static mesh component.
bool RemoveSkeletalMeshComponent(USkeletalMeshComponent* MeshComponent)Removes a specific skeletal mesh component.
bool SetNewEmitterPositions(const TArray<int32>& EmitterIndexes,
const TArray<FVector>& NewEmitterPositions,
const bool RelativeTransform = false,
const bool ReApplyOffset = true)Dynamically updates emitter positions during runtime.
Parameters:
EmitterIndexes: Indices of emitters to modifyNewEmitterPositions: New positions in centimeters (left-handed UE coordinate system)RelativeTransform: Iftrue, treats positions as translation offsets from current positionReApplyOffset: Iftrue, reapplies the global emitter offset from InputSettings
bool SetNewReceiverPositions(const TArray<int32>& ReceiverIndexes,
const TArray<FVector>& NewReceiverPositions,
const bool RelativeTransform = false,
const bool ReApplyOffset = true)Dynamically updates receiver positions. Uses final generated receiver positions (after emitter pattern generation if enabled).
bool SetNewSensorRelativeTransform(const FVector& NewSensorToOwnerTranslation,
const FRotator& NewSensorToOwnerRotator)Updates the sensor's transform relative to its owner actor.
bool SetNewSensorWorldTransform(const FVector& NewSensorTranslation,
const FRotator& NewSensorRotator,
const ETeleportType Teleport = ETeleportType::None)Sets the sensor's absolute world transform.
Parameters:
Teleport: Physics teleportation behavior (affects physics simulation)
bool SetNewSensorOwnerWorldTransform(const FVector& NewOwnerTranslation,
const FRotator& NewOwnerRotator,
const ETeleportType Teleport = ETeleportType::None)Sets the sensor owner's absolute world transform (if owner exists).
See here for more information on what the API is.
bool SendInterfaceDataMessage(const int32 Type,
const TArray<int32> Order,
const TArray<FString> Strings,
const TArray<int32> Integers,
const TArray<float> Floats)Sends a custom data message over the API.
Parameters:
Type: Message type identifierOrder: Array specifying data order (0=String, 1=Integer, 2=Float)Strings: String data arrayIntegers: Integer data arrayFloats: Float data array
Returns: true if message sent successfully.
Example:
// Send a message with type 100, containing "Hello" and the value 42.5
TArray<int32> Order = {0, 2}; // String first, then Float
TArray<FString> Strings = {"Hello"};
TArray<int32> Integers = {};
TArray<float> Floats = {42.5f};
Actor->SendInterfaceDataMessage(100, Order, Strings, Integers, Floats);UPROPERTY(BlueprintAssignable)
FInterfaceDataMessageReceivedEvent InterfaceDataMessageReceivedEventDelegate Signature:
void OnInterfaceDataMessageReceived(int32 Type,
const TArray<int32>& Order,
const TArray<FString>& Strings,
const TArray<int32>& Integers,
const TArray<float>& Floats)Broadcasts when a data message is received via the TCP interface. Bind to this event in Blueprint or C++ to handle incoming messages.
The USonoTraceUEInputSettingsData class is the central configuration hub for the simulation. Create instances as Data Assets in the Content Browser.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Emitter")
TArray<FRuntimeFloatCurve> EmitterSignalsDefines the emitter signals using Float Curves. Each curve represents a signal waveform that can be assigned to emitters.
Usage:
- In the Details panel, add entries to the
EmitterSignalsarray - For each entry, you can add a reference to a Float Curve. Read here on how to create one.
- The first signal (index 0) is considered the default
- Signals can be switched per-emitter at runtime using the emitter signal management functions
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Emitter")
FVector EmitterPositionsOffsetGlobal offset applied to all emitter coordinates (in centimeters, UE left-handed system).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Emitter")
bool EnableEmitterPositionsDataTableWhen true, loads emitter positions from a DataTable. When false, uses manually defined positions. Read here on how to create one.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Emitter")
UDataTable* EmitterPositionsDataTableReference to a DataTable with row type FSonoTraceUECoordinateTable for loading emitter positions. Read here on how to create one.
Creating a Coordinate DataTable:
- Create a new DataTable asset in the Content Browser
- Select
SonoTraceUECoordinateTableas the row structure - Populate with coordinate data or import from CSV
CSV Format:
RowName,X,Y,Z
Emitter_0,0.0,5.0,0.0
Emitter_1,0.0,-5.0,0.0
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Emitter")
TArray<FVector> EmitterPositionsManually defined emitter positions (used when EnableEmitterPositionsDataTable is false).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Emitter")
TArray<int32> DefaultEmitterSignalIndexesSpecifies which signal each emitter uses. Must match the number of emitters. If empty, all emitters default to signal index 0.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Receivers")
bool EnableStaticReceiversWhen true, receiver positions are fixed and not updated every frame (performance optimization).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Receivers")
bool EnableUseWorldCoordinatesReceiversApplicable only when EnableStaticReceivers is true. Interprets receiver positions as world coordinates rather than sensor-relative.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Receivers")
FVector ReceiverPositionsOffsetGlobal offset applied to all receiver coordinates.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Receivers")
bool EnableReceiverPositionsDataTableToggle between DataTable-based and manual receiver position definition. Read here on how to create one.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Receivers")
UDataTable* ReceiverPositionsDataTableDataTable for loading receiver positions (same structure as emitter positions). Read here on how to create one.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Receivers")
TArray<FVector> ReceiverPositionsManually defined receiver positions.
The plugin can automatically generate a circular array pattern around each loaded receiver position to create a virtual receiver array to simulate the emitter derectivity better.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Receivers|EmitterPattern")
bool EnableEmitterPatternSimulationEnables circular array pattern generation.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Receivers|EmitterPattern")
float EmitterPatternRadiusRadius of the circular pattern (in centimeters).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Receivers|EmitterPattern")
float EmitterPatternSpacingSpacing between generated receiver points (in centimeters).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Receivers|EmitterPattern")
bool EmitterPatternHexagonalLatticeWhen true, uses hexagonal lattice instead of square lattice for pattern generation.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Receivers|EmitterPattern")
ESonoTraceUEArrayPlaneEnum EmitterPatternPlaneDefines the plane for circular array generation:
YZ: Y-Z plane (X = 0) — defaultXZ: X-Z plane (Y = 0)XY: X-Y plane (Z = 0)
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
bool EnableSimulationMaster toggle for the entire simulation.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
bool EnableRaytracingEnables hardware ray tracing. Automatically enabled if specular component calculation is active.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
bool EnableSpecularComponentCalculationCalculates specular reflections using ray tracing.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
bool EnableDiffractionComponentCalculationCalculates diffraction components.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
bool EnableDirectPathComponentCalculationCalculates direct line-of-sight transmission between emitters and receivers, for passive sensing.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
bool EnableRunSimulationOnlyOnTriggerWhen true, simulation only runs when explicitly triggered via TriggerSimulation(). When false, runs continuously at SimulationRate.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
bool PointsInSensorFrameWhen true, output point coordinates are in sensor-relative frame. When false, uses world frame.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
bool EnableSimulationSubOutputEnables detailed sub-outputs for individual components (specular, diffraction, direct path). Disabled by default for performance.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
float SimulationRateTarget simulation rate in Hz when not running on trigger mode.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
int32 NumberOfSimFrequenciesNumber of frequency bins for simulation.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
int32 MinimumSimFrequencyLower bound of frequency range in Hz.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
int32 MaximumSimFrequencyUpper bound of frequency range in Hz.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
int32 SampleRateSample rate in Hz for impulse response generation.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
float SpeedOfSoundSpeed of sound in m/s (default: 343 m/s for air at 20°C).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
float DirectPathStrengthBase transmission strength for direct path calculations.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
float SpecularMinimumStrengthMinimum strength threshold for saving specular reflection points (filters weak reflections).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
float DiffractionMinimumStrengthMinimum summed strength threshold for diffraction points.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
float DiffractionTriangleSizeThresholdMinimum triangle size (cm²) for diffraction consideration.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
int32 DiffractionSimDivisionFactorDivision factor for diffraction sampling rate (higher = fewer samples, faster computation).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
bool EnableDiffractionLineOfSightRequiredWhen true, enforces line-of-sight check between diffraction points and emitters.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
bool EnableDiffractionForDynamicObjectsEnables diffraction calculation for skeletal meshes. See here for info.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
bool EnableSpecularSimulationOnlyOnLastHitsOptimization: only calculates BRDF for the final bounce of each ray.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|General")
int32 MeshDataGenerationAttemptsNumber of ticks to attempt mesh data generation before timeout (default: 5).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Objects")
UDataTable* ObjectSettingsDataTableReferences a DataTable with row type FSonoTraceUEObjectSettingsTable for per-object acoustic properties. See here on how to make one.
FSonoTraceUEObjectSettingsTable Structure:
| Field | Type | Description |
|---|---|---|
Asset |
UObject* |
Reference to StaticMesh or SkeletalMesh |
Description |
FString |
Human-readable description |
ObjectSettings |
FSonoTraceUEObjectSettingsOriginStruct |
Acoustic properties (see below) |
DrawDebugFirstOccurrence |
bool |
Enable debug visualization for first instance |
FSonoTraceUEObjectSettingsOriginStruct (Acoustic Properties):
BRDF Settings:
BrdfTransitionPosition(0-1): Transition point between specular and diffraction regimesBrdfTransitionSlope: Steepness of transitionBrdfExponentSpecularStart/End: Specular BRDF exponent rangeBrdfExponentDiffractionStart/End: Diffraction BRDF exponent range
Material Settings:
MaterialsTransitionPosition: Similar to BRDF transitionMaterialSTransitionSlope: Transition steepnessMaterialStrengthSpecularStart/End: Specular reflection strength rangeMaterialStrengthDiffractionStart/End: Diffraction reflection strength range
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Objects")
FSonoTraceUEObjectSettingsOriginStruct ObjectSettingsDefaultDefault acoustic properties applied to objects not in the ObjectSettingsDataTable.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Objects")
float CurvatureScaleGlobal scaling factor for curvature magnitude calculations.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Objects")
bool EnableCurvatureTriangleSizeBasedScalerApplies size-dependent scaling to curvature calculations.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Objects")
float CurvatureScalerMinimumEffectMinimum scaling factor for very small triangles (0-1).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Objects")
float CurvatureScalerMaximumEffectMaximum scaling factor for large triangles (≥1).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Objects")
float CurvatureScalerLowerTriangleSizeThresholdTriangle size (cm²) below which minimum scaling applies.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Objects")
float CurvatureScalerUpperTriangleSizeThresholdTriangle size (cm²) above which maximum scaling applies.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Raytracing")
float SensorLowerAzimuthLimitLower azimuth angle limit in degrees (-90 to 90, left-handed coordinate system).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Raytracing")
float SensorUpperAzimuthLimitUpper azimuth angle limit in degrees.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Raytracing")
float SensorLowerElevationLimitLower elevation angle limit in degrees (-90 to 90).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Raytracing")
float SensorUpperElevationLimitUpper elevation angle limit in degrees.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Raytracing")
int32 NumberOfInitialRaysNumber of rays cast per simulation. Higher values increase simulationr resolution but reduce performance.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Raytracing")
float MaximumRayDistanceMaximum ray propagation distance in centimeters.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Configuration|Simulation|Raytracing")
int32 MaximumBouncesMaximum number of ray bounces/reflections (1-10).
The plugin provides extensive visualization capabilities. There is both standard visualisation which happens for the latest triggered (manually or automatic) measurement, as well as debug which is running constantly.
This shows the result for the latest triggered (manually or automatic) measurement.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw")
bool EnableDrawMaster toggle for standard visualization.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw")
bool EnableDrawSensorPoseDraws sensor coordinate system.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw")
bool EnableDrawSensorFrustumDraws sensor field-of-view frustum.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw")
bool EnableDrawAllEmittersDraws all emitter positions as purple points.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw")
bool EnableDrawLoadedReceiversDraws configured receiver positions as orange points (before pattern generation).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw")
bool EnableDrawAllReceiversDraws all receivers including pattern-generated ones as yellow points.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw")
bool EnableDrawDirectPathLOSDraws green/red points on receivers based on direct path line-of-sight.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw")
bool EnableDrawPointsDraws acoustic reflection/diffraction points.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw")
int32 MaximumDrawNumberMaximum number of points/rays to draw (0-10,000) for performance.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw")
bool RandomizeDrawSelectionRandomizes which subset of points/rays are drawn. If false, uses fixed step size.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw")
ESonoTraceUESimulationDrawColorModeEnum DrawPointsColorModeColor mode for point visualization:
Static: UsesDrawDefaultPointsColorTotalDistance: Colors by total acoustic path lengthSensorDistance: Colors by distance to sensorStrength: Colors by reflection strengthCurvature: Colors by surface curvature at reflection point
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw")
ESonoTraceUESimulationDrawSizeModeEnum DrawPointsSizeModePoint size mode:
Static: UsesDrawDefaultPointsSizeStrength: Scales point size by reflection strength
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw|Details")
int32 DrawDefaultPointsSizeDefault point size in pixels.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw|Details")
FColor DrawDefaultPointsColorDefault point color (RGB).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Draw|Details")
ESonoTraceUEColorMapEnum DrawPointsColorMapColor map for data-driven coloring:
Parula(default)HotJetViridis- And others (see
ColorMaps.h)
The debug drawing system provides more detailed visualization for development and analysis and is running all the time.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Debug")
bool EnableDebugLogExecutionTimesLogs execution times for performance profiling.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Debug")
bool EnableDrawDebugMaster toggle for debug visualization.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Debug")
bool EnableDrawDebugRaysHitLinesDraws ray paths as green lines.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Debug")
bool EnableDrawDebugRaysHitPointsDraws ray hit points as green dots.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Debug")
bool EnableDrawDebugRaysLastHitReflectionDraws blue vectors showing reflection direction from final ray hit.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Debug")
bool EnableDrawDebugRaysInitialMissesDraws rays that missed geometry in red.
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Debug")
bool EnableDrawDebugMeshDataVisualizes pre-calculated mesh analysis data (curvature, BRDF, etc.).
UPROPERTY(EditAnywhere, Category = "SonoTraceUE|Debug")
ESonoTraceUEMeshModeEnum DrawDebugMeshColorModeMesh data visualization mode:
Curvature: Shows surface curvature magnitudeSurfaceBRDF: Shows BRDF opening angleSurfaceMaterial: Shows reflection strengthNormal: Shows surface normals as RGBSize: Shows triangle size
The primary output structure containing simulation results.
| Field | Type | Description |
|---|---|---|
ReflectedPoints |
TArray<FSonoTraceUEPointStruct> |
All reflection/diffraction points combined |
MaximumStrength |
float |
Maximum reflection strength in output |
MaximumCurvature |
float |
Maximum curvature value in output |
MaximumTotalDistance |
float |
Maximum acoustic path length |
EmitterSignalIndexes |
TArray<int32> |
Active signal index per emitter for this measurement |
SensorLocation |
FVector |
Sensor world location |
SensorRotation |
FRotator |
Sensor world rotation |
SensorToOwnerTranslation |
FVector |
Relative translation to owner |
SensorToOwnerRotation |
FRotator |
Relative rotation to owner |
OwnerLocation |
FVector |
Owner world location |
OwnerRotation |
FRotator |
Owner world rotation |
EmitterPoses |
TArray<FTransform> |
Emitter transforms |
ReceiverPoses |
TArray<FTransform> |
Receiver transforms |
DirectPathLOS |
TArray<bool> |
Line-of-sight status per receiver (when using direct mode) |
Timestamp |
double |
Simulation timestamp |
Index |
int32 |
Sequential measurement index |
If EnableSimulationSubOutput is enabled:
SpecularSubOutput: Specular component onlyDiffractionSubOutput: Diffraction component onlyDirectPathSubOutput: Direct path component only
Represents a single acoustic reflection/diffraction/transmission point.
| Field | Type | Description |
|---|---|---|
Location |
FVector |
3D position of point |
ReflectionDirection |
FVector |
Direction of acoustic reflection |
Label |
FName |
Object label (from component name) |
Index |
int |
Sequential point index |
SummedStrength |
float |
Total strength across all frequencies |
Strengths |
TArray<float> |
Strength values per emitter, receiver, and frequency (C++ only) |
TotalDistance |
float |
Total acoustic path length (cm) |
TotalDistancesFromEmitters |
TArray<float> |
Path length per emitter |
DistanceToSensor |
float |
Direct distance to sensor (cm) |
ObjectTypeIndex |
int |
Index into ObjectSettings array |
IsHit |
bool |
true if ray hit geometry |
IsLastHit |
bool |
true if final bounce in ray path |
CurvatureMagnitude |
float |
Surface curvature at hit point |
SurfaceBRDF |
float* |
BRDF opening angle data pointer (C++ only) |
SurfaceMaterial |
float* |
Reflection strength data pointer (C++ only) |
IsSpecular |
bool |
true if from specular component |
IsDiffraction |
bool |
true if from diffraction component |
IsDirectPath |
bool |
true if from direct path component |
Note: Advanced fields like Strengths (per-emitter, per-receiver, per-frequency) and SurfaceBRDF/SurfaceMaterial pointers are available in C++ but not exposed to Blueprint.
Contains processed/generated settings derived from InputSettings.
| Field | Type | Description |
|---|---|---|
AzimuthAngles |
TArray<float> |
Generated ray azimuth angles |
ElevationAngles |
TArray<float> |
Generated ray elevation angles |
LoadedEmitterPositions |
TArray<FVector> |
Original loaded emitter positions |
FinalEmitterPositions |
TArray<FVector> |
Final emitter positions (after offsets) |
LoadedReceiverPositions |
TArray<FVector> |
Original loaded receiver positions |
FinalReceiverPositions |
TArray<FVector> |
Final receiver positions (after pattern generation) |
ObjectSettings |
TArray<FSonoTraceUEObjectSettingsStruct> |
Processed object acoustic settings |
Frequencies |
TArray<float> |
Simulation frequency bins |
DefaultEmitterSignalIndexes |
TArray<int32> |
Active signal index per emitter |
A socket-based API is available to access SonoTraceUE with third-party tools. Currently a Matlab Client API is available here. You will find more information there on how to control the simulation from the API client.
The USonoTraceUEInterfaceSettingsData class configures the TCP/IP network interface for external control and data acquisition.
UPROPERTY(EditAnywhere, Category = "Connection")
bool EnableInterfaceEnables the TCP interface. Must be true for remote communication.
UPROPERTY(EditAnywhere, Category = "Connection")
FString InterfaceIPIP address for the TCP server (default: "localhost"). Use "0.0.0.0" to listen on all interfaces.
UPROPERTY(EditAnywhere, Category = "Connection")
int32 InterfacePortTCP port number (1024-65535, default: 9099).
UPROPERTY(EditAnywhere, Category = "Connection")
bool EnableSubOutputEnables detailed sub-component output over the interface. Increases data throughput.
The TCP interface supports the following operations:
- Settings Retrieval: Client can request and receive full input settings configuration
- Measurement Triggering: Remotely trigger simulations and receive output data
- Transformation Control: Set sensor/emitter/receiver positions remotely
- Custom Data Messages: Bidirectional communication of custom data structures using the data message system
The data message system allows flexible communication of mixed-type data:
Structure:
- Type (
int32): Self-chosen message identifier - Order (
TArray<int32>): Specifies data sequence (0=String, 1=Integer, 2=Float) - Strings (
TArray<FString>): String payloads - Integers (
TArray<int32>): Integer payloads - Floats (
TArray<float>): Float payloads
Sending from UE (Blueprint/C++):
TArray<int32> Order = {0, 1, 2}; // String, Integer, Float
TArray<FString> Strings = {"Status"};
TArray<int32> Integers = {42};
TArray<float> Floats = {3.14f};
SonoTraceActor->SendInterfaceDataMessage(100, Order, Strings, Integers, Floats);Receiving in UE (Blueprint):
Bind to the InterfaceDataMessageReceivedEvent delegate on the SonoTraceUEActor.
This project is released under the MIT License.
The SonoTraceUE Unreal Engine Plugin uses code from the ObjectDeliverer plugin v1.8.0 which also uses the MIT License.