AngryDude
 All Classes Namespaces Files Functions Variables Macros
AngryDudeApp.hpp
Go to the documentation of this file.
1 #ifndef __AngryDude_hpp__
2 #define __AngryDude_hpp__
3 
4 #include "NvAppBase/NvSampleApp.h"
5 #include "KHR/khrplatform.h"
6 #include "NvGamepad/NvGamepad.h"
7 #include "NV/NvMath.h"
8 #include "NvAppBase/NvInputTransformer.h"
9 
10 #include "Skinning.hpp"
11 
12 class NvGLSLProgram;
13 class DualQuaternion;
14 
15 struct MeshGL
16 {
18  GLuint indexBufferId;
19  GLsizei numIndices;
21 };
22 
24 {
25  std::vector<MeshGL> meshesGL;
26 };
27 
28 class AngryDudeApp : public NvSampleApp
29 {
30 public:
31  AngryDudeApp(NvPlatformContext* platform);
32  ~AngryDudeApp();
33 
34  virtual void initRendering() override;
35  virtual void initUI() override;
36  virtual void draw() override;
37  virtual void reshape(int32_t width, int32_t height) override;
38 
39  virtual void configurationCallback(NvEGLConfiguration& config) override;
40 
41 private:
42  template <typename T> void updateSkinning();
43  void getAnimatedTransform(int nodeAnimationIdx, nv::matrix4f& animatedTransform);
44  void getAnimatedTransform(int nodeAnimationIdx, DualQuaternion& animatedTransform);
45  nv::vec3f getInterpolatedTranslation(int nodeAnimationIdx);
46  nv::quaternionf getInterpolatedRotation(int nodeAnimationIdx);
47 
49  NvGLSLProgram* mSkinningProgram;
50  NvGLSLProgram* mDebugProgram;
51  nv::matrix4f mModelViewProjection;
52 
53  float mTime;
54  float mTimeScalar;
55  bool mUseDQB;
57 
63 
68 
74 };
75 
76 #endif
Definition: AngryDudeApp.hpp:23
int mBoneMatricesLocation
Definition: AngryDudeApp.hpp:59
int mAlbedoSampler
Definition: AngryDudeApp.hpp:62
GLuint vertexBufferId
Definition: AngryDudeApp.hpp:17
GLuint indexBufferId
Definition: AngryDudeApp.hpp:18
int mBonesAttribute
Definition: AngryDudeApp.hpp:66
int mUVAttribute
Definition: AngryDudeApp.hpp:67
int mPositionAttribute
Definition: AngryDudeApp.hpp:64
Definition: AngryDudeApp.hpp:15
int mUseDQBLocation
Definition: AngryDudeApp.hpp:61
int mNormalAttribute
Definition: AngryDudeApp.hpp:65
Main class of the sample.
Definition: AngryDudeApp.hpp:28
GLsizei numIndices
Definition: AngryDudeApp.hpp:19
std::vector< MeshGL > meshesGL
Definition: AngryDudeApp.hpp:25
void updateSkinning()
Definition: AngryDudeApp.cpp:206
SkinnedModelGL * mModel
Definition: AngryDudeApp.hpp:48
virtual void configurationCallback(NvEGLConfiguration &config) override
Definition: AngryDudeApp.cpp:399
virtual void initUI() override
Definition: AngryDudeApp.cpp:370
nv::quaternionf getInterpolatedRotation(int nodeAnimationIdx)
Definition: AngryDudeApp.cpp:134
virtual void reshape(int32_t width, int32_t height) override
Definition: AngryDudeApp.cpp:393
Definition: DualQuaternion.hpp:170
int mBoneDualQuaternionsLocation
Definition: AngryDudeApp.hpp:60
bool mUseDQB
Definition: AngryDudeApp.hpp:55
float mTime
Definition: AngryDudeApp.hpp:53
virtual void initRendering() override
Definition: AngryDudeApp.cpp:260
nv::vec3f getInterpolatedTranslation(int nodeAnimationIdx)
Definition: AngryDudeApp.cpp:112
NvGLSLProgram * mSkinningProgram
Definition: AngryDudeApp.hpp:49
GLuint albedoTextureId
Definition: AngryDudeApp.hpp:20
nv::matrix4f mModelViewProjection
Definition: AngryDudeApp.hpp:51
NvGLSLProgram * mDebugProgram
Definition: AngryDudeApp.hpp:50
int mDebugBonesLocation
Definition: AngryDudeApp.hpp:70
int mDebugNumIndices
Definition: AngryDudeApp.hpp:73
void getAnimatedTransform(int nodeAnimationIdx, nv::matrix4f &animatedTransform)
Definition: AngryDudeApp.cpp:156
float mTimeScalar
Definition: AngryDudeApp.hpp:54
int mDebugPositionBoneAttr
Definition: AngryDudeApp.hpp:71
~AngryDudeApp()
Definition: AngryDudeApp.cpp:361
Definition: Skinning.hpp:50
bool mDrawSkeleton
Definition: AngryDudeApp.hpp:56
int mDebugMVPLocation
Definition: AngryDudeApp.hpp:69
AngryDudeApp(NvPlatformContext *platform)
Definition: AngryDudeApp.cpp:348
int mModelViewProjectionLocation
Definition: AngryDudeApp.hpp:58
GLuint mDebugBufferId
Definition: AngryDudeApp.hpp:72
virtual void draw() override
Definition: AngryDudeApp.cpp:39