Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SegmentGeometry

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

Definition

public struct 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

backwardCalculate the vector from SegmentGeometry.point2 to SegmentGeometry.point1. See SegmentGeometry.forward.
forwardCalculate the vector from SegmentGeometry.point1 to SegmentGeometry.point2. See SegmentGeometry.backward.
isValidCheck if the geometry is valid or not.
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.
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.