Description
The CursorRay
property of the SceneRenderingWidget
class provides a Ray
that represents the direction and origin of a ray cast from the current cursor position within the scene. This is useful for determining what objects or surfaces the cursor is pointing at in a 3D space.
Usage
To use the CursorRay
property, you need to have an instance of the SceneRenderingWidget
class. Access the property directly to get the ray corresponding to the current cursor position. This can be used in various scenarios such as object selection, interaction, or determining the point of intersection with scene geometry.
Example
// Assuming 'sceneWidget' is an instance of SceneRenderingWidget
Ray cursorRay = sceneWidget.CursorRay;
// Use the ray to perform a raycast or other operations
// For example, checking intersection with objects in the scene
var hitInfo = sceneWidget.Scene.Raycast(cursorRay);
if (hitInfo != null)
{
// Process the hit information
var hitObject = hitInfo.Entity;
// Perform actions based on the hit object
}