Struct ShapeHit
A shape found under a screen position by TryPick(Vector2, out ShapeHit, float) or PickAll(Vector2, float).
public readonly record struct ShapeHit : IEquatable<ShapeHit>
- Implements
- Inherited Members
Constructors
ShapeHit(object, Vector3, Vector2, float, float)
A shape found under a screen position by TryPick(Vector2, out ShapeHit, float) or PickAll(Vector2, float).
public ShapeHit(object Tag, Vector3 Point, Vector2 Local, float Distance, float Depth)
Parameters
TagobjectThe Tag the shape was drawn with.
PointVector3Where the pick lands on the shape: in world units, or in scaled pixels from the top left for a screen shape.
LocalVector2The same point in the shape's own plane coordinates - relative to the position it was drawn at, along the axes it was drawn with, in the units its vertices were given in - which is what a board or a chart converts into its content. Zero for a space stroke, which has no plane.
DistancefloatSigned distance from the point to the shape's outline, negative inside: world units in the shape's plane, or pixels for a screen shape or a space stroke. The border counts as part of the shape, so a pick on the outer half of the border has a small positive distance.
DepthfloatThe point's depth in the view, 0 at the near plane and 1 at the far one, for ordering; -1 for a screen shape, which is over everything.
Properties
Depth
The point's depth in the view, 0 at the near plane and 1 at the far one, for ordering; -1 for a screen shape, which is over everything.
public float Depth { get; init; }
Property Value
Distance
Signed distance from the point to the shape's outline, negative inside: world units in the shape's plane, or pixels for a screen shape or a space stroke. The border counts as part of the shape, so a pick on the outer half of the border has a small positive distance.
public float Distance { get; init; }
Property Value
Local
The same point in the shape's own plane coordinates - relative to the position it was drawn at, along the axes it was drawn with, in the units its vertices were given in - which is what a board or a chart converts into its content. Zero for a space stroke, which has no plane.
public Vector2 Local { get; init; }
Property Value
Point
Where the pick lands on the shape: in world units, or in scaled pixels from the top left for a screen shape.
public Vector3 Point { get; init; }
Property Value
Tag
The Tag the shape was drawn with.
public object Tag { get; init; }