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.
|
bouncinessCombine |
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 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 UnityEngine.MonoBehaviour that callbacks for this shape will be sent to.
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 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 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.
The following properties are not read/written and will be at their defaults:
- LowLevelPhysics2D.PhysicsShapeDefinition.updateContactsOnCreate |
friction |
The Coulomb (dry) friction coefficient, usually in the range [0, 1].
This is assigned to the current PhysicsShape.surfaceMaterial.
|
frictionCombine |
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 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.
|
surfaceMaterial |
The surface material for the shape comprising of many properties such as friciton, bounciness, rolling resistance etc.
Setting the surface material overrides any individual settings for friciton, 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 contact 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.
|