PolyVertex.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * PolyVertex.h
  3. * TAU
  4. *
  5. * Created by Ivan Safrin on 3/14/08.
  6. * Copyright 2008 __MyCompanyName__. All rights reserved.
  7. *
  8. */
  9. // @package BasicTypes
  10. #pragma once
  11. #include "PolyString.h"
  12. #include "PolyGlobals.h"
  13. #include "PolyVector3.h"
  14. #include "PolyVector2.h"
  15. #include "PolyColor.h"
  16. #include <vector>
  17. using std::vector;
  18. namespace Polycode {
  19. class Bone;
  20. class _PolyExport BoneAssignment {
  21. public:
  22. BoneAssignment(){
  23. bone = NULL;
  24. }
  25. unsigned int boneID;
  26. float weight;
  27. Bone *bone;
  28. };
  29. class _PolyExport Vertex : public Vector3 {
  30. public:
  31. Vertex();
  32. Vertex(float pos_x, float pos_y, float pos_z, float nor_x, float nor_y, float nor_z);
  33. Vertex(float pos_x, float pos_y, float pos_z, float nor_x, float nor_y, float nor_z, float u, float v);
  34. Vertex(float x, float y, float z);
  35. Vertex(float x, float y, float z, float u, float v);
  36. ~Vertex();
  37. void addBoneAssignment(unsigned int boneID, float boneWeight);
  38. int getNumBoneAssignments();
  39. BoneAssignment *getBoneAssignment(unsigned int index);
  40. void normalizeWeights();
  41. Vector2 *getTexCoord();
  42. void setTexCoord(float u, float v);
  43. void setNormal(float x, float y, float z);
  44. Vector3 *normal;
  45. Vector3 restPosition;
  46. Color vertexColor;
  47. bool useVertexColor;
  48. private:
  49. vector <BoneAssignment*> boneAssignments;
  50. Vector2 *texCoord;
  51. };
  52. }