Namespace Unity.Physics.Systems
Classes
AfterPhysicsSystemGroup
A system group that runs after physics. In almost all cases, this provides no behaviour difference over manually typing [UpdateInGroup(typeof(FixedStepSimulationSystemGroup))][UpdateAfter(typeof(PhysicsSystemGroup))]. The only benefit of using [UpdateInGroup(AfterPhysicsSystemGroup)] is the fact that the systems which update in this group will be correctly copied by CustomPhysicsSystemGroup in cases of using multiple worlds. If using [UpdateInGroup(typeof(FixedStepSimulationSystemGroup))][UpdateAfter(typeof(PhysicsSystemGroup))] the [UpdateAfter] attribute will be invalid in CustomPhysicsSystemGroup.
BeforePhysicsSystemGroup
A system group that runs before physics. In almost all cases, this provides no behaviour difference over manually typing [UpdateInGroup(typeof(FixedStepSimulationSystemGroup))][UpdateBefore(typeof(PhysicsSystemGroup))]. The only benefit of using [UpdateInGroup(BeforePhysicsSystemGroup)] is the fact that the systems which update in this group will be correctly copied by CustomPhysicsSystemGroup in cases of using multiple worlds. If using [UpdateInGroup(typeof(FixedStepSimulationSystemGroup))][UpdateBefore(typeof(PhysicsSystemGroup))] the [UpdateBefore] attribute will be invalid in CustomPhysicsSystemGroup.
CustomPhysicsSystemGroup
This abstract class can be used to create a system group for a custom physics world. To create a custom physics group, derive from this class and implement empty constructor which calls one of two constructors of this class, and potentially implement some of the other virtual functions.
CustomPhysicsSystemGroupBase
This abstract class can be used to create a system group for a custom physics world. You most likely want to use CustomPhysicsSystemGroup, as you don't need to implement callback methods there.
PhysicsBuildWorldGroup
Group responsible to build the physics world data and wait for any dependencies before the next simulation.
PhysicsCreateBodyPairsGroup
The first system group to run in PhysicsSimulationGroup. It finds all potentitaly overlapping body-pairs in the simulation. After it has finished, and before PhysicsCreateContactsGroup starts, you can modify those pairs by implementing IBodyPairsJob.
PhysicsCreateContactsGroup
The second system group to run in PhysicsSimulationGroup. It is doing collision detection on body pairs generated by PhysicsCreateBodyPairsGroup, and generates contacts. After it has finished, and before PhysicsCreateJacobiansGroup starts, you can modify those contacts by implementing IContactsJob.
PhysicsCreateJacobiansGroup
The third system group to run in PhysicsSimulationGroup. It is converting contacts generated by PhysicsCreateContactsGroup to jacobians. After it has finished, and before PhysicsSolveAndIntegrateGroup starts, you can modify jacobians by implementing IJacobiansJob.
PhysicsInitializeGroup
The first group to run in physics pipeline. It creates the PhysicsWorld from ECS physics components. The most important system in this world is BuildPhysicsWorld .
PhysicsSimulationGroup
The second group to run in physics pipeline. It simulates the world. If you want to modify data mid-simulation, your system should run in this group. It consists of PhysicsCreateBodyPairsGroup , PhysicsCreateContactsGroup, PhysicsCreateJacobiansGroup and PhysicsSolveAndIntegrateGroup groups which run in that order.
PhysicsSolveAndIntegrateGroup
The final system group to run in PhysicsSimulationGroup. It is solving the jacobians generated by PhysicsCreateJacobiansGroup, and writing the results of the simulation to the DynamicsWorld.
PhysicsSystemGroup
The physics system group. Covers all physics systems in the engine. Consists of PhysicsInitializeGroup , PhysicsSimulationGroup, and ExportPhysicsWorld which run in that order.
PhysicsWorldBuilder
Utilities for building a physics world.
PhysicsWorldExporter
Utilities for exporting physics world data to ECS components.
Structs
BuildPhysicsWorld
A system which builds the physics world based on the entity world. The world will contain a rigid body for every entity which has a rigid body component, and a joint for every entity which has a joint component.
BuildPhysicsWorldData
Public system data for this world's instance of a BuildPhysicsWorld system.
Contains physics world data based on the entity world. The physics world data will contain a rigid body for every entity which has a rigid body component, and a joint for every entity which has a joint component.
ExportPhysicsWorld
A system which copies transforms and velocities from the physics world back to the original entity components. The last system to run in PhysicsSystemGroup.
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.
PhysicsWorldData.PhysicsWorldComponentHandles
The physics world component handles. Stores the information about ECS component handles needed for generating a PhysicsWorld
PhysicsWorldExporter.ExportPhysicsWorldTypeHandles
Stores the ECS component handles needed to export PhysicsWorld to ECS components.
SyncCustomPhysicsProxySystem
Synchronize the movement of the custom physics proxy using kinematic velocities. The kinematic entity is moved from its current position/rotation to the position/rotation of the driving entity in one frame, by computing the necessary angular and linear velocities.