Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*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.
- http://www.youtube.com/user/thecplusplusguy
- */
- #include <SDL/SDL.h>
- #include <GL/gl.h>
- #include <GL/glu.h>
- #include <cstdlib>
- #include <vector>
- #include <string>
- #include <algorithm>
- #include <fstream>
- #include <cstdio>
- #include <iostream>
- #include <cmath>
- #include "objloader.h"
- #ifndef FUNCTION_H
- #define FUNCTION_H
- void drawCube(float size);
- void drawSkybox(float size);
- void initskybox();
- void killskybox();
- void lockCamera();
- void moveCamera(float,float);
- void moveCamerraUp(float,float);
- void Control(float,float,bool);
- void UpdateCamera();
- unsigned int loadTexture(const char*);
- 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);
- 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);
- float trianglearea(coordinate p1,coordinate p2,coordinate p3);
- bool spheresphere(coordinate& c1,float r1,coordinate c2,float r2);
- float pointdistance(coordinate c1,coordinate c2);
- void moveTo(coordinate c);
- coordinate camPos();
- bool sphereplane(coordinate& sp, coordinate vn,coordinate p1,coordinate p2,coordinate p3, coordinate p4,float r);
- void loadAnimation(std::vector<unsigned int>&,std::string,int);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment