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.
読み終わるまでの所要時間 2 分最終更新 25日前
Definition
- Type: Method
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
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. |