# PhysicsWorldDefinition

> A PhysicsWorld definition used to specify important initial properties.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine.LowLevelPhysics2D](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d.md)
* **Assembly:** UnityEngine.Physics2DModule

```csharp
public struct PhysicsWorldDefinition
```

## Constructors

| Constructor                                                                                                                                                           | Description                                                                                                                |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| [PhysicsWorldDefinition()](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/ctor.md#physicsworlddefinition\(\))                   | Create a default [PhysicsWorld](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld.md) definition. |
| [PhysicsWorldDefinition(System.Boolean)](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/ctor.md#physicsworlddefinition\(bool\)) | Create a default [PhysicsWorld](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld.md) definition. |

## Properties

| Property                                                                                                                                           | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| -------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [autoBodyUpdateCallbacks](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/autobodyupdatecallbacks.md)         | Controls if body update callback targets are automatically called. See [PhysicsWorld.SendBodyUpdateCallbacks](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/sendbodyupdatecallbacks.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [autoContactCallbacks](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/autocontactcallbacks.md)               | Controls if shape contact callback targets are automatically called. See [PhysicsWorld.SendContactCallbacks](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/sendcontactcallbacks.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [autoJointThresholdCallbacks](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/autojointthresholdcallbacks.md) | Controls if joint threshold callback targets are automatically called. See [PhysicsWorld.SendJointThresholdCallbacks](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/sendjointthresholdcallbacks.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [autoTriggerCallbacks](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/autotriggercallbacks.md)               | Controls if shape trigger callback targets are automatically called. See [PhysicsWorld.SendTriggerCallbacks](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/sendtriggercallbacks.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [bounceThreshold](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/bouncethreshold.md)                         | Adjust the bounce threshold, usually in meters per second. It is recommended not to make this value very small because it will prevent bodies from sleeping. See [PhysicsWorld.bounceThreshold](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/bouncethreshold.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [contactDamping](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/contactdamping.md)                           | The contact bounciness with 1 being critical damping (non-dimensional). See [PhysicsWorld.contactDamping](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/contactdamping.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [contactFilterCallbacks](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/contactfiltercallbacks.md)           | Controls if contact filter callbacks will be called. 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 Dynamic bodies. These are relatively expensive so disabling them can provide a significant performance benefit. A contact filter callback will call the [PhysicsShape.callbackTarget](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsshape/callbacktarget.md) for both shapes involved if they implement [PhysicsCallbacks.IContactFilterCallback](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicscallbacks/icontactfiltercallback.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [contactFrequency](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/contactfrequency.md)                       | The contact stiffness, in cycles per second. See [PhysicsWorld.contactFrequency](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/contactfrequency.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [contactHitEventThreshold](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/contacthiteventthreshold.md)       | The contact hit event threshold controls the collision speed needed to generate a contact hit event, usually in meters per second. See [PhysicsEvents.ContactHitEvent](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsevents/contacthitevent.md). See [PhysicsWorld.contactHitEventThreshold](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/contacthiteventthreshold.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [contactRecycleDistance](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/contactrecycledistance.md)           | The contact recycle distance, in meters. Setting this to zero disables contact point recycling. Contact recycling reuses contact points across simulation time-steps when the relative movement is small. This feature improves stability and performance by around 25% (approximately). Contact points are not recalculated until shapes move more than 5cm (default) relative to each other. Contact recycling skips some updates such as friction, pre-solve (etc) until the contacts are no longer recycled. See [PhysicsWorld.contactRecycleDistance](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/contactrecycledistance.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [contactSpeed](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/contactspeed.md)                               | The contact speed used to solve overlaps, in meters per second. See [PhysicsWorld.contactSpeed](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/contactspeed.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [continuousAllowed](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/continuousallowed.md)                     | Controls if continuous collision detection will be used between Dynamic and Static bodies. Generally you should keep continuous collision enabled to prevent fast moving objects from going through Static objects. The performance gain from disabling continuous collision is minor. See [PhysicsWorld.continuousAllowed](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/continuousallowed.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [drawCapacity](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/drawcapacity.md)                               | Controls the draw capacity. The draw capacity of the buffers when drawing are initially zero however increasing this value will mean buffers won't be resized when more elements are drawn and therefore no GC allocations will occur. Changes won't take effect until exiting play mode. This value directly controls the capacity for each element type drawn. This is only used in the Unity Editor or in a Development Player. See [PhysicsWorld.drawCapacity](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/drawcapacity.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [drawColors](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/drawcolors.md)                                   | Controls what colors are used to draw [PhysicsBody](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsbody.md), [PhysicsShape](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsshape.md), [PhysicsJoint](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsjoint.md) etc. This is only used in the Unity Editor or in a Development Player. See [PhysicsWorld.DrawColors](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/drawcolors.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [drawContactType](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/drawcontacttype.md)                         | Controls how contact points are drawn. See [PhysicsWorld.DrawContactType](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/drawcontacttype.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [drawFillAlpha](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/drawfillalpha.md)                             | Controls the draw fill alpha. This is used to scale the interior fill alpha and is only used when [PhysicsWorld.DrawFillOptions.Outline](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/drawfilloptions/outline.md) is used so that the interior color can be distinguished from the outline color by transparency. This is only used in the Unity Editor or in a Development Player. See [PhysicsWorld.drawFillAlpha](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/drawfillalpha.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [drawFillOptions](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/drawfilloptions.md)                         | Controls what aspects of is drawn using Draw. This is only used in the Unity Editor or in a Development Player. See [PhysicsWorld.DrawFillOptions](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/drawfilloptions.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [drawImpulseScale](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/drawimpulsescale.md)                       | Controls the joint contact impulse scale used when drawing contact impulses. This is only used in the Unity Editor or in a Development Player. See [PhysicsWorld.drawImpulseScale](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/drawimpulsescale.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [drawNormalScale](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/drawnormalscale.md)                         | Controls the joint contact normal scale used when drawing contact normals. This is only used in the Unity Editor or in a Development Player. See [PhysicsWorld.drawNormalScale](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/drawnormalscale.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [drawOptions](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/drawoptions.md)                                 | Draw Options used to control what is drawn using Draw. This is only used in the Unity Editor or in a Development Player. See [PhysicsWorld.DrawOptions](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/drawoptions.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [drawPointScale](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/drawpointscale.md)                           | Controls the draw point scale used when drawing points. This is only used in the Unity Editor or in a Development Player. See [PhysicsWorld.drawPointScale](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/drawpointscale.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [drawThickness](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/drawthickness.md)                             | Controls the draw thickness (outline and orientation). This is only used in the Unity Editor or in a Development Player. See [PhysicsWorld.drawThickness](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/drawthickness.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [gravity](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/gravity.md)                                         | Get/Set the gravity vector applied to all bodies in the world, usually in m/s^2. See [PhysicsWorld.gravity](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/gravity.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [maximumLinearSpeed](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/maximumlinearspeed.md)                   | Get/Set the maximum linear speed. See [PhysicsWorld.maximumLinearSpeed](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/maximumlinearspeed.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [preSolveCallbacks](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/presolvecallbacks.md)                     | Controls if pre-solve callbacks will be called. 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](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsshape/callbacktarget.md) for both shapes involved if they implement [PhysicsCallbacks.IPreSolveCallback](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicscallbacks/ipresolvecallback.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [simulateType](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/simulatetype.md)                               | Get/Set the simulation mode which controls when or if the simulation will be automatically simulated. See [PhysicsWorld.SimulationType](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/simulationtype.md) and [PhysicsWorld.Simulate](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/simulate.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [simulationSubSteps](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/simulationsubsteps.md)                   | Get/Set the simulation sub-steps to use during simulation. See [PhysicsWorld.Simulate](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/simulate.md). See [PhysicsWorld.simulationSubSteps](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/simulationsubsteps.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [simulationWorkers](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/simulationworkers.md)                     | Get/Set the simulation worker count for the world. A single simulation worker is always used for simulation therefore a worker count of one means single thread simulation only. The actual quantity of workers used will always be capped to those available on the current device and reading the property will return the number of workers actually being used by the device. Changing the worker count continuously is not recommend and will impact performance as it requires the task queue be recreated. See [PhysicsWorld.simulationWorkers](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/simulationworkers.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [sleepingAllowed](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/sleepingallowed.md)                         | Controls if bodies go to sleep when not moving and not interacting. Sleeping can provide a significant performance improvement when many Dynamic or Kinematic bodies are in the world. See [PhysicsWorld.sleepingAllowed](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/sleepingallowed.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [transformPlane](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/transformplane.md)                           | Controls the transform plane that the world uses when writing transforms. See [PhysicsWorld.transformWriteMode](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/transformwritemode-1.md). See [PhysicsWorld.transformPlane](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/transformplane-1.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [transformTweening](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/transformtweening.md)                     | Controls if Transform tweening is used. Transform tweening is where bodies that have their [PhysicsBody.transformObject](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsbody/transformobject.md) set, write to the [Transform](/engine/6000.3/script-reference/unityengine/transform.md) each frame depending on the specific body [PhysicsBody.TransformWriteMode](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsbody/transformwritemode.md) set. Regardless of this setting, Transform tweening is never used if the [PhysicsWorld.simulationType](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/simulationtype-1.md) set to [PhysicsWorld.SimulationType.Update](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/simulationtype/update.md) or [PhysicsWorld.transformWriteMode](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/transformwritemode-1.md) is [PhysicsWorld.TransformWriteMode.Off](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/transformwritemode/off.md). See [PhysicsWorld.transformTweening](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/transformtweening.md). |
| [transformWriteMode](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/transformwritemode.md)                   | Controls how transform writing is handled. Only bodies that have their [PhysicsBody.transformWriteMode](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsbody/transformwritemode-1.md) active and produce a [PhysicsEvents.BodyUpdateEvent](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsevents/bodyupdateevent.md) will write to a transform. See [PhysicsWorld.TransformWriteMode](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/transformwritemode.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

## Static Properties

| Property                                                                                                                       | Description                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
| [defaultDefinition](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworlddefinition/defaultdefinition.md) | Get a default [PhysicsWorld](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld.md) definition. |
