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

PhysicsComposer

struct in UnityEngine.LowLevelPhysics2D

/

Implemented in:UnityEngine.Physics2DModule

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

Description

Provides the ability to compose geometry using specific operations on layers in a specific order.

Static Properties

Property Description
DefaultCurveStride The default curve stride used when composing geometry with curves, in radians. Lower values produce more vertices, larger values fewer vertices.
MinCurveStride The minimum curve stride, in radians.

Properties

Property Description
isValid Check if a Physics Composer is valid.
layerCount Get the number of layers currently added to the Physics Composer.
layerHandles Get the layer handles added to the Physics Composer.
rejectedGeometryCount Get the number of geometries that were rejected during the last Geometry Composition. Geometry can be rejected for a number of reasons such as vertices being collinear or too close etc. Whilst "pure" geometry is always valid, this geometry is meant to be used by physics which has constraints on what it can accept. All geometry successfully created will always be valid when used by physics. If you notice thin/small gaps in the composition, this is likely to be rejected geometry. Checking this property will help determine that.
useDelaunay Get/Set if Delaunay tessellation is to be used.

Public Methods

Method Description
AddLayer Add a Circle Geometry layer to the Physics Composer.
CreateChainGeometry Create ChainGeometry from the composition by iterating all the layers added to the composition in the layer order specified, applying each operation specified. A limit is imposed on small vertex distances so it is recommended that scaling is applied here rather than on the returned geometry so geometry is not discarded due to it being invalid.
CreatePolygonGeometry Create PolygonGeometry from the composition by iterating all the layers added to the composition in the layer order specified, applying each operation specified. A limit is imposed on small vertex distances so it is recommended that scaling is applied here rather than on the returned geometry so geometry is not discarded due to it being invalid.
Destroy Destroy the Physics Composer.
RemoveLayer Remove a layer from the Physics Composer.

Static Methods

Method Description
Create Create a Physics Composer.