Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void sendPosition()
- {
- User* user = getUser(USERNAME);
- Position posTmp(1, 1, 1);
- ViewAngle viewAngleTmp(0, 0);
- while(connected)
- {
- View* view = user->getView();
- Position pos = view->getPosition();
- ViewAngle viewAngle = view->getViewAngle();
- if(pos.getX() != posTmp.getX() && pos.getY() != posTmp.getY())
- {
- ostringstream oss;
- oss << "MAJ User Pos " << USERNAME<< " " << pos.getX() << " " << pos.getY() << " " << pos.getZ();
- sendStr(oss.str());
- posTmp.updatePosition(pos);
- }
- if(viewAngle.getPhi() != viewAngleTmp.getPhi() && viewAngle.getTheta() != viewAngleTmp.getTheta())
- {
- ostringstream oss;
- oss << "MAJ User ViewAngle " << USERNAME<< " " << viewAngle.getPhi() << " " << viewAngle.getTheta();
- sendStr(oss.str());
- viewAngle.updateViewAngle(viewAngleTmp);
- }
- SDL_Delay(17); // ~ 60 fps
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement