Click or drag to resize
Ab4d.SharpEngine logo

LineSelectorDataGetClosestDistance Method

GetClosestDistance method calculates the closest distance of the line to the specified screenPosition. In case CheckBoundingBox is true (by default) the method returns float.MaxValue when the screenPosition is outside the bounding box. See remarks in the CheckBoundingBox for more info. Before calling this method the CalculateViewPositions method must be called. This method also sets the LastDistance property. To get the line segment index that is closest to the screenPosition read the LastLinePositionIndex property.

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 3.1.9316+94bbd23b55747f096f056a5602f7dd90558b3673
Syntax
C#
public float GetClosestDistance(
	Vector2 screenPosition,
	float maxSelectionDistance
)

Parameters

screenPosition  Vector2
2D position that will be used to calculate the distance to this line
maxSelectionDistance  Single
the distance at which the line will be selected (zero if user needs to be on the line)

Return Value

Single
distance of this line to the specified position; in case CheckBoundingBox is true (by default) the method returns float.MaxValue when the screenPosition is outside the bounding box
Remarks

[Missing <remarks> documentation for "M:Ab4d.SharpEngine.Utilities.LineSelectorData.GetClosestDistance(System.Numerics.Vector2,System.Single)"]

See Also