Version: Unity 6.3 Beta (6000.3)
LanguageEnglish
  • C#

PhysicsComposer.AddLayer

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public LowLevelPhysics2D.PhysicsComposer.LayerHandle AddLayer(LowLevelPhysics2D.CircleGeometry geometry, LowLevelPhysics2D.PhysicsTransform transform, LowLevelPhysics2D.PhysicsComposer.Operation operation, int order, float curveStride, bool reverseWinding);

Parameters

Parameter Description
geometry The Circle Geometry to use.
transform The transform to use on the geometry.
operation The composer operation to use.
order The order to perform the composer operation.
curveStride The curve stride used when creating curves, in radians. Valid range is [PhysicsComposer.MinCurveStride, 1.0].
reverseWinding Whether the winding should be reversed. Typically winding is generated anti-clockwise, reversed winding is therefore clockwise.

Returns

LayerHandle A handle to the new layer.

Description

Add a Circle Geometry layer to the Physics Composer.


Declaration

public LowLevelPhysics2D.PhysicsComposer.LayerHandle AddLayer(ReadOnlySpan<CircleGeometry> geometry, LowLevelPhysics2D.PhysicsTransform transform, LowLevelPhysics2D.PhysicsComposer.Operation operation, int order, float curveStride, bool reverseWinding);

Parameters

Parameter Description
geometry The Circle Geometry to use. This geometry will be copied so the geometry the span is referring to can be disposed of afterwards if required.
transform The transform to use on the geometry.
operation The composer operation to use.
order The order to perform the composer operation.
curveStride The curve stride used when creating curves, in radians. Valid range is [PhysicsComposer.MinCurveStride, 1.0].
reverseWinding Whether the winding should be reversed. Typically winding is generated anti-clockwise, reversed winding is therefore clockwise.

Returns

LayerHandle A handle to the new layer.

Description

Add multiple Circle Geometry layer to the Physics Composer.


Declaration

public LowLevelPhysics2D.PhysicsComposer.LayerHandle AddLayer(LowLevelPhysics2D.CapsuleGeometry geometry, LowLevelPhysics2D.PhysicsTransform transform, LowLevelPhysics2D.PhysicsComposer.Operation operation, int order, float curveStride, bool reverseWinding);

Parameters

Parameter Description
geometry The Capsule Geometry to use.
transform The transform to use on the geometry.
operation The composer operation to use.
order The order to perform the composer operation.
curveStride The curve stride used when creating curves, in radians. Valid range is [PhysicsComposer.MinCurveStride, 1.0].
reverseWinding Whether the winding should be reversed. Typically winding is generated anti-clockwise, reversed winding is therefore clockwise.

Returns

LayerHandle A handle to the new layer.

Description

Add a Capsule Geometry layer to the Physics Composer.


Declaration

public LowLevelPhysics2D.PhysicsComposer.LayerHandle AddLayer(ReadOnlySpan<CapsuleGeometry> geometry, LowLevelPhysics2D.PhysicsTransform transform, LowLevelPhysics2D.PhysicsComposer.Operation operation, int order, float curveStride, bool reverseWinding);

Parameters

Parameter Description
geometry The Capsule Geometry to use. This geometry will be copied so the geometry the span is referring to can be disposed of afterwards if required.
transform The transform to use on the geometry.
operation The composer operation to use.
order The order to perform the composer operation.
curveStride The curve stride used when creating curves, in radians. Valid range is [PhysicsComposer.MinCurveStride, 1.0].
reverseWinding Whether the winding should be reversed. Typically winding is generated anti-clockwise, reversed winding is therefore clockwise.

Returns

LayerHandle A handle to the new layer.

Description

Add multiple Capsule Geometry layer to the Physics Composer.


Declaration

public LowLevelPhysics2D.PhysicsComposer.LayerHandle AddLayer(LowLevelPhysics2D.PolygonGeometry geometry, LowLevelPhysics2D.PhysicsTransform transform, LowLevelPhysics2D.PhysicsComposer.Operation operation, int order, float curveStride, bool reverseWinding);

Parameters

Parameter Description
geometry The Polygon Geometry to use.
transform The transform to use on the geometry.
operation The composer operation to use.
order The order to perform the composer operation.
curveStride The curve stride used when creating curves, in radians. Valid range is [PhysicsComposer.MinCurveStride, 1.0].
reverseWinding Whether the winding should be reversed. Typically winding is generated anti-clockwise, reversed winding is therefore clockwise.

Returns

LayerHandle A handle to the new layer.

Description

Add a Polygon Geometry layer to the Physics Composer.


Declaration

public LowLevelPhysics2D.PhysicsComposer.LayerHandle AddLayer(ReadOnlySpan<PolygonGeometry> geometry, LowLevelPhysics2D.PhysicsTransform transform, LowLevelPhysics2D.PhysicsComposer.Operation operation, int order, float curveStride, bool reverseWinding);

Parameters

Parameter Description
geometry The Polygon Geometry to use. This geometry will be copied so the geometry the span is referring to can be disposed of afterwards if required.
transform The transform to use on the geometry.
operation The composer operation to use.
order The order to perform the composer operation.
curveStride The curve stride used when creating curves, in radians. Valid range is [PhysicsComposer.MinCurveStride, 1.0].
reverseWinding Whether the winding should be reversed. Typically winding is generated anti-clockwise, reversed winding is therefore clockwise.

Returns

LayerHandle A handle to the new layer.

Description

Add multiple PhysicsShape layer to the Physics Composer.


Declaration

public LowLevelPhysics2D.PhysicsComposer.LayerHandle AddLayer(LowLevelPhysics2D.PhysicsShape shape, LowLevelPhysics2D.PhysicsTransform transform, LowLevelPhysics2D.PhysicsComposer.Operation operation, int order, float curveStride, bool reverseWinding);

Parameters

Parameter Description
shape The PhysicsShape to use.
transform The transform to use on the geometry.
operation The composer operation to use.
order The order to perform the composer operation.
curveStride The curve stride used when creating curves, in radians. Valid range is [PhysicsComposer.MinCurveStride, 1.0].
reverseWinding Whether the winding should be reversed. Typically winding is generated anti-clockwise, reversed winding is therefore clockwise.

Returns

LayerHandle A handle to the new layer.

Description

Add a PhysicsShape layer to the Physics Composer. Only PhysicsShape with a geometry of PhysicsShape.ShapeType.Circle, PhysicsShape.ShapeType.Capsule or PhysicsShape.ShapeType.Polygon will be used. All other types will be ignored.


Declaration

public LowLevelPhysics2D.PhysicsComposer.LayerHandle AddLayer(ReadOnlySpan<PhysicsShape> shapes, LowLevelPhysics2D.PhysicsTransform transform, LowLevelPhysics2D.PhysicsComposer.Operation operation, int order, float curveStride, bool reverseWinding);

Parameters

Parameter Description
shapes The PhysicsShapes to use. The geometry these shapes used will be copied so the geometry the span is referring to can changed afterwards if required.
transform The transform to use on the geometry.
operation The composer operation to use.
order The order to perform the composer operation.
curveStride The curve stride used when creating curves, in radians. Valid range is [PhysicsComposer.MinCurveStride, 1.0].
reverseWinding Whether the winding should be reversed. Typically winding is generated anti-clockwise, reversed winding is therefore clockwise.

Returns

LayerHandle A handle to the new layer.

Description

Add a Polygon Geometry layer to the Physics Composer. Only PhysicsShape with a geometry of PhysicsShape.ShapeType.Circle, PhysicsShape.ShapeType.Capsule or PhysicsShape.ShapeType.Polygon will be used. All other types will be ignored.


Declaration

public LowLevelPhysics2D.PhysicsComposer.LayerHandle AddLayer(ReadOnlySpan<Vector2> vertices, LowLevelPhysics2D.PhysicsTransform transform, LowLevelPhysics2D.PhysicsComposer.Operation operation, int order, bool reverseWinding);

Parameters

Parameter Description
vertices A span of vertices. This geometry will be copied so the geometry the span is referring to can be disposed of afterwards if required.
transform The transform to use on the geometry.
operation The composer operation to use.
order The order to perform the composer operation.
reverseWinding Whether the winding should be reversed. Typically winding is generated anti-clockwise, reversed winding is therefore clockwise.

Returns

LayerHandle A handle to the new layer.

Description

Add a vertices layer to the Physics Composer.