Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double cdx,cdy;
- cdx=camera.xto-camera.x;
- cdy=camera.yto-camera.y;
- double dir;
- dir=atan2(cdy,cdx);
- dir-=dx/200;
- double r;
- r=sqrt(cdx*cdx+cdy*cdy);
- camera.xto=r*cos(dir);
- camera.yto=r*sin(dir);
- camera.zto+=dy/200;
- SDL_WarpMouse(SCREEN_WIDTH/2,SCREEN_HEIGHT/2);
Advertisement
Add Comment
Please, Sign In to add comment