GlistEngine
Loading...
Searching...
No Matches
gSkinnedMesh.h
Go to the documentation of this file.
1/*
2 * gSkinnedMesh.h
3 *
4 * If a mesh contains any morphing target, then the frame processed during runtime. Which means you cannot use the mesh in VRAM if it has morphing target(s).
5 *
6 * Created on: 27 Kas 2020
7 * Author: Acer
8 */
9
10#ifndef GRAPHICS_GSKINNEDMESH_H_
11#define GRAPHICS_GSKINNEDMESH_H_
12
13#include "gMorphingMesh.h"
14
16public:
18 ~gSkinnedMesh() override;
19
20 void draw() override;
21
22 void resizeAnimation(int verticesNum);
24 void setVertexPos(int vertexNo, const glm::vec3& pos);
25 void setVertexNorm(int vertexNo, const glm::vec3& norm);
26 const glm::vec3& getVertexPos(int vertexNo) const;
27 const glm::vec3& getVertexNorm(int vertexNo) const;
29
30 void resizeVertexAnimationData(int animationNum, int frameNum, int verticesNum, bool isOnVram);
31 void resetVertexAnimationData(int animationNo, int frameNo);
32 void setVertexPosData(int animationNo, int frameNo, int vertexNo, const glm::vec3& newWeight);
33 void setVertexNormData(int animationNo, int frameNo, int vertexNo, const glm::vec3& newWeight);
34 const glm::vec3& getVertexPosData(int animationNo, int frameNo, int vertexNo) const;
35 const glm::vec3& getVertexNormData(int animationNo, int frameNo, int vertexNo) const;
36 void setVerticesData(int animationNo, int frameNo, const std::vector<gVertex>& vertices, const std::vector<gIndex>& indices);
37
38 void setVertexAnimated(bool isVertexAnimated);
39 void setVertexAnimationStoredOnVram(bool isVertexAnimationStoredOnVram);
40 void setFrameNo(int frameNo);
41 int getFrameNo() const;
42
43 const std::vector<glm::vec3>& getAnimatedPos() const;
44 const std::vector<glm::vec3>& getAnimatedNorm() const;
45
46private:
47 std::vector<glm::vec3> animatedPos;
48 std::vector<glm::vec3> animatedNorm;
49
50 std::vector<std::vector<std::vector<glm::vec3>>> animatedPosData;
51 std::vector<std::vector<std::vector<glm::vec3>>> animatedNormData;
52 std::vector<std::vector<std::unique_ptr<gVbo>>> vboframe;
53
54 void drawVboFrame();
55 bool isvertexanimated, isvertexanimationstoredonvram;
56 int frameno, framenoold;
57};
58
59#endif /* GRAPHICS_GSKINNEDMESH_H_ */
std::shared_ptr< std::vector< gVertex > > vertices
Definition gMesh.h:114
Definition gMorphingMesh.h:27
Definition gSkinnedMesh.h:15
void draw() override
void setFrameNo(int frameNo)
const glm::vec3 & getVertexPos(int vertexNo) const
const glm::vec3 & getVertexNorm(int vertexNo) const
~gSkinnedMesh() override
void resetAnimation()
const glm::vec3 & getVertexPosData(int animationNo, int frameNo, int vertexNo) const
void setVertexPos(int vertexNo, const glm::vec3 &pos)
void resizeAnimation(int verticesNum)
void resetVertexAnimationData(int animationNo, int frameNo)
void setVertexNormData(int animationNo, int frameNo, int vertexNo, const glm::vec3 &newWeight)
void resizeVertexAnimationData(int animationNum, int frameNum, int verticesNum, bool isOnVram)
void clearAnimation()
const std::vector< glm::vec3 > & getAnimatedNorm() const
const glm::vec3 & getVertexNormData(int animationNo, int frameNo, int vertexNo) const
int getFrameNo() const
void setVertexNorm(int vertexNo, const glm::vec3 &norm)
const std::vector< glm::vec3 > & getAnimatedPos() const
void setVerticesData(int animationNo, int frameNo, const std::vector< gVertex > &vertices, const std::vector< gIndex > &indices)
void setVertexPosData(int animationNo, int frameNo, int vertexNo, const glm::vec3 &newWeight)
void setVertexAnimationStoredOnVram(bool isVertexAnimationStoredOnVram)
void setVertexAnimated(bool isVertexAnimated)