Trace SkipToolsMaterials()

book_4_sparkGenerated
code_blocksInput

Description

The SkipToolsMaterials method is part of the Editor.Trace struct and is used to configure a trace operation to ignore materials that are marked with the tools.toolsmaterial attribute. This is particularly useful when you want to perform trace operations that should not interact with certain tool-specific materials, allowing for more precise and relevant trace results.

Usage

To use the SkipToolsMaterials method, you need to call it on an instance of the Editor.Trace struct. This method modifies the trace configuration to skip over any materials that are designated as tool materials. This is typically used in scenarios where you want to perform a trace operation that should not be affected by tool-specific materials, such as when performing collision detection or raycasting in a game editor environment.

Example

// Example of using SkipToolsMaterials in a trace operation
Editor.Trace trace = new Editor.Trace();
trace = trace.SkipToolsMaterials();

// Assuming you have a world object to trace against
Editor.MapDoc.MapWorld world = GetWorld();
Editor.TraceResult result = trace.Run(world);

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