Struct PhysicsWorldData
Structure containing PhysicsWorld and other data and queries that are necessary for simulating a physics world. Note: it is important to create PhysicsWorldData and use it (to schedule physics world build) in the same system. Creating it in one system, and calling the Schedule() methods in another can cause race conditions.
Implements
Inherited Members
Namespace: Unity.Physics.Systems
Assembly: Unity.Physics.dll
Syntax
public struct PhysicsWorldData : IDisposable
Constructors
PhysicsWorldData(ref SystemState, in PhysicsWorldIndex)
Constructor.
Declaration
public PhysicsWorldData(ref SystemState state, in PhysicsWorldIndex worldIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| SystemState | state | [in,out] The SystemState of the system in which you want to use PhysicsWorldData. |
| PhysicsWorldIndex | worldIndex | Zero-based index of the world. |
Fields
ComponentHandles
The component handles. Stores the information about ECS component handles needed for generating a PhysicsWorld
Declaration
public PhysicsWorldData.PhysicsWorldComponentHandles ComponentHandles
Field Value
| Type | Description |
|---|---|
| PhysicsWorldData.PhysicsWorldComponentHandles |
DynamicEntityGroup
Query for dynamic bodies.
Declaration
public EntityQuery DynamicEntityGroup
Field Value
| Type | Description |
|---|---|
| EntityQuery |
HaveStaticBodiesChanged
A flag indicating if the static bodies have changed in this frame.
Declaration
public NativeReference<int> HaveStaticBodiesChanged
Field Value
| Type | Description |
|---|---|
| NativeReference<int> |
InvalidatedTemporalCoherenceInfoGroup
Query for bodies with invalidated temporal coherence info, e.g., due to deletion.
Declaration
public EntityQuery InvalidatedTemporalCoherenceInfoGroup
Field Value
| Type | Description |
|---|---|
| EntityQuery |
JointEntityGroup
Query for joints.
Declaration
public EntityQuery JointEntityGroup
Field Value
| Type | Description |
|---|---|
| EntityQuery |
PhysicsWorld
The physics world.
Declaration
public PhysicsWorld PhysicsWorld
Field Value
| Type | Description |
|---|---|
| PhysicsWorld |
StaticEntityGroup
Query for bodies.
Declaration
public EntityQuery StaticEntityGroup
Field Value
| Type | Description |
|---|---|
| EntityQuery |
Methods
Dispose()
Free stored memory.
Declaration
public void Dispose()
Update(ref SystemState)
Calls the Update(ref SystemState) of the handles stored in this object. />
Declaration
public void Update(ref SystemState state)
Parameters
| Type | Name | Description |
|---|---|---|
| SystemState | state | [in,out] The state. |