A non-snapping behaviour that allows the content to be freely flicked in either direction, with momentum based on the velocity at which it was released, and variable friction to make it come to a halt.
More...
#include <juce_AnimatedPositionBehaviours.h>
A non-snapping behaviour that allows the content to be freely flicked in either direction, with momentum based on the velocity at which it was released, and variable friction to make it come to a halt.
This class is intended to be used as a template parameter to the AnimatedPosition class.
- See also
- AnimatedPosition
◆ ContinuousWithMomentum()
AnimatedPositionBehaviours::ContinuousWithMomentum::ContinuousWithMomentum |
( |
| ) |
|
|
inlinenoexcept |
◆ getNextPosition()
double AnimatedPositionBehaviours::ContinuousWithMomentum::getNextPosition |
( |
double |
oldPos, |
|
|
double |
elapsedSeconds |
|
) |
| |
|
inlinenoexcept |
◆ isStopped()
bool AnimatedPositionBehaviours::ContinuousWithMomentum::isStopped |
( |
double |
| ) |
const |
|
inlinenoexcept |
◆ releasedWithVelocity()
void AnimatedPositionBehaviours::ContinuousWithMomentum::releasedWithVelocity |
( |
double |
, |
|
|
double |
releaseVelocity |
|
) |
| |
|
inlinenoexcept |
Called by the AnimatedPosition class.
This tells us the position and velocity at which the user is about to release the object. The velocity is measured in units/second.
References velocity.
◆ setFriction()
void AnimatedPositionBehaviours::ContinuousWithMomentum::setFriction |
( |
double |
newFriction | ) |
|
|
inlinenoexcept |
Sets the friction that damps the movement of the value.
A typical value is 0.08; higher values indicate more friction.
References damping.
◆ damping
double AnimatedPositionBehaviours::ContinuousWithMomentum::damping = 0.92 |
|
private |
◆ velocity
double AnimatedPositionBehaviours::ContinuousWithMomentum::velocity = 0 |
|
private |
The documentation for this struct was generated from the following file: