| Property |
Description |
| aabb |
Get the world AABB that bounds this shape.
The bounds of the shape is inflated slightly due to speculative collision detection.
The inflation is smaller on Static shape types however it is not zero due to time-of-impact collision detection.
If an exact AABB is required then you can retrieve that via the shape geometry.
See CircleGeometry.CalculateAABB, CapsuleGeometry.CalculateAABB, PolygonGeometry.CalculateAABB and SegmentGeometry.CalculateAABB.
|
| body |
The body which the shape is attached to.
|
| bounciness |
The bounciness (coefficient of restitution) usually in the range [0, 1].
Values higher than 1 will result in energy being added which can lead to an unstable simulation.
This is assigned to the current PhysicsShape.surfaceMaterial.
|
| bouncinessMixing |
Defines the method used when mixing the friction values of two shapes to form a contact.
This is assigned to the current PhysicsShape.surfaceMaterial.
|
| bouncinessPriority |
The priority for combining the PhysicsShape.bounciness properties when two shapes come into contact.
If the priority of one shape is higher than the other shape then the higher priority LowLevelPhysics2D.PhysicsShape.SurfaceMaterial.bouncinessCombine will be used.
If the priority of both shapes are the same then simply the higher enumeration value of UnityEngine.PhysicsMaterialCombine2D from both shapes will be used.
This is assigned to the current PhysicsShape.surfaceMaterial.
|
| callbackTarget |
Get/Set the System.Object that callbacks for this shape will be sent to.
Care should be taken with any System.Object assigned as a callback target that isn't a UnityEngine.Object as this assignment will not in itself keep the object alive and can be garbage collected.
To avoid this, you should have at least a single reference to the object in your code.
This includes the following events:
A ContactFilterEvent with call IContactFilterCallback.A PreSolveEvent with call IPreSolveCallback.A TriggerBeginEvent with call ITriggerCallback.A TriggerEndEvent with call ITriggerCallback.A ContactBeginEvent with call IContactCallback.A ContactEndEvent with call IContactCallback. |
| capsuleGeometry |
Get/Set the Capsule associated with this shape.
When getting the shape geometry, the shape type must match the geometry type otherwise an warning will be produced and an invalid geometry will be returned.
Setting the geometry will change the type of shape represented even if the shape type was different before.
Setting the geometry will also result in waking the body the shape is attached to.
|
| chain |
Get the owning chain. The type of shape must be PhysicsShape.ShapeType.ChainSegment otherwise a warning will be produced.
See PhysicsShape.isChainSegment and PhysicsChain.
|
| chainSegmentGeometry |
Get the Chain Segment Geometry associated with this shape.
When getting the shape geometry, the shape type must match the geometry type otherwise an warning will be produced and an invalid geometry will be returned.
|
| circleGeometry |
Get/Set the Circle associated with this shape.
When getting the shape geometry, the shape type must match the geometry type otherwise an warning will be produced and an invalid geometry will be returned.
Setting the geometry will change the type of shape represented even if the shape type was different before.
Setting the geometry will result in waking the body the shape is attached to.
|
| contactEvents |
Controls whether this shape produces contact events which can be retrieved after the simulation has completed.
Any contact events can be used to call the assigned PhysicsShape.callbackTarget.
A contact event is produced if either shapes involved have their contactEvents enabled.
A contact event will produce a IContactCallback to the PhysicsShape.callbackTarget for both shapes involved.
|
| contactFilter |
The filter used when determining what contacts this shape participates in.
|
| contactFilterCallbacks |
Controls whether this shape produces contact filter callbacks.
A contact filter callback allows direct control over whether a contact will be created between a pair of shapes.
This applies to both triggers and non-triggers but only with to Dynamic bodies
These are relatively expensive so disabling them can provide a significant performance benefit.
A contact filter callback will call the PhysicsShape.callbackTarget for both shapes involved if they implement IContactFilterCallback.
|
| customColor |
Custom debug draw color. Any color value other than UnityEngine.Color.clear (RGBA=0) will be used to render the shape..
This value is passed back when using the PhysicsWorld debug drawing. The alpha value here is always ignored.
This is only used in the Unity Editor or in a Development Player.
This is assigned to the current PhysicsShape.surfaceMaterial.
See LowLevelPhysics2D.PhysicsWorld.Draw.
|
| definition |
Get/Set a shape definition by accessing all of its current properties.
This is provided as convenience only and should not be used when performance is important as all the properties defined in the definition are accessed sequentially.
You should try to only use the specific properties you need rather than using this feature.
|
| friction |
The Coulomb (dry) friction coefficient, usually in the range [0, 1].
This is assigned to the current PhysicsShape.surfaceMaterial.
|
| frictionMixing |
Defines the method used when mixing the friction values of two shapes to form a contact.
This is assigned to the current PhysicsShape.surfaceMaterial.
|
| frictionPriority |
The priority for combining the PhysicsShape.friction properties when two shapes come into contact.
If the priority of one shape is higher than the other shape then the higher priority LowLevelPhysics2D.PhysicsShape.SurfaceMaterial.frictionCombine will be used.
If the priority of both shapes are the same then simply the higher enumeration value of UnityEngine.PhysicsMaterialCombine2D from both shapes will be used.
This is assigned to the current PhysicsShape.surfaceMaterial.
|
| hitEvents |
Controls whether this shape produces hit events which can be retrieved after the simulation has completed.
|
| isChainSegment |
Check if the shape is a Chain type. A Chain type is owned by a chain.
See PhysicsShape.chain and PhysicsChain.
|
| isOwned |
Get if the shape is owned.
See PhysicsShape.SetOwner.
|
| isTrigger |
Get/Set if the shape is a trigger.
Changing the state here is relatively expensive and should be avoided.
See PhysicsShapeDefinition.isTrigger.
|
| isValid |
Check if the shape is valid.
|
| localCenter |
Get the center of the shape, in local-space.
|
| massConfiguration |
The shape mass configuration. Normally this only used on a body where the total of all shapes is used.
This allows the calculation of this specific shape in isolation.
See MassConfiguration.
|
| moverData |
The mover data for the shape mover.
|
| polygonGeometry |
Get/Set the Polygon associated with this shape.
When getting the shape geometry, the shape type must match the geometry type otherwise an warning will be produced and an invalid geometry will be returned.
Setting the geometry will change the type of shape represented even if the shape type was different before.
Setting the geometry will also result in waking the body the shape is attached to.
|
| preSolveCallbacks |
Controls whether this shape produces pre-solve callbacks.
This only applies to Dynamic bodies and is ignored for triggers.
These are relatively expensive so disabling them can provide a significant performance benefit.
A pre-solve callback will call the PhysicsShape.callbackTarget for both shapes involved if they implement IPreSolveCallback.
|
| rollingResistance |
The rolling resistance usually in the range [0, 1].
This is assigned to the current PhysicsShape.surfaceMaterial.
|
| segmentGeometry |
Get/Set the Segment associated with this shape.
When getting the shape geometry, the shape type must match the geometry type otherwise an warning will be produced and an invalid geometry will be returned.
Setting the geometry will change the type of shape represented even if the shape type was different before.
Setting the geometry will also result in waking the body the shape is attached to.
|
| shapeType |
The type of shape. See ShapeType.
|
| startMassUpdate |
Should the body update its mass properties when this shape is created.
Disabling this improves performance when multiple shapes are being added to the same body.
The mass of a body can then be explicitly updated by calling PhysicsBody.ApplyMassFromShapes See PhysicsShapeDefinition.startMassUpdate.
|
| startStaticContacts |
Normally shapes on Static bodies don't create contacts when they are added to the world.
This overrides that behavior and causes contact creation.
This significantly slows down Static body creation which can be important when there are many Static shapes.
This is implicitly always true for Triggers, Dynamic bodies and Kinematic bodies. See PhysicsShapeDefinition.startStaticContacts.
|
| surfaceMaterial |
The surface material for the shape comprising of many properties such as friction, bounciness, rolling resistance etc.
Setting the surface material overrides any individual settings for friction, bounciness, rolling resistance etc.
|
| tangentSpeed |
The tangent (surface) speed.
This is assigned to the current PhysicsShape.surfaceMaterial.
|
| transform |
Get the shape transform.
This is simply the body transform. See PhysicsBody.transform.
|
| triggerEvents |
Controls whether this shape produces triggers events which can be retrieved after the simulation has completed.
A trigger event is only produced if both shapes involved have their triggerEvents enabled.
A trigger event will produce a ITriggerCallback to the PhysicsShape.callbackTarget for both shapes involved.
|
| userData |
Get/Set PhysicsUserData that can be used for any purpose.
The physics system doesn't use this data, it is entirely for custom use.
|
| world |
Get the world the shape is attached to.
|