Obi  6.4
Unified particle physics for Unity
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Obi.ObiUpdater Class Reference

Base class for updating multiple solvers in parallel. Derive from this class to write your onw updater. This grants you precise control over execution order, as you can choose to update solvers at any point during Unity's update cycle. More...

Inheritance diagram for Obi.ObiUpdater:
Obi.ObiFixedUpdater Obi.ObiLateFixedUpdater Obi.ObiLateUpdater

Public Attributes

List< ObiSolversolvers = new List<ObiSolver>()
 List of solvers updated by this updater. More...
 

Protected Member Functions

void PrepareFrame ()
 Prepares all solvers to begin simulating a new frame. This should be called as soon as possible in the frame, and guaranteed to be called every frame that will step physics. More...
 
void BeginStep (float stepDeltaTime)
 Prepares all solvers to begin simulating a new physics step. This involves caching some particle data for interpolation, performing collision detection, among other things. More...
 
void Substep (float stepDeltaTime, float substepDeltaTime, int index)
 Advances the simulation a given amount of time. Note that once BeginStep has been called, Substep can be called multiple times. More...
 
void EndStep (float substepDeltaTime)
 Wraps up the current simulation step. This will trigger contact callbacks. More...
 
void Interpolate (float stepDeltaTime, float accumulatedTime)
 Interpolates the previous and current physics states. Should be called right before rendering the current frame. More...
 

Detailed Description

Base class for updating multiple solvers in parallel. Derive from this class to write your onw updater. This grants you precise control over execution order, as you can choose to update solvers at any point during Unity's update cycle.

Member Function Documentation

void Obi.ObiUpdater.BeginStep ( float  stepDeltaTime)
protected

Prepares all solvers to begin simulating a new physics step. This involves caching some particle data for interpolation, performing collision detection, among other things.

Parameters
stepDeltaTimeDuration (in seconds) of the next step.
void Obi.ObiUpdater.EndStep ( float  substepDeltaTime)
protected

Wraps up the current simulation step. This will trigger contact callbacks.

void Obi.ObiUpdater.Interpolate ( float  stepDeltaTime,
float  accumulatedTime 
)
protected

Interpolates the previous and current physics states. Should be called right before rendering the current frame.

Parameters
stepDeltaTimeDuration (in seconds) of the last step taken.
stepDeltaTimeAmount of accumulated (not yet simulated) time.
void Obi.ObiUpdater.PrepareFrame ( )
protected

Prepares all solvers to begin simulating a new frame. This should be called as soon as possible in the frame, and guaranteed to be called every frame that will step physics.

void Obi.ObiUpdater.Substep ( float  stepDeltaTime,
float  substepDeltaTime,
int  index 
)
protected

Advances the simulation a given amount of time. Note that once BeginStep has been called, Substep can be called multiple times.

Parameters
substepDeltaTimeDuration (in seconds) of the substep.

Member Data Documentation

List<ObiSolver> Obi.ObiUpdater.solvers = new List<ObiSolver>()

List of solvers updated by this updater.


The documentation for this class was generated from the following file: