docs.unity3d.com
    Show / Hide Table of Contents

    Class PhysicsWorldStepper

    Utility class for scheduling physics simulation jobs

    Inheritance
    Object
    PhysicsWorldStepper
    Namespace: Unity.Physics.Systems
    Syntax
    public class PhysicsWorldStepper : IDisposable

    Properties

    FinalJobHandle

    The final scheduled job, including all simulation and cleanup. The end of each step should depend on this.

    Declaration
    public JobHandle FinalJobHandle { get; }
    Property Value
    Type Description
    JobHandle

    FinalSimulationJobHandle

    The final simulation job handle produced by this system. Systems which read the simulation results should depend on this.

    Declaration
    public JobHandle FinalSimulationJobHandle { get; }
    Property Value
    Type Description
    JobHandle

    Simulation

    Current simulation implementation

    Declaration
    public ISimulation Simulation { get; set; }
    Property Value
    Type Description
    ISimulation

    Methods

    CreateSimulation(SimulationType, UInt32)

    Returns a new ISimulation of specified type (per last registered creator)

    Declaration
    public static ISimulation CreateSimulation(SimulationType type, uint physicsWorldIndex)
    Parameters
    Type Name Description
    SimulationType type
    UInt32 physicsWorldIndex
    Returns
    Type Description
    ISimulation

    Dispose()

    Declaration
    public void Dispose()

    EnqueueCallback(SimulationCallbacks.Phase, SimulationCallbacks.Callback, JobHandle)

    Enqueue a callback to run during scheduling of the next simulation step

    Declaration
    public void EnqueueCallback(SimulationCallbacks.Phase phase, SimulationCallbacks.Callback callback, JobHandle dependency = default(JobHandle))
    Parameters
    Type Name Description
    SimulationCallbacks.Phase phase
    SimulationCallbacks.Callback callback
    JobHandle dependency

    RegisterSimulation(SimulationType, PhysicsWorldStepper.SimulationCreator)

    Register a simulation creator

    Declaration
    public static void RegisterSimulation(SimulationType type, PhysicsWorldStepper.SimulationCreator creator)
    Parameters
    Type Name Description
    SimulationType type
    PhysicsWorldStepper.SimulationCreator creator

    ScheduleSimulationStepJobs(SimulationType, UInt32, in SimulationStepInput, in JobHandle, Boolean)

    Schedule a set of jobs to step the simulation.

    Declaration
    public SimulationJobHandles ScheduleSimulationStepJobs(SimulationType simType, uint physicsWorldIndex, in SimulationStepInput stepInput, in JobHandle inputDep, bool multiThreaded)
    Parameters
    Type Name Description
    SimulationType simType
    UInt32 physicsWorldIndex
    SimulationStepInput stepInput
    JobHandle inputDep
    Boolean multiThreaded
    Returns
    Type Description
    SimulationJobHandles
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023