Click or drag to resize

GeometrySegmentIntersectsCircle Method

Given the 2D segment (segment_from, segment_to), returns the position on the segment (as a number between 0 and 1) at which the segment hits the circle that is located at position circle_position and has radius circle_radius. If the segment does not intersect the circle, -1 is returned (this is also the case if the line extending the segment would intersect the circle, but the segment does not).

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public static float SegmentIntersectsCircle(
	Vector2 segmentFrom,
	Vector2 segmentTo,
	Vector2 circlePosition,
	float circleRadius
)

Parameters

segmentFrom
Type: GodotVector2

[Missing <param name="segmentFrom"/> documentation for "M:Godot.Geometry.SegmentIntersectsCircle(Godot.Vector2,Godot.Vector2,Godot.Vector2,System.Single)"]

segmentTo
Type: GodotVector2

[Missing <param name="segmentTo"/> documentation for "M:Godot.Geometry.SegmentIntersectsCircle(Godot.Vector2,Godot.Vector2,Godot.Vector2,System.Single)"]

circlePosition
Type: GodotVector2

[Missing <param name="circlePosition"/> documentation for "M:Godot.Geometry.SegmentIntersectsCircle(Godot.Vector2,Godot.Vector2,Godot.Vector2,System.Single)"]

circleRadius
Type: SystemSingle

[Missing <param name="circleRadius"/> documentation for "M:Godot.Geometry.SegmentIntersectsCircle(Godot.Vector2,Godot.Vector2,Godot.Vector2,System.Single)"]

Return Value

Type: Single

[Missing <returns> documentation for "M:Godot.Geometry.SegmentIntersectsCircle(Godot.Vector2,Godot.Vector2,Godot.Vector2,System.Single)"]

See Also