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.2.9386+3a404a3e1ebfa4efd231da7fe6f10dfb23b95dc4
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