Sistema de animación por keyframes con interpolación lineal. Más...
#include <GEAnimation.h>
Métodos públicos | |
| GEAnimation (float duration, bool loop=true) | |
| Constructor de la animación. | |
| void | addKeyframe (float time, const std::map< std::string, glm::vec3 > &poses, glm::vec3 skeletonPos=glm::vec3(0.0f)) |
| Añade un keyframe a la animación. | |
| void | update (float deltaTime) |
| Actualiza el tiempo de la animación. | |
| void | reset () |
| Reinicia la animación. | |
| void | pause () |
| Pausa la animación. | |
| void | resume () |
| Reanuda la animación. | |
| void | togglePause () |
| Alterna pausa/reproducción. | |
| glm::vec3 | getPoseAt (const std::string &jointName) const |
| Obtiene la pose interpolada para una articulación. | |
| glm::vec3 | getSkeletonPosition () const |
| Obtiene la posición del esqueleto interpolada. | |
| void | applyToSkeleton (GESkeleton *skeleton) |
| Aplica la animación actual al esqueleto. | |
| float | getCurrentTime () const |
| Obtiene el tiempo actual de la animación. | |
| float | getDuration () const |
| Obtiene la duración de la animación. | |
| int | getCurrentKeyframeIndex () const |
| Obtiene el índice del keyframe actual. | |
| int | getKeyframeCount () const |
| Obtiene el número de keyframes. | |
| bool | isPaused () const |
| Indica si la animación está pausada. | |
| void | nextKeyframe () |
| Avanza al siguiente keyframe. | |
| void | prevKeyframe () |
| Retrocede al keyframe anterior. | |
Atributos privados | |
| std::vector< Keyframe > | keyframes |
| float | duration |
| float | currentTime |
| bool | loop |
| bool | paused |
Sistema de animación por keyframes con interpolación lineal.
| GEAnimation::GEAnimation | ( | float | duration, |
| bool | loop = true ) |
| void GEAnimation::addKeyframe | ( | float | time, |
| const std::map< std::string, glm::vec3 > & | poses, | ||
| glm::vec3 | skeletonPos = glm::vec3(0.0f) ) |
Añade un keyframe a la animación.
| time | Tiempo del keyframe. |
| poses | Mapa de poses por nombre de articulación. |
| skeletonPos | Posición del esqueleto en el keyframe. |
| time | Tiempo del keyframe. |
| poses | Mapa de poses por nombre de articulación. |
| skeletonPos | Posición del esqueleto en el keyframe para el espacio 3D. |
Hace referencia a keyframes, Keyframe::poses, Keyframe::skeletonPosition y Keyframe::time.
Referenciado por GEScene::createBasketballThrowAnimation().
| void GEAnimation::applyToSkeleton | ( | GESkeleton * | skeleton | ) |
Aplica la animación actual al esqueleto.
| skeleton | Puntero al esqueleto a animar. |
Hace referencia a GESkeleton::findJoint(), getPoseAt(), getSkeletonPosition(), GEBalljoint::setPose() y GESkeleton::setPosition().
| int GEAnimation::getCurrentKeyframeIndex | ( | ) | const |
Obtiene el índice del keyframe actual.
Hace referencia a currentTime y keyframes.
| float GEAnimation::getCurrentTime | ( | ) | const |
Obtiene el tiempo actual de la animación.
Obtiene el tiempo actual.
Hace referencia a currentTime.
| float GEAnimation::getDuration | ( | ) | const |
Obtiene la duración de la animación.
Obtiene la duración.
Hace referencia a duration.
| int GEAnimation::getKeyframeCount | ( | ) | const |
| glm::vec3 GEAnimation::getPoseAt | ( | const std::string & | jointName | ) | const |
Obtiene la pose interpolada para una articulación.
| jointName | Nombre de la articulación. |
Hace referencia a currentTime, keyframes, Keyframe::poses y Keyframe::time.
Referenciado por applyToSkeleton().
| glm::vec3 GEAnimation::getSkeletonPosition | ( | ) | const |
Obtiene la posición del esqueleto interpolada.
Obtiene la posición del esqueleto interpolada (para salto).
Hace referencia a currentTime, keyframes, Keyframe::skeletonPosition y Keyframe::time.
Referenciado por applyToSkeleton().
| bool GEAnimation::isPaused | ( | ) | const |
Indica si la animación está pausada.
Indica si está pausado.
Hace referencia a paused.
| void GEAnimation::nextKeyframe | ( | ) |
Avanza al siguiente keyframe.
Hace referencia a currentTime y keyframes.
| void GEAnimation::pause | ( | ) |
Pausa la animación.
Hace referencia a paused.
| void GEAnimation::prevKeyframe | ( | ) |
Retrocede al keyframe anterior.
Hace referencia a currentTime y keyframes.
| void GEAnimation::reset | ( | ) |
Reinicia la animación.
Hace referencia a currentTime y paused.
| void GEAnimation::resume | ( | ) |
Reanuda la animación.
Hace referencia a paused.
| void GEAnimation::togglePause | ( | ) |
Alterna pausa/reproducción.
Hace referencia a paused.
| void GEAnimation::update | ( | float | deltaTime | ) |
Actualiza el tiempo de la animación.
| deltaTime | Tiempo transcurrido desde la última actualización. |
Hace referencia a currentTime, duration, keyframes, loop y paused.
|
private |
Referenciado por GEAnimation(), getCurrentKeyframeIndex(), getCurrentTime(), getPoseAt(), getSkeletonPosition(), nextKeyframe(), prevKeyframe(), reset() y update().
|
private |
Referenciado por GEAnimation(), getDuration() y update().
|
private |
Referenciado por addKeyframe(), getCurrentKeyframeIndex(), getKeyframeCount(), getPoseAt(), getSkeletonPosition(), nextKeyframe(), prevKeyframe() y update().
|
private |
Referenciado por GEAnimation() y update().
|
private |
Referenciado por GEAnimation(), isPaused(), pause(), reset(), resume(), togglePause() y update().