Click or drag to resize
AB4D logo

LineSelectorDataGetClosestDistance(Point, Double) Method

GetClosestDistance method calculates the closest distance of the line used to create this LineSelectorData to the specified position. In case CheckBoundingBox is true the method returns float.MaxValue when the screenPosition is outside the bounding box. This method also sets LastDistance, LastLinePositionIndex, LastClosestPositionOnLine and LastDistanceFromCamera properties. Before calling this method the CalculateScreenSpacePositions method must be called.

Namespace: Ab3d.Utilities
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public double GetClosestDistance(
	Point screenPosition,
	double maxSelectionDistance
)

Parameters

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

Return Value

Double
distance of this line to the specified position
See Also