Click or drag to resize

GeometrySegmentIntersectsSphere Method

Checks if the segment (from, to) intersects the sphere that is located at sphere_position and has radius sphere_radius. If no, returns an empty Vector3. If yes, returns a Vector3 containing the point of intersection and the sphere's normal at the point of intersection.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public static Vector3[] SegmentIntersectsSphere(
	Vector3 from,
	Vector3 to,
	Vector3 spherePosition,
	float sphereRadius
)

Parameters

from
Type: GodotVector3

[Missing <param name="from"/> documentation for "M:Godot.Geometry.SegmentIntersectsSphere(Godot.Vector3,Godot.Vector3,Godot.Vector3,System.Single)"]

to
Type: GodotVector3

[Missing <param name="to"/> documentation for "M:Godot.Geometry.SegmentIntersectsSphere(Godot.Vector3,Godot.Vector3,Godot.Vector3,System.Single)"]

spherePosition
Type: GodotVector3

[Missing <param name="spherePosition"/> documentation for "M:Godot.Geometry.SegmentIntersectsSphere(Godot.Vector3,Godot.Vector3,Godot.Vector3,System.Single)"]

sphereRadius
Type: SystemSingle

[Missing <param name="sphereRadius"/> documentation for "M:Godot.Geometry.SegmentIntersectsSphere(Godot.Vector3,Godot.Vector3,Godot.Vector3,System.Single)"]

Return Value

Type: Vector3

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

See Also