Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ChainSegmentGeometry

The geometry of a chain line segment with one-sided collision which only collides on the "right" side. Several of these are generated for a chain, connected as ghost1 -\> point1 -\> point2 -\> ghost2.
Read time 2 minutesLast updated 4 days ago

Definition

public struct ChainSegmentGeometry : IEquatable<ChainSegmentGeometry>

Static Fields

Value

Description

defaultGeometryGet the default Chain Segment.

Constructors

Properties

Property

Description

areEdgesValidWhether the two points defining _segment are far enough apart to form a valid edge.
ghost1The tail ghost vertex. A ghost vertex is used by the solver to define how a collision response should be handled when a contact with the vertex occurs.
ghost2The head ghost vertex A ghost vertex is used by the solver to define how a collision response should be handled when a contact with the vertex occurs.
isValidWhether the geometry describes a chain segment that can be used.
segmentThe Segment.

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.
InverseTransformInverse-Transform the geometry.
TransformTransform the geometry.

Static Methods

Method

Description

CreateSegmentsCreate multiple ChainSegmentGeometry from a set of vertices. The rules for interpreting the specified vertices when creating segments is described in PhysicsChain.
InverseTransformInverse-Transform a batch of geometry in place.
TransformTransform a batch of geometry in place.
UpdateSegmentsUpdate an existing batch of ChainSegmentGeometry from a set of vertices, writing the results into the specified span in place. This pairs with ChainSegmentGeometry.CreateSegments: it recalculates the same segment and ghost vertices, but reuses a caller-provided span rather than allocating a new one. The span length must equal the segment count the vertices produce, which is the vertex count when
isLoop
is true, otherwise the vertex count minus three.