PhysicsTraceBuilder PhysicsTrace

book_4_sparkGenerated
code_blocksInput

Description

The PhysicsTrace field in the SceneTrace struct is an instance of PhysicsTraceBuilder. It is used to configure and execute physics-based trace operations within a scene. This field allows you to set up various parameters for tracing, such as the shape, size, and filters, and then execute the trace to detect collisions or intersections with other objects in the scene.

Usage

To use the PhysicsTrace field, you typically start by configuring the trace parameters using the methods provided by PhysicsTraceBuilder. Once configured, you can execute the trace to determine if and where it intersects with other objects in the scene. This is useful for collision detection, raycasting, and other physics-based queries.

Example

// Example of using PhysicsTrace to perform a ray trace
SceneTrace trace = new SceneTrace();
trace.PhysicsTrace
    .FromTo(Vector3.Zero, new Vector3(0, 0, 100))
    .UsePhysicsWorld(true)
    .Run();