[C++] The IN55 project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vertice.h 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef __VERTICE_H__
  2. #define __VERTICE_H__
  3. #include <iostream>
  4. #include <assimp/cimport.h>
  5. #include <assimp/scene.h>
  6. #include <assimp/postprocess.h>
  7. #include <vectors.h>
  8. #include <utils.h>
  9. #define MAX_BONES 4
  10. class Vertice {
  11. private:
  12. int ID;
  13. aiVector3D position;
  14. aiString bonesName[MAX_BONES];
  15. int numBone;
  16. float bonesWeight[MAX_BONES];
  17. public:
  18. /* Constructor */
  19. Vertice(int id,aiVector3D pos)
  20. {
  21. int i;
  22. ID=id;
  23. position=pos;
  24. for(i = 0; i < MAX_BONES; i++){
  25. bonesName[i] = aiString();
  26. bonesWeight[i] = 0.0f;
  27. }
  28. numBone = 0;
  29. };
  30. void setBones(aiString boneID, float weight){
  31. if(numBone < MAX_BONES){
  32. bonesName[numBone]=boneID;
  33. bonesWeight[numBone++]=weight;
  34. }
  35. };
  36. /*seter */
  37. void setPosition(aiVector3D pos){position=pos;};
  38. /*getter*/
  39. int getID(){return ID;};
  40. aiVector3D &getPosition(){return position;};
  41. aiString getBonesID(int i) { return bonesName[i]; };
  42. int getBoneNumber() { return numBone; };
  43. float getBonesWeight(int i){return bonesWeight[i]; };
  44. float *getBonesWeights(){ return bonesWeight; };
  45. };
  46. #endif