RAMSES Documentation  27.0.130
Information for RAMSES users and developers
Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
ramses::AnimationSequence Class Reference

The AnimationSequence is a container for multiple animations. AnimationSequence has its own virtual time line where all its animations are put onto with given offsets. The sequence of animations can then be started/stopped altogether. More...

#include <AnimationSequence.h>

Inheritance diagram for ramses::AnimationSequence:
[legend]
Collaboration diagram for ramses::AnimationSequence:
[legend]

Public Member Functions

status_t addAnimation (const Animation &animation, sequenceTimeStamp_t startTimeInSequence=0u, sequenceTimeStamp_t stopTimeInSequence=0u)
 Add animation to the sequence. Animation will be placed on to sequence time line at given time stamp if provided. The animation must not be added to multiple sequences, otherwise this will result in an undefined behavior. More...
 
status_t removeAnimation (const Animation &animation)
 Remove animation from sequence. More...
 
status_t start (timeMilliseconds_t offset=0)
 Starts the sequence of animations. Offset can be used to postpone start if positive or start sequence from a certain point if negative. More...
 
status_t startAt (globalTimeStamp_t timeStamp)
 Starts the sequence of animations at given time. More...
 
status_t startReverse (timeMilliseconds_t offset=0)
 Starts the sequence of animations in reverse. Offset can be used to postpone start if positive or start sequence from a certain point if negative. More...
 
status_t startReverseAt (globalTimeStamp_t timeStamp)
 Starts the sequence of animations at given time in reverse. More...
 
status_t stop (timeMilliseconds_t delay=0)
 Stops the sequence of animations. Delay can be used to postpone the stop. More...
 
status_t stopAt (globalTimeStamp_t timeStamp)
 Stops the sequence of animations at given time. More...
 
status_t setPlaybackSpeed (float playbackSpeed)
 Sets sequence playback speed affecting all animations within the sequence. Default sequence playback speed is 1, higher than 1 means faster (2 is double speed), lower than 1 means slower (0.5 is half speed). Zero and negative values are not allowed. More...
 
float getPlaybackSpeed () const
 Gets sequence current playback speed. See setPlaybackSpeed() for meanings of the values. More...
 
status_t setAnimationRelative (const Animation &animation)
 Sets animation relative. By default animation is absolute, ie. data values from spline keys are directly assigned to animated property. Relative animation takes value of the animated property at the point when animation starts and adds spline key value to it. More...
 
status_t setAnimationAbsolute (const Animation &animation)
 Sets animation absolute. By default animation is absolute, ie. data values from spline keys are directly assigned to animated property. More...
 
status_t setAnimationLooping (const Animation &animation, timeMilliseconds_t loopDuration=0)
 Enables animation looping. When animation reaches last spline key (or loopDuration passes) it begins playback from start. Looping animation can only be stopped by calling stop(). More...
 
bool isAnimationRelative (const Animation &animation) const
 Returns true if animation is set to relative. See setAnimationRelative(). More...
 
bool isAnimationLooping (const Animation &animation) const
 Returns true if animation is set to loop. More...
 
timeMilliseconds_t getAnimationLoopDuration (const Animation &animation) const
 Gets loop duration for animation. See setAnimationLooping() for meaning of the value. More...
 
uint32_t getNumberOfAnimations () const
 Returns number of animations within the sequence. More...
 
bool containsAnimation (const Animation &animation) const
 Checks if given animation is in the AnimationSequence. More...
 
sequenceTimeStamp_t getAnimationStartTimeInSequence (const Animation &animation) const
 Gives animation start time within the AnimationSequence. More...
 
sequenceTimeStamp_t getAnimationStopTimeInSequence (const Animation &animation) const
 Gives animation stop time within the AnimationSequence. More...
 
sequenceTimeStamp_t getAnimationSequenceStopTime () const
 Gets the maximum timestamp of all animations in this sequence. More...
 
- Public Member Functions inherited from ramses::SceneObject
sceneObjectId_t getSceneObjectId () const
 Returns scene object id which is automatically assigned at creation time of object and is unique within scope of one scene. More...
 
sceneId_t getSceneId () const
 Returns sceneid to which this object belongs to. More...
 
- Public Member Functions inherited from ramses::RamsesObject
const char * getName () const
 Returns the name of the object. More...
 
status_t setName (const char *name)
 Changes the name of the object. More...
 
ERamsesObjectType getType () const
 Gets type of the object. More...
 
bool isOfType (ERamsesObjectType type) const
 Checks if the object is of given type. More...
 
- Public Member Functions inherited from ramses::StatusObject
status_t validate () const
 Generates verbose validation of the object. More...
 
const char * getValidationReport (EValidationSeverity minSeverity=EValidationSeverity_Info) const
 Provides verbose report in human readable form generated by validate. More...
 
const char * getStatusMessage (status_t status) const
 Get the string description for a status provided by a RAMSES API function. More...
 
 StatusObject (const StatusObject &other)=delete
 Deleted copy constructor. More...
 
StatusObjectoperator= (const StatusObject &other)=delete
 Deleted copy assignment. More...
 

Public Attributes

class AnimationSequenceImpl & impl
 Stores internal data for implementation specifics of AnimationSequence. More...
 
- Public Attributes inherited from ramses::AnimationObject
class AnimationObjectImpl & impl
 
- Public Attributes inherited from ramses::SceneObject
class SceneObjectImpl & impl
 
- Public Attributes inherited from ramses::ClientObject
class ClientObjectImpl & impl
 
- Public Attributes inherited from ramses::RamsesObject
class RamsesObjectImpl & impl
 
- Public Attributes inherited from ramses::StatusObject
class StatusObjectImpl & impl
 

Protected Member Functions

 AnimationSequence (AnimationSequenceImpl &pimpl)
 Constructor of the AnimationSequence. More...
 
 AnimationSequence (const AnimationSequence &other)
 Copy constructor of AnimationSequence. More...
 
AnimationSequenceoperator= (const AnimationSequence &other)
 Assignment operator of AnimationSequence. More...
 
virtual ~AnimationSequence ()
 Destructor of the AnimationSequence. More...
 
- Protected Member Functions inherited from ramses::AnimationObject
 AnimationObject (AnimationObjectImpl &pimpl)
 Constructor for AnimationObject. More...
 
virtual ~AnimationObject ()
 Destructor of the AnimationObject. More...
 
- Protected Member Functions inherited from ramses::SceneObject
 SceneObject (SceneObjectImpl &pimpl)
 Constructor for SceneObject. More...
 
virtual ~SceneObject ()
 Destructor of the SceneObject. More...
 
- Protected Member Functions inherited from ramses::ClientObject
 ClientObject (ClientObjectImpl &pimpl)
 Constructor for ClientObject. More...
 
virtual ~ClientObject ()
 Destructor of the ClientObject. More...
 
- Protected Member Functions inherited from ramses::RamsesObject
 RamsesObject (RamsesObjectImpl &pimpl)
 Constructor for RamsesObject. More...
 
virtual ~RamsesObject ()
 Destructor of the RamsesObject. More...
 
- Protected Member Functions inherited from ramses::StatusObject
 StatusObject (StatusObjectImpl &pimpl)
 Constructor for StatusObject. More...
 
virtual ~StatusObject ()
 Destructor of the StatusObject. More...
 

Friends

class AnimationSystemData
 AnimationSystemData is the factory for creating AnimationSequence. More...
 

Detailed Description

The AnimationSequence is a container for multiple animations. AnimationSequence has its own virtual time line where all its animations are put onto with given offsets. The sequence of animations can then be started/stopped altogether.

Examples
ramses-example-basic-animation-realtime/src/main.cpp, ramses-example-basic-animation/src/main.cpp, ramses-example-basic-file-loading/src/main.cpp, ramses-example-local-client-dcsm/src/main.cpp, ramses-example-local-client/src/main.cpp, ramses-example-local-displays/src/main.cpp, ramses-example-local-geometry-shaders/src/main.cpp, and ramses-example-local-viewport-link/src/main.cpp.

Constructor & Destructor Documentation

◆ AnimationSequence() [1/2]

ramses::AnimationSequence::AnimationSequence ( AnimationSequenceImpl &  pimpl)
explicitprotected

Constructor of the AnimationSequence.

Parameters
[in]pimplInternal data for implementation specifics of AnimationSequence (sink - instance becomes owner)

◆ AnimationSequence() [2/2]

ramses::AnimationSequence::AnimationSequence ( const AnimationSequence other)
protected

Copy constructor of AnimationSequence.

Parameters
[in]otherOther instance of AnimationSequence class

◆ ~AnimationSequence()

virtual ramses::AnimationSequence::~AnimationSequence ( )
protectedvirtual

Destructor of the AnimationSequence.

Member Function Documentation

◆ addAnimation()

status_t ramses::AnimationSequence::addAnimation ( const Animation animation,
sequenceTimeStamp_t  startTimeInSequence = 0u,
sequenceTimeStamp_t  stopTimeInSequence = 0u 
)

Add animation to the sequence. Animation will be placed on to sequence time line at given time stamp if provided. The animation must not be added to multiple sequences, otherwise this will result in an undefined behavior.

Parameters
animationAnimation to be added to sequence. If animation already exists in sequence, only its start/stop time is updated.
startTimeInSequenceTime stamp for animation to start within sequence time line. By default animation is added to the beginning of sequence.
stopTimeInSequenceTime stamp for animation to stop within sequence time line. By default animation stops when its last spline key is reached.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-basic-animation-realtime/src/main.cpp, ramses-example-basic-animation/src/main.cpp, ramses-example-basic-file-loading/src/main.cpp, ramses-example-local-client-dcsm/src/main.cpp, ramses-example-local-client/src/main.cpp, ramses-example-local-displays/src/main.cpp, ramses-example-local-geometry-shaders/src/main.cpp, and ramses-example-local-viewport-link/src/main.cpp.

◆ containsAnimation()

bool ramses::AnimationSequence::containsAnimation ( const Animation animation) const

Checks if given animation is in the AnimationSequence.

Parameters
animationAnimation to check.
Returns
True if animation is contained by the AnimationSequence, false otherwise.

◆ getAnimationLoopDuration()

timeMilliseconds_t ramses::AnimationSequence::getAnimationLoopDuration ( const Animation animation) const

Gets loop duration for animation. See setAnimationLooping() for meaning of the value.

Parameters
animationAnimation in sequence for which looping duration has to be returned
Returns
Loop duration of animation.

◆ getAnimationSequenceStopTime()

sequenceTimeStamp_t ramses::AnimationSequence::getAnimationSequenceStopTime ( ) const

Gets the maximum timestamp of all animations in this sequence.

Returns
max time stamp

◆ getAnimationStartTimeInSequence()

sequenceTimeStamp_t ramses::AnimationSequence::getAnimationStartTimeInSequence ( const Animation animation) const

Gives animation start time within the AnimationSequence.

Parameters
animationAnimation to check.
Returns
Animation start time stamp in the AnimationSequence time line. InvalidSequenceTimeStamp if animation is not in this AnimationSequence.

◆ getAnimationStopTimeInSequence()

sequenceTimeStamp_t ramses::AnimationSequence::getAnimationStopTimeInSequence ( const Animation animation) const

Gives animation stop time within the AnimationSequence.

Parameters
animationAnimation to check.
Returns
Animation stop time stamp in the AnimationSequence time line. InvalidSequenceTimeStamp if animation is not in this AnimationSequence.

◆ getNumberOfAnimations()

uint32_t ramses::AnimationSequence::getNumberOfAnimations ( ) const

Returns number of animations within the sequence.

Returns
Number of animations.

◆ getPlaybackSpeed()

float ramses::AnimationSequence::getPlaybackSpeed ( ) const

Gets sequence current playback speed. See setPlaybackSpeed() for meanings of the values.

Returns
Playback speed.

◆ isAnimationLooping()

bool ramses::AnimationSequence::isAnimationLooping ( const Animation animation) const

Returns true if animation is set to loop.

Parameters
animationAnimation in sequence for which looping state has to be returned
Returns
True if animation is set to loop, false otherwise.

◆ isAnimationRelative()

bool ramses::AnimationSequence::isAnimationRelative ( const Animation animation) const

Returns true if animation is set to relative. See setAnimationRelative().

Parameters
animationAnimation in sequence for which relative state has to be returned
Returns
True if animation is relative, false otherwise.

◆ operator=()

AnimationSequence& ramses::AnimationSequence::operator= ( const AnimationSequence other)
protected

Assignment operator of AnimationSequence.

Parameters
[in]otherOther instance of AnimationSequence class
Returns
This instance after assignment

◆ removeAnimation()

status_t ramses::AnimationSequence::removeAnimation ( const Animation animation)

Remove animation from sequence.

Parameters
animationAnimation to be removed from sequence.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ setAnimationAbsolute()

status_t ramses::AnimationSequence::setAnimationAbsolute ( const Animation animation)

Sets animation absolute. By default animation is absolute, ie. data values from spline keys are directly assigned to animated property.

Note: Changing from relative to absolute animation during playback will cause undefined results.

Parameters
animationAnimation in sequence for which absolute is to be set
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ setAnimationLooping()

status_t ramses::AnimationSequence::setAnimationLooping ( const Animation animation,
timeMilliseconds_t  loopDuration = 0 
)

Enables animation looping. When animation reaches last spline key (or loopDuration passes) it begins playback from start. Looping animation can only be stopped by calling stop().

Parameters
animationAnimation in sequence for which looping is to be set
loopDurationDuration of one loop iteration. If 0 one loop iteration equals duration of whole animation (determined from last spline key).
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-basic-animation-realtime/src/main.cpp, ramses-example-basic-animation/src/main.cpp, ramses-example-basic-file-loading/src/main.cpp, ramses-example-local-client-dcsm/src/main.cpp, ramses-example-local-client/src/main.cpp, ramses-example-local-displays/src/main.cpp, ramses-example-local-geometry-shaders/src/main.cpp, and ramses-example-local-viewport-link/src/main.cpp.

◆ setAnimationRelative()

status_t ramses::AnimationSequence::setAnimationRelative ( const Animation animation)

Sets animation relative. By default animation is absolute, ie. data values from spline keys are directly assigned to animated property. Relative animation takes value of the animated property at the point when animation starts and adds spline key value to it.

Note: Changing from absolute to relative animation during playback will cause undefined results.

Parameters
animationAnimation in sequence for which relative is to be set
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ setPlaybackSpeed()

status_t ramses::AnimationSequence::setPlaybackSpeed ( float  playbackSpeed)

Sets sequence playback speed affecting all animations within the sequence. Default sequence playback speed is 1, higher than 1 means faster (2 is double speed), lower than 1 means slower (0.5 is half speed). Zero and negative values are not allowed.

Parameters
playbackSpeedPlayback speed multiplier.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-basic-animation-realtime/src/main.cpp, ramses-example-basic-animation/src/main.cpp, ramses-example-basic-file-loading/src/main.cpp, ramses-example-local-client-dcsm/src/main.cpp, ramses-example-local-client/src/main.cpp, ramses-example-local-displays/src/main.cpp, ramses-example-local-geometry-shaders/src/main.cpp, and ramses-example-local-viewport-link/src/main.cpp.

◆ start()

status_t ramses::AnimationSequence::start ( timeMilliseconds_t  offset = 0)

Starts the sequence of animations. Offset can be used to postpone start if positive or start sequence from a certain point if negative.

Parameters
offsetOffset start in milliseconds.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-local-client-dcsm/src/main.cpp, ramses-example-local-client/src/main.cpp, ramses-example-local-displays/src/main.cpp, ramses-example-local-geometry-shaders/src/main.cpp, and ramses-example-local-viewport-link/src/main.cpp.

◆ startAt()

status_t ramses::AnimationSequence::startAt ( globalTimeStamp_t  timeStamp)

Starts the sequence of animations at given time.

Parameters
timeStampGlobal time stamp for sequence to start.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-basic-animation-realtime/src/main.cpp, ramses-example-basic-animation/src/main.cpp, and ramses-example-basic-file-loading/src/main.cpp.

◆ startReverse()

status_t ramses::AnimationSequence::startReverse ( timeMilliseconds_t  offset = 0)

Starts the sequence of animations in reverse. Offset can be used to postpone start if positive or start sequence from a certain point if negative.

Parameters
offsetOffset start in milliseconds.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ startReverseAt()

status_t ramses::AnimationSequence::startReverseAt ( globalTimeStamp_t  timeStamp)

Starts the sequence of animations at given time in reverse.

Parameters
timeStampGlobal time stamp for sequence to start in reverse.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ stop()

status_t ramses::AnimationSequence::stop ( timeMilliseconds_t  delay = 0)

Stops the sequence of animations. Delay can be used to postpone the stop.

Parameters
delayDelay stop in milliseconds.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ stopAt()

status_t ramses::AnimationSequence::stopAt ( globalTimeStamp_t  timeStamp)

Stops the sequence of animations at given time.

Parameters
timeStampGlobal time stamp for sequence to stop.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

Friends And Related Function Documentation

◆ AnimationSystemData

friend class AnimationSystemData
friend

AnimationSystemData is the factory for creating AnimationSequence.

Member Data Documentation

◆ impl

class AnimationSequenceImpl& ramses::AnimationSequence::impl

Stores internal data for implementation specifics of AnimationSequence.


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