CreateConvexHulls
Create PolygonGeometry.ConvexHull from the composition by iterating all the layers added to the composition in the layer order specified, applying each operation specified. A default vertex scale of Vector2.one is used here.
Read time 2 minutesLast updated 10 days ago
Definition
- Type: Method
- Namespace: UnityEngine.LowLevelPhysics2D
- Assembly: UnityEngine.Physics2DModule
CreateConvexHulls(Allocator)
Create PolygonGeometry.ConvexHull from the composition by iterating all the layers added to the composition in the layer order specified, applying each operation specified. A default vertex scale of Vector2.one is used here.
public NativeArray<PolygonGeometry.ConvexHull> CreateConvexHulls(Allocator allocator = Allocator.Temp)
Parameters
The memory allocator to use for the results. This can only be Allocator.Temp, Allocator.TempJob or Allocator.Persistent.
Returns
Type | Description |
|---|---|
| NativeArray<ConvexHull> | A NativeArray containing the Polygon Geometry convex hull created from the composer. This NativeArray must be disposed of after use otherwise leaks will occur. The exception to this is if the array is empty. |
CreateConvexHulls(Vector2, Allocator)
Create PolygonGeometry.ConvexHull from the composition by iterating all the layers added to the composition in the layer order specified, applying each operation specified.
public NativeArray<PolygonGeometry.ConvexHull> CreateConvexHulls(Vector2 vertexScale, Allocator allocator = Allocator.Temp)
Parameters
The scaling to be applied to the composer vertices.
The memory allocator to use for the results. This can only be Allocator.Temp, Allocator.TempJob or Allocator.Persistent.
Returns
Type | Description |
|---|---|
| NativeArray<ConvexHull> | A NativeArray containing the Polygon Geometry convex hull created from the composer. This NativeArray must be disposed of after use otherwise leaks will occur. The exception to this is if the array is empty. |