PolyVertex.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 "PolyGlobals.h"
  12. #include "PolyVector3.h"
  13. #include "PolyVector2.h"
  14. #include "PolyColor.h"
  15. #include <vector>
  16. using std::vector;
  17. namespace Polycode {
  18. class Bone;
  19. class _PolyExport BoneAssignment {
  20. public:
  21. BoneAssignment(){
  22. bone = NULL;
  23. }
  24. unsigned int boneID;
  25. float weight;
  26. Bone *bone;
  27. };
  28. class _PolyExport Vertex : public Vector3 {
  29. public:
  30. Vertex();
  31. Vertex(float pos_x, float pos_y, float pos_z, float nor_x, float nor_y, float nor_z);
  32. Vertex(float pos_x, float pos_y, float pos_z, float nor_x, float nor_y, float nor_z, float u, float v);
  33. Vertex(float x, float y, float z);
  34. Vertex(float x, float y, float z, float u, float v);
  35. ~Vertex();
  36. void addBoneAssignment(unsigned int boneID, float boneWeight);
  37. int getNumBoneAssignments();
  38. BoneAssignment *getBoneAssignment(unsigned int index);
  39. void normalizeWeights();
  40. Vector2 *getTexCoord();
  41. void setTexCoord(float u, float v);
  42. void setNormal(float x, float y, float z);
  43. Vector3 *normal;
  44. Vector3 restPosition;
  45. Color vertexColor;
  46. bool useVertexColor;
  47. private:
  48. vector <BoneAssignment*> boneAssignments;
  49. Vector2 *texCoord;
  50. };
  51. }