docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct SimulationContext

    Holds temporary data in a storage that lives as long as simulation lives and is only re- allocated if necessary.

    Implements
    IDisposable
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Physics
    Assembly: Unity.Physics.dll
    Syntax
    public struct SimulationContext : IDisposable

    Properties

    CollisionEvents

    Gets the collision events.

    Declaration
    public CollisionEvents CollisionEvents { get; }
    Property Value
    Type Description
    CollisionEvents

    The collision events.

    ImpulseEvents

    Gets the impulse events.

    Declaration
    public ImpulseEvents ImpulseEvents { get; }
    Property Value
    Type Description
    ImpulseEvents

    The impulse events.

    TriggerEvents

    Gets the trigger events.

    Declaration
    public TriggerEvents TriggerEvents { get; }
    Property Value
    Type Description
    TriggerEvents

    The trigger events.

    Methods

    Dispose()

    Disposes the simulation context.

    Declaration
    public void Dispose()

    Reset(SimulationStepInput)

    Resets the simulation storage

    • Reallocates input velocities storage if necessary
    • Disposes event streams and allocates new ones with a single work item NOTE: Reset or ScheduleReset needs to be called before passing the SimulationContext to a simulation step job. If you don't then you may get initialization errors.
    Declaration
    public void Reset(SimulationStepInput stepInput)
    Parameters
    Type Name Description
    SimulationStepInput stepInput

    The step input.

    Implements

    IDisposable
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)