Class PickResult
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
SequenceintCounts the picker's answers, so a caller can tell a new answer from the one it already handled.
ScreenPositionVector2The point that was asked about, normalised over the viewport with (0, 0) at the top left, as the request gave it.
EntityEntityThe entity whose mesh is under the point, or null for the background.
ModelComponentModelComponentThe model component that drew the pixel, or null.
MeshIndexintWhich of the model's meshes.
MaterialIndexintWhich of the model's materials that mesh uses.
InstanceIndexintFor an instanced model, which instance; 0 otherwise.
DepthfloatThe pixel's depth as the depth buffer holds it, 0 at the near plane and 1 at the far plane; 1 for the background.
WorldPositionVector3?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
Entity
The entity whose mesh is under the point, or null for the background.
public Entity? Entity { get; init; }
Property Value
Hit
Whether a mesh was under the point at all.
public bool Hit { get; }
Property Value
InstanceIndex
For an instanced model, which instance; 0 otherwise.
public int InstanceIndex { get; init; }
Property Value
MaterialIndex
Which of the model's materials that mesh uses.
public int MaterialIndex { get; init; }
Property Value
MeshIndex
Which of the model's meshes.
public int MeshIndex { get; init; }
Property Value
ModelComponent
The model component that drew the pixel, or null.
public ModelComponent? ModelComponent { get; init; }
Property Value
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
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
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; }