Table of Contents

Struct ShapeHit

Namespace
Stride.CommunityToolkit.Shapes
Assembly
Stride.CommunityToolkit.Shapes.dll

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

Tag object

The Tag the shape was drawn with.

Point Vector3

Where the pick lands on the shape: in world units, or in scaled pixels from the top left for a screen shape.

Local Vector2

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.

Distance float

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.

Depth float

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.

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

float

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

float

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

Vector2

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

Vector3

Tag

The Tag the shape was drawn with.

public object Tag { get; init; }

Property Value

object