readable vb and obj models via the new interface

This commit is contained in:
devZoGok
2021-10-19 19:06:41 +03:00
parent dba02e7944
commit dd9ad38a34
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ namespace vb01{
cout<<"Failed to load model:"<<importer.GetErrorString()<<endl;
exit(-1);
}
//processNode(scene->mRootNode, scene, this);
processNode(scene->mRootNode, scene, model);
}
void AssimpModelReader::processNode(aiNode *node, const aiScene *scene, Node *currentNode){
+1 -1
View File
@@ -175,7 +175,7 @@ namespace vb01{
shader->setMat4(model,"model");
if(skeleton){
skeleton->update();
//skeleton->update();
shader->editShader(Shader::VERTEX_SHADER,2,"const int numBones="+to_string(skeleton->getNumBones())+";");
shader->editShader(Shader::VERTEX_SHADER,3,"const int numVertGroups="+to_string(numVertexGroups)+";");
+4 -1
View File
@@ -10,10 +10,13 @@ namespace vb01{
}
void Skeleton::update(){
for(Bone *b : bones)
b->update();
}
void Skeleton::addBone(Bone *bone, Bone *parent){
parent->attachChild(bone);
if(parent)
parent->attachChild(bone);
bone->setSkeleton(this);
bones.push_back(bone);
}