Advertisement
Guest User

composant.cpp

a guest
Jun 4th, 2014
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. #include "composant.hpp"
  2.  
  3. //Point
  4. Point::Point():m_Xp(0),m_Yp(0),m_Zp(0){ //Point constructor
  5. }
  6.  
  7. void Point::SetLocation(int x,int y,int z){
  8. m_Xp = x;
  9. m_Yp = y;
  10. m_Zp = z;
  11. }
  12.  
  13. int Point::getXp(){
  14. return m_Xp;
  15. }
  16.  
  17. int Point::getYp(){
  18. return m_Yp;
  19. }
  20.  
  21. int Point::getZp(){
  22. return m_Zp;
  23. }
  24.  
  25. //Vecteur
  26. Vecteur::Vecteur():m_Xv(0),m_Yv(0),m_Zv(0){ //Vecteur constructor
  27. }
  28.  
  29. void Vecteur::SetDirection(int x,int y,int z){
  30. m_Xv = x;
  31. m_Yv = y;
  32. m_Zv = z;
  33. }
  34.  
  35. void Vecteur::SetDirectionBP(Point point1,Point point2){
  36. m_Xv = point2.getYp() - point1.getYp();
  37. m_Yv = point2.getYp() - point1.getYp();
  38. m_Yv = point2.getYp() - point1.getYp();
  39. }
  40.  
  41. int Vecteur::getXv(){
  42. return m_Xv;
  43. }
  44.  
  45. int Vecteur::getYv(){
  46. return m_Yv;
  47. }
  48.  
  49. int Vecteur::getZv(){
  50. return m_Zv;
  51. }
  52.  
  53. //Face
  54. Face::Face(){ //Face constructor
  55. vecteur1 = new Vecteur();
  56. vecteur2 = new Vecteur();
  57. }
  58.  
  59. Face::~Face(){ //Face constructor
  60. delete vecteur1;
  61. delete vecteur2;
  62. }
  63.  
  64. void Face::SetComp(Vecteur vec1,Vecteur vec2){
  65. *vecteur1 = vec1;
  66. *vecteur2 = vec2;
  67. }
  68.  
  69. //Camera
  70. Camera::Camera():m_Xc(),m_Yc(),m_Zc(){
  71. direction = new Vecteur();
  72. }
  73.  
  74. void Camera::SetDirection(int x, int y, int z){
  75. direction->SetDirection( x, y, z);
  76. }
  77.  
  78. void Camera::SetLocation(int x, int y, int z){
  79. m_Xc = x;
  80. m_Yc = y;
  81. m_Zc = z;
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement