Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SegmentGeometry

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

Definition

  • Type: Struct
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
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 _defaultGeometry.

Properties

Property

Description

backwardCalculate the vector from _point2 to _point1. See _forward.
forwardCalculate the vector from _point1 to _point2. See _backward.
isValidCheck if the geometry is valid or not.
midPointThe mid-point between _point1 and _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 _forward and _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.