Table of Contents

Class PickResult

Namespace
Stride.CommunityToolkit.Effects.Picking
Assembly
Stride.CommunityToolkit.Effects.dll

What a GpuPicker found under a screen point: nothing, or a mesh and where on it.

public sealed record PickResult : IEquatable<PickResult>
Inheritance
PickResult
Implements

Constructors

PickResult(int, Vector2, Entity?, ModelComponent?, int, int, int, float, Vector3?)

What a GpuPicker found under a screen point: nothing, or a mesh and where on it.

public PickResult(int Sequence, Vector2 ScreenPosition, Entity? Entity, ModelComponent? ModelComponent, int MeshIndex, int MaterialIndex, int InstanceIndex, float Depth, Vector3? WorldPosition)

Parameters

Sequence int

Counts the picker's answers, so a caller can tell a new answer from the one it already handled.

ScreenPosition Vector2

The point that was asked about, normalised over the viewport with (0, 0) at the top left, as the request gave it.

Entity Entity

The entity whose mesh is under the point, or null for the background.

ModelComponent ModelComponent

The model component that drew the pixel, or null.

MeshIndex int

Which of the model's meshes.

MaterialIndex int

Which of the model's materials that mesh uses.

InstanceIndex int

For an instanced model, which instance; 0 otherwise.

Depth float

The pixel's depth as the depth buffer holds it, 0 at the near plane and 1 at the far plane; 1 for the background.

WorldPosition Vector3?

The point on the mesh's surface under the screen point, rebuilt from the depth, or null for the background.

Properties

Depth

The pixel's depth as the depth buffer holds it, 0 at the near plane and 1 at the far plane; 1 for the background.

public float Depth { get; init; }

Property Value

float

Entity

The entity whose mesh is under the point, or null for the background.

public Entity? Entity { get; init; }

Property Value

Entity

Hit

Whether a mesh was under the point at all.

public bool Hit { get; }

Property Value

bool

InstanceIndex

For an instanced model, which instance; 0 otherwise.

public int InstanceIndex { get; init; }

Property Value

int

MaterialIndex

Which of the model's materials that mesh uses.

public int MaterialIndex { get; init; }

Property Value

int

MeshIndex

Which of the model's meshes.

public int MeshIndex { get; init; }

Property Value

int

ModelComponent

The model component that drew the pixel, or null.

public ModelComponent? ModelComponent { get; init; }

Property Value

ModelComponent

ScreenPosition

The point that was asked about, normalised over the viewport with (0, 0) at the top left, as the request gave it.

public Vector2 ScreenPosition { get; init; }

Property Value

Vector2

Sequence

Counts the picker's answers, so a caller can tell a new answer from the one it already handled.

public int Sequence { get; init; }

Property Value

int

WorldPosition

The point on the mesh's surface under the screen point, rebuilt from the depth, or null for the background.

public Vector3? WorldPosition { get; init; }

Property Value

Vector3?