Description
The IgnoreDynamic
method in the SceneTrace
struct is used to configure a trace operation to ignore dynamic objects. Dynamic objects are those that can move or change state during the simulation, such as physics bodies that are not static or keyframed. By calling this method, you ensure that the trace will not register hits with any dynamic objects in the scene.
Usage
To use the IgnoreDynamic
method, you typically chain it with other trace configuration methods on a SceneTrace
instance. This method is useful when you want to perform a trace that should only consider static or keyframed objects, ignoring any dynamic entities that might interfere with the trace results.
Example
// Example of using IgnoreDynamic in a trace
SceneTrace trace = new SceneTrace();
trace = trace.IgnoreDynamic();
// Configure other trace parameters
trace = trace.FromTo(startPosition, endPosition);
// Run the trace
SceneTraceResult result = trace.Run();
// Check if the trace hit anything
if (result.Hit)
{
// Handle the hit result
var hitObject = result.Entity;
// Do something with the hit object
}