Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SegmentGeometry

The geometry of a line segment. See PhysicsBody.CreateShape.
Read time 1 minuteLast updated 7 days ago

Definition

public struct SegmentGeometry : IEquatable<SegmentGeometry>

Static Fields

Value

Description

defaultGeometryGet the default Segment. The line segment is directed towards the left.

Constructors

Constructor

Description

SegmentGeometry()Create a default Segment. See SegmentGeometry.defaultGeometry.

Properties

Property

Description

areEdgesValidWhether SegmentGeometry.point1 and SegmentGeometry.point2 are far enough apart to form a valid edge.
backwardCalculate the vector from SegmentGeometry.point2 to SegmentGeometry.point1. See SegmentGeometry.forward.
forwardCalculate the vector from SegmentGeometry.point1 to SegmentGeometry.point2. See SegmentGeometry.backward.
isValidWhether the geometry describes a segment that can be used.
midPointThe mid-point between SegmentGeometry.point1 and SegmentGeometry.point2.
point1The first point.
point2The second point.

Methods

Method

Description

CalculateAABBCalculate the AABB of the geometry.
CastRayCalculate if a world ray intersects the geometry. See PhysicsQuery.CastResult.
CastShapeCalculate if a cast shape intersects the geometry. Initially touching shapes are treated as a miss. You should check for overlap first if initial overlap is required. See PhysicsQuery.CastShapeInput and PhysicsQuery.CastResult.
ClosestPointCalculate the closest point on this geometry to the specified point.
CreateShapeProxyCreate a shape proxy from the geometry.
IntersectCheck the intersection between this geometry and another.
InverseTransformInverse-Transform the geometry.
ScaleScale the geometry along the SegmentGeometry.forward and SegmentGeometry.backward direction.
TransformTransform the geometry.

Static Methods

Method

Description

CreateCreate a Segment.
InverseTransformInverse-Transform a batch of geometry in place.
TransformTransform a batch of geometry in place.