JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
juce::AnimatedPositionBehaviours::ContinuousWithMomentum Struct Reference

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"

Public Member Functions

void setFriction (double newFriction) noexcept
 Sets the friction that damps the movement of the value.
 
void setMinimumVelocity (double newMinimumVelocityToUse) noexcept
 Sets the minimum velocity of the movement.
 
void releasedWithVelocity (double, double releaseVelocity) noexcept
 Called by the AnimatedPosition class.
 
double getNextPosition (double oldPos, double elapsedSeconds) noexcept
 Called by the AnimatedPosition class to get the new position, after the given time has elapsed.
 
bool isStopped (double) const noexcept
 Called by the AnimatedPosition class to check whether the object is now stationary.
 

Detailed Description

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

@tags{GUI}

Definition at line 44 of file juce_AnimatedPositionBehaviours.h.

Member Function Documentation

◆ getNextPosition()

double juce::AnimatedPositionBehaviours::ContinuousWithMomentum::getNextPosition ( double  oldPos,
double  elapsedSeconds 
)
noexcept

Called by the AnimatedPosition class to get the new position, after the given time has elapsed.

Definition at line 75 of file juce_AnimatedPositionBehaviours.h.

◆ isStopped()

bool juce::AnimatedPositionBehaviours::ContinuousWithMomentum::isStopped ( double  ) const
noexcept

Called by the AnimatedPosition class to check whether the object is now stationary.

Definition at line 88 of file juce_AnimatedPositionBehaviours.h.

◆ releasedWithVelocity()

void juce::AnimatedPositionBehaviours::ContinuousWithMomentum::releasedWithVelocity ( double  ,
double  releaseVelocity 
)
noexcept

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.

Definition at line 67 of file juce_AnimatedPositionBehaviours.h.

◆ setFriction()

void juce::AnimatedPositionBehaviours::ContinuousWithMomentum::setFriction ( double  newFriction)
noexcept

Sets the friction that damps the movement of the value.

A typical value is 0.08; higher values indicate more friction.

Definition at line 51 of file juce_AnimatedPositionBehaviours.h.

◆ setMinimumVelocity()

void juce::AnimatedPositionBehaviours::ContinuousWithMomentum::setMinimumVelocity ( double  newMinimumVelocityToUse)
noexcept

Sets the minimum velocity of the movement.

Any velocity that's slower than this will stop the animation. The default is 0.05.

Definition at line 58 of file juce_AnimatedPositionBehaviours.h.


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