Interface ISimulationUpdate
- Namespace
- Stride.BepuPhysics.Components
- Assembly
- Stride.BepuPhysics.dll
Add this interface to your Entity components to get notified when physics simulation update occur
public interface ISimulationUpdate : IComponent<ISimulationUpdate.SimUpdateProcessor, ISimulationUpdate>, IMarkedComponent
Properties
Entity
The entity this component belongs to, used with SimulationSelector
Entity Entity { get; }
Property Value
Simulation
BepuSimulation? Simulation { get; }
Property Value
SimulationSelector
The simulation which will call SimulationUpdate(BepuSimulation, float) and AfterSimulationUpdate(BepuSimulation, float) when it updates
ISimulationSelector SimulationSelector { get; }
Property Value
Remarks
Changing this in the middle of runtime will not change the simulation this object belongs to, you must call NotifySimulationChanged() afterward
Methods
AfterSimulationUpdate(BepuSimulation, float)
Called after the simulation updates
void AfterSimulationUpdate(BepuSimulation simulation, float simTimeStep)
Parameters
simulation
BepuSimulationThe simulation this ISimulationUpdate is bound to, and the one currently updating
simTimeStep
floatThe amount of time in seconds this simulation lasts for
NotifySimulationChanged()
void NotifySimulationChanged()
SimulationUpdate(BepuSimulation, float)
Called before the simulation updates
void SimulationUpdate(BepuSimulation simulation, float simTimeStep)
Parameters
simulation
BepuSimulationThe simulation this ISimulationUpdate is bound to, and the one currently updating
simTimeStep
floatThe amount of time in seconds this simulation lasts for