SceneTrace IgnoreDynamic()

book_4_sparkGenerated
code_blocksInput

Description

The IgnoreDynamic method in the SceneTrace struct is used to configure a trace to ignore dynamic objects. This means that when the trace is executed, it will not register hits with any objects that are considered dynamic within the scene. This can be useful for scenarios where you want to focus on static or other types of objects and exclude dynamic ones from the trace results.

Usage

To use the IgnoreDynamic method, you typically chain it with other trace configuration methods on a SceneTrace instance. This method does not take any parameters and returns the modified SceneTrace instance, allowing for fluent configuration.

Example

// Example of using IgnoreDynamic in a SceneTrace
SceneTrace trace = new SceneTrace();
trace = trace.IgnoreDynamic();

// Configure other trace settings
trace = trace.FromTo(startPosition, endPosition);

// Run the trace
SceneTraceResult result = trace.Run();

// Check if the trace hit anything
if (result.Hit)
{
    // Handle the hit
}