Main class of the sample. More...
#include <AngryDudeApp.hpp>
Public Member Functions | |
AngryDudeApp (NvPlatformContext *platform) | |
~AngryDudeApp () | |
virtual void | initRendering () override |
virtual void | initUI () override |
virtual void | draw () override |
virtual void | reshape (int32_t width, int32_t height) override |
virtual void | configurationCallback (NvEGLConfiguration &config) override |
Private Member Functions | |
template<typename T > | |
void | updateSkinning () |
void | getAnimatedTransform (int nodeAnimationIdx, nv::matrix4f &animatedTransform) |
void | getAnimatedTransform (int nodeAnimationIdx, DualQuaternion &animatedTransform) |
nv::vec3f | getInterpolatedTranslation (int nodeAnimationIdx) |
nv::quaternionf | getInterpolatedRotation (int nodeAnimationIdx) |
Private Attributes | |
SkinnedModelGL * | mModel |
NvGLSLProgram * | mSkinningProgram |
NvGLSLProgram * | mDebugProgram |
nv::matrix4f | mModelViewProjection |
float | mTime |
float | mTimeScalar |
bool | mUseDQB |
bool | mDrawSkeleton |
int | mModelViewProjectionLocation |
int | mBoneMatricesLocation |
int | mBoneDualQuaternionsLocation |
int | mUseDQBLocation |
int | mAlbedoSampler |
int | mPositionAttribute |
int | mNormalAttribute |
int | mBonesAttribute |
int | mUVAttribute |
int | mDebugMVPLocation |
int | mDebugBonesLocation |
int | mDebugPositionBoneAttr |
GLuint | mDebugBufferId |
int | mDebugNumIndices |
Main class of the sample.
AngryDudeApp::AngryDudeApp | ( | NvPlatformContext * | platform | ) |
AngryDudeApp::~AngryDudeApp | ( | ) |
|
overridevirtual |
|
overridevirtual |
|
private |
|
private |
|
private |
|
private |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
private |
updateSkinning goes through the animated body's node hieararchy (nodes are usually bones, but some nodes do not have a corresponding bone, see Assimp's documentation for more info). For each node in the hierarchy, we compute the cumulative transform from the root node. updateSkinning is templatized (T being either nv::matrix4f or DualQuaternion) in order to avoid code duplication. The only difference between matrix and dual quaternion approaches (in this implementation) is in the mathematical object used to represent rigid body transformations. Since we store bone offsets with matrices, we have to convert those to dual quaternions (toT<T>()) when skinning with dual quaternions.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |