Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "composant.hpp"
- #include "Move.hpp"
- #include <cmath>
- void Camera::MoveTranslation(Vecteur vec){
- m_Xc += vec.getXv();
- m_Yc += vec.getYv();
- m_Zc += vec.getZv();
- }
- void Camera::MoveRotation(int angle){
- int x = direction->getXv();
- int y = direction->getXv();
- int z = direction->getZv();
- double i;
- i = acos(x/(sqrt(pow(x,2)+ pow(y,2))))+angle;
- x = cos(i);
- if(x - floor(x)>0,5){
- x = ceil(x);
- } else{
- x = floor(x);
- }
- y = sin(i);
- if(y - floor(y)>0,5){
- x = ceil(y);
- } else{
- x = floor(y);
- }
- direction->SetDirection( x, y, z);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement