PhysicsCoreSettings2D
PhysicsCore Settings Asset. This contains all the global physics options along with the default values for the following definitions: PhysicsWorldDefinition PhysicsBodyDefinition PhysicsShapeDefinition PhysicsChainDefinition PhysicsDistanceJointDefinition PhysicsFixedJointDefinition PhysicsHingeJointDefinition PhysicsRelativeJointDefinition PhysicsSliderJointDefinition PhysicsWheelJointDefinition
Read time 6 minutesLast updated 10 days ago
Definition
- Type: Class
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
- Inherits from: ScriptableObject
public sealed class PhysicsCoreSettings2D : ScriptableObject
Properties
Property | Description |
|---|---|
| alwaysDrawWorlds | Controls if worlds are always drawn independent of whether rendering is currently active or not as specified by _renderingMode. When true, world drawing is always active and a PhysicsEvents.WorldDrawResults event is produced containing the PhysicsWorld.DrawResults. When false, world drawing only occurs depending on the _renderingMode setting. |
| concurrentSimulations | Controls how many simulations can be started in parallel. Each one is started on its own worker and acts as its own main-thread. Workers should ideally be left free for the solver otherwise it may degrade solving performance. The actual quantity of workers used will always be capped to those available on the current device. |
| contactFilterGroupMode | The mode used for the PhysicsShape.ContactFilter when determining if two PhysicsShape can contact. See PhysicsShape.ContactFilterGroupMode. |
| contactFilterMode | The mode used for the PhysicsShape.ContactFilter when determining if two PhysicsShape can contact. See PhysicsShape.ContactFilterMode. |
| disableSimulation | Controls the simulation of any PhysicsWorld temporarily removing simulation overhead. When true, no automatic simulation will occur. When false, normal operation occurs with automatic simulation. |
| initialWorldCapacity | Get/Set the number of worlds allocated up-front when the physics system starts. Worlds are allocated as a single contiguous block, so a larger capacity uses more memory immediately and care must be taken. When all worlds are in use, more are allocated on demand up to the supported maximum, so this is an initial capacity and not a hard limit. Growing the array reallocates it, so set this to the number of worlds you expect in order to avoid reallocations during gameplay. Setting this value to one reduces start-up memory usage to a minimum while still allowing more worlds to be created later. The value must be in the range of 1 to 1024. Any change will only be handled by Exiting Play mode in the Editor or restarting the player build. |
| lengthUnitsPerMeter | The internal length units per meter. |
| physicsBodyDefinition | Get/Set the PhysicsBodyDefinition. |
| physicsChainDefinition | Get/Set the PhysicsChainDefinition. |
| physicsDistanceJointDefinition | Get/Set the PhysicsDistanceJointDefinition. |
| physicsFixedJointDefinition | Get/Set the PhysicsFixedJointDefinition. |
| physicsHingeJointDefinition | Get/Set the PhysicsHingeJointDefinition. |
| physicsLayerNames | A set of 64 "layer" names associated with each bit in a PhysicsMask when used for contacts and queries. |
| physicsRelativeJointDefinition | Get/Set the PhysicsRelativeJointDefinition. |
| physicsShapeDefinition | Get/Set the PhysicsShapeDefinition. |
| physicsSliderJointDefinition | Get/Set the PhysicsSliderJointDefinition. |
| physicsWheelJointDefinition | Get/Set the PhysicsWheelJointDefinition. |
| physicsWorldDefinition | Get/Set the PhysicsWorldDefinition. |
| renderingMode | Controls drawing and rendering is allowed. |
| transformChangeMode | Defines when changes to Transform that has are registered with PhysicsWorld.RegisterTransformChange are called. NOTE: In the Unity Editor when not in Play Mode, Transform change callbacks are always and only sent at the start of the frame for authoring purposes. See PhysicsWorld.TransformChangeMode. |
| usePhysicsLayers | Controls if the physics 64-bit layers are used based upon _physicsLayerNames or if not, the standard 32-bit layers based upon LayerMask. If a PhysicsCoreSettings2D asset is assigned then the physics layers (_physicsLayerNames) will be used if _usePhysicsLayers is also active. If no PhysicsCoreSettings2D asset is assigned then the global layers (See LayerMask) will be used. |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |