thecplusplusguy

OpenGL (SDL,C++) - 3d collision detection - functions.h

Oct 14th, 2011
2,360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.60 KB | None | 0 0
  1. /*3d Collision detection (sphere-sphere, plane-sphere), I only upload the functions.cpp, the functions.h and third.cpp, the rest of the files are not changed. The third.cpp already contain the material of the next tutorial, because I recordedit after this one.
  2. http://www.youtube.com/user/thecplusplusguy
  3. */
  4. #include <SDL/SDL.h>
  5. #include <GL/gl.h>
  6. #include <GL/glu.h>
  7. #include <cstdlib>
  8. #include <vector>
  9. #include <string>
  10. #include <algorithm>
  11. #include <fstream>
  12. #include <cstdio>
  13. #include <iostream>
  14. #include <cmath>
  15. #include "objloader.h"
  16. #ifndef FUNCTION_H
  17. #define FUNCTION_H
  18.  
  19. void drawCube(float size);
  20. void drawSkybox(float size);
  21. void initskybox();
  22. void killskybox();
  23. void lockCamera();
  24. void moveCamera(float,float);
  25. void moveCamerraUp(float,float);
  26. void Control(float,float,bool);
  27. void UpdateCamera();
  28. unsigned int loadTexture(const char*);
  29. bool raysphere(float xc,float yc, float zc,float xd,float yd, float zd,float xs,float ys, float zs,float r,float* dist=NULL,coordinate* point=NULL);
  30. bool rayplane(float nx,float ny,float nz,float xs,float ys,float zs,float xd,float yd,float zd,coordinate p1,coordinate p2,coordinate p3,coordinate p4,float* dist=NULL,coordinate* point=NULL);
  31. float trianglearea(coordinate p1,coordinate p2,coordinate p3);
  32. bool spheresphere(coordinate& c1,float r1,coordinate c2,float r2);
  33. float pointdistance(coordinate c1,coordinate c2);
  34. void moveTo(coordinate c);
  35. coordinate camPos();
  36. bool sphereplane(coordinate& sp, coordinate vn,coordinate p1,coordinate p2,coordinate p3, coordinate p4,float r);
  37. void loadAnimation(std::vector<unsigned int>&,std::string,int);
  38. #endif
  39.  
Advertisement
Add Comment
Please, Sign In to add comment