AngryDude
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AngryDudeApp Class Reference

Main class of the sample. More...

#include <AngryDudeApp.hpp>

Inheritance diagram for AngryDudeApp:
Inheritance graph
[legend]
Collaboration diagram for AngryDudeApp:
Collaboration graph
[legend]

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

SkinnedModelGLmModel
 
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
 

Detailed Description

Main class of the sample.

Constructor & Destructor Documentation

AngryDudeApp::AngryDudeApp ( NvPlatformContext *  platform)
AngryDudeApp::~AngryDudeApp ( )

Member Function Documentation

void AngryDudeApp::configurationCallback ( NvEGLConfiguration &  config)
overridevirtual
void AngryDudeApp::draw ( )
overridevirtual
void AngryDudeApp::getAnimatedTransform ( int  nodeAnimationIdx,
nv::matrix4f &  animatedTransform 
)
private
void AngryDudeApp::getAnimatedTransform ( int  nodeAnimationIdx,
DualQuaternion animatedTransform 
)
private
nv::quaternionf AngryDudeApp::getInterpolatedRotation ( int  nodeAnimationIdx)
private
nv::vec3f AngryDudeApp::getInterpolatedTranslation ( int  nodeAnimationIdx)
private
void AngryDudeApp::initRendering ( )
overridevirtual
void AngryDudeApp::initUI ( )
overridevirtual
void AngryDudeApp::reshape ( int32_t  width,
int32_t  height 
)
overridevirtual
template<typename T >
void AngryDudeApp::updateSkinning ( )
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.

Member Data Documentation

int AngryDudeApp::mAlbedoSampler
private
int AngryDudeApp::mBoneDualQuaternionsLocation
private
int AngryDudeApp::mBoneMatricesLocation
private
int AngryDudeApp::mBonesAttribute
private
int AngryDudeApp::mDebugBonesLocation
private
GLuint AngryDudeApp::mDebugBufferId
private
int AngryDudeApp::mDebugMVPLocation
private
int AngryDudeApp::mDebugNumIndices
private
int AngryDudeApp::mDebugPositionBoneAttr
private
NvGLSLProgram* AngryDudeApp::mDebugProgram
private
bool AngryDudeApp::mDrawSkeleton
private
SkinnedModelGL* AngryDudeApp::mModel
private
nv::matrix4f AngryDudeApp::mModelViewProjection
private
int AngryDudeApp::mModelViewProjectionLocation
private
int AngryDudeApp::mNormalAttribute
private
int AngryDudeApp::mPositionAttribute
private
NvGLSLProgram* AngryDudeApp::mSkinningProgram
private
float AngryDudeApp::mTime
private
float AngryDudeApp::mTimeScalar
private
bool AngryDudeApp::mUseDQB
private
int AngryDudeApp::mUseDQBLocation
private
int AngryDudeApp::mUVAttribute
private

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