Kanzi  3.9.6
Kanzi Engine API
kanzi::KeyframeAnimation< TValueType >::BezierKeyframe Class Reference

Use bezier keyframes to animate property value along a bezier curve. More...

#include <kanzi/core.ui/animation/keyframe_animation.hpp>

Inheritance diagram for kanzi::KeyframeAnimation< TValueType >::BezierKeyframe:
[legend]

Public Member Functions

 BezierKeyframe ()
 Constructor. More...
 
 BezierKeyframe (TValueType value, const Vector2 &p0, const Vector2 &p1)
 Constructor. More...
 
Vector2 getControlPoint0 () const
 Returns the first control point of the keyframe. More...
 
Vector2 getControlPoint1 () const
 Returns the second control point of the keyframe. More...
 
TValueType getValue (const TValueType &currentValue, float normalizedTime) override
 Returns the value for the animated property at a given time. More...
 
void setControlPoint0 (Vector2 controlPoint)
 Sets the first control point for a keyframe. More...
 
void setControlPoint1 (Vector2 controlPoint)
 Sets the second control point for a keyframe. More...
 
void setControlPoints (const Vector2 &p0, const Vector2 &p1)
 Sets control points for a keyframe. More...
 
- Public Member Functions inherited from kanzi::KeyframeAnimation< TValueType >::Keyframe
TValueType getKeyValue () const
 Returns the keyframe value of the animated property. More...
 
 Keyframe ()
 Constructor. More...
 
 Keyframe (TValueType value)
 Constructor. More...
 
void setKeyValue (const TValueType &keyValue)
 Sets the keyframe value for a keyframe. More...
 
virtual ~Keyframe ()
 

Static Public Member Functions

static BezierKeyframePtr create (TValueType value, const Vector2 &p0, const Vector2 &p1)
 Creates a bezier keyframe. More...
 

Detailed Description

template<typename TValueType>
class kanzi::KeyframeAnimation< TValueType >::BezierKeyframe

Use bezier keyframes to animate property value along a bezier curve.

A Bezier keyframe consists of two control points in addition to a keyframe value for the animated property. A control point is a pair of a floating point numbers stored in Vector2:

  • The X coordinate of a control point specifies the animation time of that control point. The value of the control point is defined in relative units, where 0.0 corresponds to the time of the previous keyframe and 1.0 corresponds to the time of the current keyframe.
  • The Y coordinate of a control point specifies the value of the animated property of that control point. The value of the control point is defined in the same absolute units as the value of the keyframe.

Constructor & Destructor Documentation

◆ BezierKeyframe() [1/2]

template<typename TValueType >
kanzi::KeyframeAnimation< TValueType >::BezierKeyframe::BezierKeyframe ( )
inlineexplicit

Constructor.

◆ BezierKeyframe() [2/2]

template<typename TValueType >
kanzi::KeyframeAnimation< TValueType >::BezierKeyframe::BezierKeyframe ( TValueType  value,
const Vector2 p0,
const Vector2 p1 
)
inlineexplicit

Constructor.

Parameters
valueThe keyframe value of the animated property.
p0The first control point of the keyframe.
p1The second control point of the keyframe.

Member Function Documentation

◆ create()

template<typename TValueType >
static BezierKeyframePtr kanzi::KeyframeAnimation< TValueType >::BezierKeyframe::create ( TValueType  value,
const Vector2 p0,
const Vector2 p1 
)
inlinestatic

Creates a bezier keyframe.

Parameters
valueThe keyframe value of the animated property.
p0The first control point of the keyframe.
p1The second control point of the keyframe.

◆ setControlPoints()

template<typename TValueType >
void kanzi::KeyframeAnimation< TValueType >::BezierKeyframe::setControlPoints ( const Vector2 p0,
const Vector2 p1 
)
inline

Sets control points for a keyframe.

Parameters
p0The first control point of the keyframe.
p1The second control point of the keyframe.

◆ getControlPoint0()

template<typename TValueType >
Vector2 kanzi::KeyframeAnimation< TValueType >::BezierKeyframe::getControlPoint0 ( ) const
inline

Returns the first control point of the keyframe.

Returns
The first control point of the keyframe.

◆ setControlPoint0()

template<typename TValueType >
void kanzi::KeyframeAnimation< TValueType >::BezierKeyframe::setControlPoint0 ( Vector2  controlPoint)
inline

Sets the first control point for a keyframe.

Parameters
controlPointA control point that you want to use as the first control point of the keyframe.

◆ getControlPoint1()

template<typename TValueType >
Vector2 kanzi::KeyframeAnimation< TValueType >::BezierKeyframe::getControlPoint1 ( ) const
inline

Returns the second control point of the keyframe.

Returns
The second control point of the keyframe.

◆ setControlPoint1()

template<typename TValueType >
void kanzi::KeyframeAnimation< TValueType >::BezierKeyframe::setControlPoint1 ( Vector2  controlPoint)
inline

Sets the second control point for a keyframe.

Parameters
controlPointA control point that you want to use as the second control point of the keyframe.

◆ getValue()

template<typename TValueType >
TValueType kanzi::KeyframeAnimation< TValueType >::BezierKeyframe::getValue ( const TValueType &  currentValue,
float  normalizedTime 
)
inlineoverridevirtual

Returns the value for the animated property at a given time.

Parameters
currentValueThe current value of the animated property.
normalizedTimeThe time at which you want to get the value of the animated property. 0.0 corresponds to the time of the previous keyframe. 1.0 corresponds to the time of this keyframe.
Returns
The value of the animated property at a given time.

Implements kanzi::KeyframeAnimation< TValueType >::Keyframe.


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