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.
Inherited Members
Namespace: Unity.Physics.Systems
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
Group in which the dynamic bodies belong to.
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<Int32> |
JointEntityGroup
Group in which the joints belong to
Declaration
public EntityQuery JointEntityGroup
Field Value
Type | Description |
---|---|
EntityQuery |
PhysicsWorld
The physics world.
Declaration
public PhysicsWorld PhysicsWorld
Field Value
Type | Description |
---|---|
PhysicsWorld |
StaticEntityGroup
Group in which the static bodies belong to
Declaration
public EntityQuery StaticEntityGroup
Field Value
Type | Description |
---|---|
EntityQuery |
Methods
Dispose()
Free stored memory.
Declaration
public void Dispose()
Implements
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. |