Go to the documentation of this file.
7 #ifndef INCLUDE_JET_PHYSICS_ANIMATION_H_
8 #define INCLUDE_JET_PHYSICS_ANIMATION_H_
125 double timeIntervalInSeconds)
const;
137 bool _isUsingFixedSubTimeSteps =
true;
138 unsigned int _numberOfFixedSubTimeSteps = 1;
139 double _currentTime = 0.0;
141 void onUpdate(
const Frame& frame)
final;
143 void advanceTimeStep(
double timeIntervalInSeconds);
152 #endif // INCLUDE_JET_PHYSICS_ANIMATION_H_
std::shared_ptr< PhysicsAnimation > PhysicsAnimationPtr
Definition: physics_animation.h:148
void setIsUsingFixedSubTimeSteps(bool isUsing)
Sets true if fixed sub-timestepping is used.
virtual void onInitialize()
Called at frame 0 to initialize the physics state.
Abstract base class for physics-based animation.
Definition: physics_animation.h:20
virtual unsigned int numberOfSubTimeSteps(double timeIntervalInSeconds) const
Returns the required number of sub-timesteps for given time interval.
void setNumberOfFixedSubTimeSteps(unsigned int numberOfSteps)
Sets the number of fixed sub-timesteps.
virtual ~PhysicsAnimation()
Destructor.
double currentTimeInSeconds() const
Returns current time in seconds.
Frame currentFrame() const
Returns current frame.
Definition: advection_solver2.h:18
Abstract base class for animation-related class.
Definition: animation.h:59
bool isUsingFixedSubTimeSteps() const
Returns true if fixed sub-timestepping is used.
Representation of an animation frame.
Definition: animation.h:21
virtual void onAdvanceTimeStep(double timeIntervalInSeconds)=0
Called when a single time-step should be advanced.
unsigned int numberOfFixedSubTimeSteps() const
Returns the number of fixed sub-timesteps.
void advanceSingleFrame()
Advances a single frame.
PhysicsAnimation()
Default constructor.
void setCurrentFrame(const Frame &frame)
Sets current frame cursor (but do not invoke update()).