This commit is contained in:
devZoGok
2021-10-19 19:06:41 +03:00
parent dc03858585
commit 2e0cad7fd1
40 changed files with 220 additions and 207 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ set(utils util.cpp)
set(math quaternion.cpp vector.cpp matrix.cpp ray.cpp) set(math quaternion.cpp vector.cpp matrix.cpp ray.cpp)
set(render particleEmitter.cpp camera.cpp light.cpp material.cpp mesh.cpp model.cpp node.cpp quad.cpp box.cpp root.cpp shader.cpp texture.cpp) set(render particleEmitter.cpp camera.cpp light.cpp material.cpp mesh.cpp model.cpp node.cpp quad.cpp box.cpp root.cpp shader.cpp texture.cpp)
set(model modelReader.cpp assimpModelReader.cpp vbModelReader.cpp) set(model modelReader.cpp assimpModelReader.cpp vbModelReader.cpp)
set(anim animationController.cpp animationChannel.cpp animation.cpp keyframeChannel.cpp animatable.cpp driver.cpp) set(anim animationController.cpp animationChannel.cpp animation.cpp animatable.h keyframeChannel.cpp driver.cpp)
set(armature skeleton.cpp bone.cpp ikSolver.cpp) set(armature skeleton.cpp bone.cpp ikSolver.cpp)
set(library ${render} ${math} ${model} ${utils} ${gui} ${armature} ${assetManager} ${anim}) set(library ${render} ${math} ${model} ${utils} ${gui} ${armature} ${assetManager} ${anim})
-7
View File
@@ -1,7 +0,0 @@
#include "animatable.h"
#include "animationController.h"
namespace vb01{
Animatable::Animatable(){
}
}
+2 -6
View File
@@ -1,17 +1,13 @@
#ifndef ANIMATABLE_H #ifndef ANIMATABLE_H
#define ANIMATABLE_H #define ANIMATABLE_H
#include "animation.h" #include "keyframeChannel.h"
namespace vb01{ namespace vb01{
class AnimationController;
class Animatable{ class Animatable{
public: public:
Animatable(); Animatable(){}
virtual void animate(float, KeyframeChannel){} virtual void animate(float, KeyframeChannel){}
private:
protected:
}; };
} }
+1
View File
@@ -3,6 +3,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "keyframeChannel.h" #include "keyframeChannel.h"
namespace vb01{ namespace vb01{
+1
View File
@@ -3,6 +3,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "animation.h" #include "animation.h"
namespace vb01{ namespace vb01{
+1
View File
@@ -1,5 +1,6 @@
#include "assimpModelReader.h" #include "assimpModelReader.h"
#include "mesh.h" #include "mesh.h"
#include <Importer.hpp> #include <Importer.hpp>
#include <scene.h> #include <scene.h>
#include <postprocess.h> #include <postprocess.h>
+1
View File
@@ -2,6 +2,7 @@
#define BONE_H #define BONE_H
#include "node.h" #include "node.h"
#include <string> #include <string>
namespace vb01{ namespace vb01{
+2 -2
View File
@@ -10,7 +10,7 @@ namespace vb01{
~Camera(); ~Camera();
void update(); void update();
void setPosition(Vector3 position){this->position = position;} void setPosition(Vector3 position){this->position = position;}
void lookAt(Vector3, Vector3=Vector3(0,1,0)); void lookAt(Vector3, Vector3 = Vector3::VEC_J);
inline Vector3 getPosition(){return position;} inline Vector3 getPosition(){return position;}
inline Vector3 getDirection(){return direction;} inline Vector3 getDirection(){return direction;}
inline Vector3 getLeft(){return left;} inline Vector3 getLeft(){return left;}
@@ -21,7 +21,7 @@ namespace vb01{
inline float getNearPlane(){return nearPlane;} inline float getNearPlane(){return nearPlane;}
inline float getFarPlane(){return farPlane;} inline float getFarPlane(){return farPlane;}
private: private:
Vector3 position=Vector3(0,0,0),direction=Vector3(0,0,-1),left=Vector3(1,0,0),up=Vector3(0,1,0); Vector3 position = Vector3::VEC_ZERO, direction = Vector3(0,0,-1), left = Vector3::VEC_I, up = Vector3::VEC_J;
float fov = 45, nearPlane = .1, farPlane = 100; float fov = 45, nearPlane = .1, farPlane = 100;
}; };
} }
+1
View File
@@ -1,4 +1,5 @@
#include "cameraTest.h" #include "cameraTest.h"
#include <cppunit/TestCase.h> #include <cppunit/TestCase.h>
#include <cppunit/TestSuite.h> #include <cppunit/TestSuite.h>
#include <cppunit/TestResult.h> #include <cppunit/TestResult.h>
+1
View File
@@ -2,6 +2,7 @@
#define DRIVER #define DRIVER
#include "keyframeChannel.h" #include "keyframeChannel.h"
#include <string> #include <string>
namespace vb01{ namespace vb01{
+1
View File
@@ -3,6 +3,7 @@
#include <cppunit/TestFixture.h> #include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
#include "bone.h" #include "bone.h"
namespace vb01{ namespace vb01{
-1
View File
@@ -13,7 +13,6 @@ namespace vb01{
class Shader; class Shader;
class Material; class Material;
class Light : public Animatable{ class Light : public Animatable{
public: public:
enum Type{POINT, DIRECTIONAL, SPOT, AMBIENT}; enum Type{POINT, DIRECTIONAL, SPOT, AMBIENT};
+2 -1
View File
@@ -1,4 +1,5 @@
#include "matrix.h" #include "matrix.h"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
@@ -145,7 +146,7 @@ namespace vb01{
for(int j = 0; j < dim[1]; j++) for(int j = 0; j < dim[1]; j++)
if(i != row && j != column){ if(i != row && j != column){
int a=offsetRows&&i!=0?i-1:i,b=offsetColumns&&j!=0?j-1:j; int a = (offsetRows && i != 0 ? i - 1 : i), b = (offsetColumns && j != 0 ? j - 1 : j);
matrix[a][b] = this->matrix[i][j]; matrix[a][b] = this->matrix[i][j];
} }
+1
View File
@@ -4,6 +4,7 @@
#include "texture.h" #include "texture.h"
#include "skeleton.h" #include "skeleton.h"
#include "animation.h" #include "animation.h"
#include <glad.h> #include <glad.h>
#include <glfw3.h> #include <glfw3.h>
#include <glm.hpp> #include <glm.hpp>
+1
View File
@@ -1,5 +1,6 @@
#include "modelReader.h" #include "modelReader.h"
#include "model.h" #include "model.h"
#include <vector> #include <vector>
#include <fstream> #include <fstream>
+1
View File
@@ -2,6 +2,7 @@
#define MODEL_READER #define MODEL_READER
#include <string> #include <string>
#include "model.h" #include "model.h"
namespace vb01{ namespace vb01{
+1
View File
@@ -2,6 +2,7 @@
#define QUATERNION_H #define QUATERNION_H
#include <cmath> #include <cmath>
#include "vector.h" #include "vector.h"
namespace vb01{ namespace vb01{
+1
View File
@@ -1,4 +1,5 @@
#include <algorithm> #include <algorithm>
#include "ray.h" #include "ray.h"
#include "mesh.h" #include "mesh.h"
#include "node.h" #include "node.h"
+1
View File
@@ -1,5 +1,6 @@
#include "vector.h" #include "vector.h"
#include "util.h" #include "util.h"
#include <vector> #include <vector>
namespace vb01{ namespace vb01{
+1
View File
@@ -4,6 +4,7 @@
#include "shader.h" #include "shader.h"
#include "box.h" #include "box.h"
#include "quad.h" #include "quad.h"
#include <glad.h> #include <glad.h>
#include <glfw3.h> #include <glfw3.h>
#include <cstdlib> #include <cstdlib>
+1
View File
@@ -2,6 +2,7 @@
#define ROOT_H #define ROOT_H
#include "camera.h" #include "camera.h"
#include <string> #include <string>
#include <vector> #include <vector>
+1
View File
@@ -3,6 +3,7 @@
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <fstream> #include <fstream>
#include "shader.h" #include "shader.h"
#include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp> #include <glm/gtc/type_ptr.hpp>
+1
View File
@@ -3,6 +3,7 @@
#include <string> #include <string>
#include <glm/mat4x4.hpp> #include <glm/mat4x4.hpp>
#include "vector.h" #include "vector.h"
#include "util.h" #include "util.h"
+1
View File
@@ -3,6 +3,7 @@
#include "animationController.h" #include "animationController.h"
#include "box.h" #include "box.h"
#include "ikSolver.h" #include "ikSolver.h"
#include <glm.hpp> #include <glm.hpp>
#include <glm/gtc/matrix_inverse.hpp> #include <glm/gtc/matrix_inverse.hpp>
+1
View File
@@ -3,6 +3,7 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include "bone.h" #include "bone.h"
namespace vb01{ namespace vb01{
+4 -1
View File
@@ -1,8 +1,11 @@
#define STB_IMAGE_IMPLEMENTATION #define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h" #include "stb_image.h"
#include "texture.h"
#include <glad.h> #include <glad.h>
#include <glfw3.h> #include <glfw3.h>
#include"texture.h"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
+1
View File
@@ -3,6 +3,7 @@
#include <string> #include <string>
#include <ft2build.h> #include <ft2build.h>
#include "util.h" #include "util.h"
#include "animatable.h" #include "animatable.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
+1
View File
@@ -1,4 +1,5 @@
#include "util.h" #include "util.h"
#include <fstream> #include <fstream>
using namespace std; using namespace std;