Click or drag to resize

UtilBoundedSnapTo Method (Vector2, Vector2, Vector2)

Return the point in the line segment [v1,v2] that is closest to the point 'p'

Namespace:  Demo3D.Common
Assembly:  Demo3D.Common (in Demo3D.Common.dll) Version: 15.0.2.11458
Syntax
C#
public static Vector2 BoundedSnapTo(
	Vector2 p,
	Vector2 v1,
	Vector2 v2
)

Parameters

p
Type: Microsoft.DirectXVector2
Value to test
v1
Type: Microsoft.DirectXVector2
Lower bound
v2
Type: Microsoft.DirectXVector2
Upper bound

Return Value

Type: Vector2
Closest value
See Also