Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PhysicsQuery.SegmentDistanceResult

Segment distance result from segment distance queries.
Read time 1 minuteLast updated 15 days ago

Definition

public readonly struct PhysicsQuery.SegmentDistanceResult : IEquatable<PhysicsQuery.SegmentDistanceResult>

Properties

Property

Description

closest1The closest point on the first segment
closest2The closest point on the second segment
distanceThe distance between the closest points. This is calculated from _sqrDistance on each access, so prefer that when a squared distance will do.
fraction1The barycentric coordinate on the first segment
fraction2The barycentric coordinate on the second segment
sqrDistanceThe squared distance between the closest points. Use this in place of _distance when comparing against another squared distance, as it avoids a square root.

Structs

Struct

Description

PhysicsQuery.SegmentDistanceResult.SortAscendingOrderAscending distance sort comparer.