Description
The MeshTrace
property in the Editor.EditorTool
class provides a mechanism to perform a trace operation against the render meshes in the scene, excluding the physics world. This trace is executed using the current position of the mouse cursor. It is particularly useful in scenarios where you need to interact with or select visual elements in the scene without considering their physical properties.
Usage
To use the MeshTrace
property, you can access it from an instance of the EditorTool
class. This property returns a SceneTrace
object that can be used to determine what render mesh is under the mouse cursor at any given time.
Example usage:
var tool = new EditorTool();
var traceResult = tool.MeshTrace;
if (traceResult.Hit)
{
// Handle the trace hit, e.g., select the object
var hitObject = traceResult.Entity;
// Perform operations with hitObject
}
Example
var tool = new EditorTool();
var traceResult = tool.MeshTrace;
if (traceResult.Hit)
{
// Handle the trace hit, e.g., select the object
var hitObject = traceResult.Entity;
// Perform operations with hitObject
}