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 |
|---|---|
| defaultGeometry | Get the default Segment. The line segment is directed towards the left. |
Constructors
Constructor | Description |
|---|---|
| SegmentGeometry() | Create a default Segment. See _defaultGeometry. |
Properties
Property | Description |
|---|---|
| backward | Calculate the vector from _point2 to _point1. See _forward. |
| forward | Calculate the vector from _point1 to _point2. See _backward. |
| isValid | Check if the geometry is valid or not. |
| midPoint | The mid-point between _point1 and _point2. |
| point1 | The first point. |
| point2 | The second point. |
Methods
Method | Description |
|---|---|
| CalculateAABB | Calculate the AABB of the geometry. |
| CastRay | Calculate if a world ray intersects the geometry. See PhysicsQuery.CastResult. |
| CastShape | Calculate 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. |
| ClosestPoint | Calculate the closest point on this geometry to the specified point. |
| CreateShapeProxy | Create a shape proxy from the geometry. |
| Intersect | Check the intersection between this geometry and another. |
| InverseTransform | Inverse-Transform the geometry. |
| Scale | Scale the geometry along the _forward and _backward direction. |
| Transform | Transform the geometry. |
Static Methods
Method | Description |
|---|---|
| Create | Create a Segment. |
| InverseTransform | Inverse-Transform a batch of geometry in place. |
| Transform | Transform a batch of geometry in place. |