Representa una articulación esférica con 3 grados de libertad. Más...
#include <GEBalljoint.h>
Clases | |
| struct | Limits |
| Estructura que almacena los límites de rotación de la articulación. Más... | |
Métodos públicos | |
| GEBalljoint (float length) | |
| Construye una articulación. | |
| GEBalljoint (const std::string &name, float length, glm::vec3 offset, glm::vec3 zAxis, glm::vec3 yAxis) | |
| Constructor jerárquico para esqueletos. | |
| void | initialize (GEGraphicsContext *gc, GERenderingContext *rc) |
| Inicializa las piezas de la articulación. | |
| void | destroy (GEGraphicsContext *gc) |
| Destruye los buffers de las piezas. | |
| void | addCommands (VkCommandBuffer commandBuffer, VkPipelineLayout pipelineLayout, int index) |
| Añade los comandos de dibujo. | |
| void | update (GEGraphicsContext *gc, uint32_t index, glm::mat4 view, glm::mat4 projection) |
| Actualiza las variables uniformes. | |
| void | initializeRecursive (GEGraphicsContext *gc, GERenderingContext *rc) |
| Inicializa recursivamente esta articulación y sus hijas. | |
| void | destroyRecursive (GEGraphicsContext *gc) |
| Destruye recursivamente esta articulación y sus hijas. | |
| void | addCommandsRecursive (VkCommandBuffer commandBuffer, VkPipelineLayout pipelineLayout, int index) |
| Añade comandos recursivamente. | |
| void | updateRecursive (GEGraphicsContext *gc, uint32_t index, glm::mat4 parentMatrix, glm::mat4 view, glm::mat4 projection) |
| Actualiza recursivamente con matriz del padre. | |
| void | setLightRecursive (GELight l) |
| Asigna la luz recursivamente. | |
| void | setLight (GELight l) |
| Asigna las propiedades de la luz. | |
| void | setLocation (glm::vec3 loc) |
| Asigna la posición de la articulación. | |
| void | setOrientation (glm::vec3 nDir, glm::vec3 nUp) |
| Asigna la orientación de la articulación. | |
| void | setPose (float xrot, float yrot, float zrot) |
| Asigna la rotación de la articulación (respetando límites). | |
| void | setLimits (glm::vec3 min, glm::vec3 max) |
| Asigna los límites de rotación. | |
| void | addChild (GEBalljoint *child) |
| Añade una articulación hija. | |
| GEBalljoint * | findChild (const std::string &searchName) |
| Busca una articulación hija por nombre. | |
| const std::string & | getName () const |
| Obtiene el nombre de la articulación. | |
| const std::vector< GEBalljoint * > & | getChildren () const |
| Obtiene la lista de hijos. | |
| glm::mat4 | getWorldMatrix () const |
| Obtiene la matriz mundo. | |
| glm::mat4 | getBoneEndMatrix () const |
| Obtiene la matriz en el extremo del hueso. | |
Métodos privados | |
| void | ComputeMatrix () |
| Calcula la matriz de transformación local. | |
| void | ComputeMatrix (glm::mat4 parentMatrix) |
| Calcula la matriz de transformación con matriz del padre. | |
Atributos privados | |
| GLfloat | length |
| Longitud del hueso. | |
| glm::vec3 | location |
| Posición de la articulación. | |
| glm::vec3 | dir |
| Dirección del hueso. | |
| glm::vec3 | up |
| Vector arriba local. | |
| glm::vec3 | right |
| Vector derecha local. | |
| GLfloat | angles [3] |
| Ángulos de rotación (X, Y, Z). | |
| GESphere * | joint |
| Esfera que representa la articulación. | |
| GECylinder * | bone |
| Cilindro que representa el hueso. | |
| std::string | name |
| Nombre de la articulación. | |
| glm::vec3 | offset |
| Desplazamiento respecto al padre. | |
| glm::vec3 | localZAxis |
| Eje Z local. | |
| glm::vec3 | localYAxis |
| Eje Y local. | |
| std::vector< GEBalljoint * > | children |
| Articulaciones hijas. | |
| glm::mat4 | worldMatrix |
| Matriz de transformación mundo. | |
| struct GEBalljoint::Limits | limits |
| Límites de rotación de esta articulación. | |
Representa una articulación esférica con 3 grados de libertad.
Soporta jerarquía padre-hijo para formar esqueletos completos.
| GEBalljoint::GEBalljoint | ( | float | l | ) |
Construye una articulación.
| length | Longitud del hueso. |
| l | Longitud del hueso. |
Hace referencia a angles, bone, dir, joint, length, limits, localYAxis, localZAxis, location, name, offset, right, up y worldMatrix.
Referenciado por addChild(), addCommandsRecursive(), destroyRecursive(), findChild(), initializeRecursive(), setLightRecursive() y updateRecursive().
| GEBalljoint::GEBalljoint | ( | const std::string & | name, |
| float | length, | ||
| glm::vec3 | offset, | ||
| glm::vec3 | zAxis, | ||
| glm::vec3 | yAxis ) |
Constructor jerárquico para esqueletos.
| name | Nombre de la articulación. |
| length | Longitud del hueso. |
| offset | Desplazamiento local. |
| zAxis | Eje Z local. |
| yAxis | Eje Y local. |
Hace referencia a angles, bone, dir, joint, length, limits, localYAxis, localZAxis, location, name, offset, right, up y worldMatrix.
| void GEBalljoint::addChild | ( | GEBalljoint * | child | ) |
Añade una articulación hija.
| child | Puntero a la articulación hija. |
Hace referencia a children y GEBalljoint().
Referenciado por GESkeleton::createJointFromData().
| void GEBalljoint::addCommands | ( | VkCommandBuffer | commandBuffer, |
| VkPipelineLayout | pipelineLayout, | ||
| int | index ) |
Añade los comandos de dibujo.
| commandBuffer | Buffer de comandos. |
| pipelineLayout | Layout del pipeline. |
| index | Índice de la imagen. |
Hace referencia a bone y joint.
Referenciado por addCommandsRecursive().
| void GEBalljoint::addCommandsRecursive | ( | VkCommandBuffer | commandBuffer, |
| VkPipelineLayout | pipelineLayout, | ||
| int | index ) |
Añade comandos recursivamente.
| commandBuffer | Buffer de comandos. |
| pipelineLayout | Layout del pipeline. |
| index | Índice de la imagen. |
Hace referencia a addCommands(), children y GEBalljoint().
|
private |
Calcula la matriz de transformación local.
Calcula la matriz de transformación.
Hace referencia a angles, bone, dir, joint, length, location, right, up y worldMatrix.
Referenciado por initialize(), setLocation(), setOrientation() y updateRecursive().
|
private |
Calcula la matriz de transformación con matriz del padre.
Calcula la matriz de transformación considerando la matriz del padre.
| parentMatrix | Matriz de transformación del nodo padre. |
Hace referencia a angles, bone, joint, length, localYAxis, localZAxis, offset y worldMatrix.
| void GEBalljoint::destroy | ( | GEGraphicsContext * | gc | ) |
Destruye los buffers de las piezas.
| gc | Contexto gráfico. |
Hace referencia a bone y joint.
Referenciado por destroyRecursive().
| void GEBalljoint::destroyRecursive | ( | GEGraphicsContext * | gc | ) |
Destruye recursivamente esta articulación y sus hijas.
| gc | Contexto gráfico. |
Hace referencia a children, destroy() y GEBalljoint().
| GEBalljoint * GEBalljoint::findChild | ( | const std::string & | searchName | ) |
Busca una articulación hija por nombre.
| searchName | Nombre a buscar. |
Hace referencia a children, GEBalljoint() y name.
Referenciado por GESkeleton::findJoint().
| glm::mat4 GEBalljoint::getBoneEndMatrix | ( | ) | const |
Obtiene la matriz en el extremo del hueso.
Hace referencia a length y worldMatrix.
Referenciado por updateRecursive().
| const std::vector< GEBalljoint * > & GEBalljoint::getChildren | ( | ) | const |
| const std::string & GEBalljoint::getName | ( | ) | const |
| glm::mat4 GEBalljoint::getWorldMatrix | ( | ) | const |
| void GEBalljoint::initialize | ( | GEGraphicsContext * | gc, |
| GERenderingContext * | rc ) |
Inicializa las piezas de la articulación.
| gc | Contexto gráfico. |
| rc | Contexto de renderizado. |
Hace referencia a bone, ComputeMatrix(), joint, GEMaterial::Ka, GEMaterial::Kd, GEMaterial::Ks, length y GEMaterial::Shininess.
Referenciado por initializeRecursive().
| void GEBalljoint::initializeRecursive | ( | GEGraphicsContext * | gc, |
| GERenderingContext * | rc ) |
Inicializa recursivamente esta articulación y sus hijas.
| gc | Contexto gráfico. |
| rc | Contexto de renderizado. |
Hace referencia a children, GEBalljoint() y initialize().
| void GEBalljoint::setLight | ( | GELight | l | ) |
Asigna las propiedades de la luz.
| l | Propiedades de la luz. |
Hace referencia a bone y joint.
Referenciado por setLightRecursive().
| void GEBalljoint::setLightRecursive | ( | GELight | l | ) |
Asigna la luz recursivamente.
| l | Propiedades de la luz. |
Hace referencia a children, GEBalljoint() y setLight().
| void GEBalljoint::setLimits | ( | glm::vec3 | min, |
| glm::vec3 | max ) |
Asigna los límites de rotación.
| min | Límite mínimo. |
| max | Límite máximo. |
Hace referencia a limits.
Referenciado por GESkeleton::createJointFromData().
| void GEBalljoint::setLocation | ( | glm::vec3 | loc | ) |
Asigna la posición de la articulación.
| loc | Posición. |
Hace referencia a ComputeMatrix() y location.
| void GEBalljoint::setOrientation | ( | glm::vec3 | nDir, |
| glm::vec3 | nUp ) |
Asigna la orientación de la articulación.
| nDir | Dirección. |
| nUp | Vector arriba. |
Hace referencia a ComputeMatrix(), dir, right y up.
| void GEBalljoint::setPose | ( | float | xrot, |
| float | yrot, | ||
| float | zrot ) |
Asigna la rotación de la articulación (respetando límites).
| xrot | Rotación en X. |
| yrot | Rotación en Y. |
| zrot | Rotación en Z. |
Hace referencia a angles, limits y name.
Referenciado por GEAnimation::applyToSkeleton().
| void GEBalljoint::update | ( | GEGraphicsContext * | gc, |
| uint32_t | index, | ||
| glm::mat4 | view, | ||
| glm::mat4 | projection ) |
Actualiza las variables uniformes.
| gc | Contexto gráfico. |
| index | Índice de la imagen. |
| view | Matriz de vista. |
| projection | Matriz de proyección. |
Hace referencia a bone y joint.
Referenciado por updateRecursive().
| void GEBalljoint::updateRecursive | ( | GEGraphicsContext * | gc, |
| uint32_t | index, | ||
| glm::mat4 | parentMatrix, | ||
| glm::mat4 | view, | ||
| glm::mat4 | projection ) |
Actualiza recursivamente con matriz del padre.
| gc | Contexto gráfico. |
| index | Índice de la imagen. |
| parentMatrix | Matriz del padre. |
| view | Matriz de vista. |
| projection | Matriz de proyección. |
Hace referencia a children, ComputeMatrix(), GEBalljoint(), getBoneEndMatrix() y update().
|
private |
Ángulos de rotación (X, Y, Z).
Referenciado por ComputeMatrix(), ComputeMatrix(), GEBalljoint(), GEBalljoint() y setPose().
|
private |
Cilindro que representa el hueso.
Referenciado por addCommands(), ComputeMatrix(), ComputeMatrix(), destroy(), GEBalljoint(), GEBalljoint(), initialize(), setLight() y update().
|
private |
Articulaciones hijas.
Referenciado por addChild(), addCommandsRecursive(), destroyRecursive(), findChild(), getChildren(), initializeRecursive(), setLightRecursive() y updateRecursive().
|
private |
Dirección del hueso.
Referenciado por ComputeMatrix(), GEBalljoint(), GEBalljoint() y setOrientation().
|
private |
Esfera que representa la articulación.
Referenciado por addCommands(), ComputeMatrix(), ComputeMatrix(), destroy(), GEBalljoint(), GEBalljoint(), initialize(), setLight() y update().
|
private |
Longitud del hueso.
Referenciado por ComputeMatrix(), ComputeMatrix(), GEBalljoint(), GEBalljoint(), getBoneEndMatrix() y initialize().
|
private |
Límites de rotación de esta articulación.
Referenciado por GEBalljoint(), GEBalljoint(), setLimits() y setPose().
|
private |
Eje Y local.
Referenciado por ComputeMatrix(), GEBalljoint() y GEBalljoint().
|
private |
Eje Z local.
Referenciado por ComputeMatrix(), GEBalljoint() y GEBalljoint().
|
private |
Posición de la articulación.
Referenciado por ComputeMatrix(), GEBalljoint(), GEBalljoint() y setLocation().
|
private |
Nombre de la articulación.
Referenciado por findChild(), GEBalljoint(), GEBalljoint(), getName() y setPose().
|
private |
Desplazamiento respecto al padre.
Referenciado por ComputeMatrix(), GEBalljoint() y GEBalljoint().
|
private |
Vector derecha local.
Referenciado por ComputeMatrix(), GEBalljoint(), GEBalljoint() y setOrientation().
|
private |
Vector arriba local.
Referenciado por ComputeMatrix(), GEBalljoint(), GEBalljoint() y setOrientation().
|
private |
Matriz de transformación mundo.
Referenciado por ComputeMatrix(), ComputeMatrix(), GEBalljoint(), GEBalljoint(), getBoneEndMatrix() y getWorldMatrix().