Advertisement
MateuszGrabarczyk

gk lab 1 eksplozja

Mar 13th, 2023
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. int cubeCounter = 0;
  2. double SCALE = 1.005f;
  3. const int MAX_COUNTER = 100;
  4. void updateCube()
  5. {
  6.  
  7. auto curpos = cubeMatrix.getTrans();
  8. cubeMatrix *= osg::Matrix::translate(-curpos);
  9. cubeMatrix *= osg::Matrix::scale(SCALE, SCALE, SCALE);
  10. cubeCounter++;
  11. if (cubeCounter >= MAX_COUNTER) {
  12. cubeCounter = 0;
  13. for (int i = 0; i < 100; i++) {
  14. cubeMatrix *= osg::Matrix::scale(1.0 / SCALE, 1.0 / SCALE, 1.0 / SCALE);
  15. }
  16.  
  17. }
  18. cubeMatrix *= osg::Matrix::translate(curpos);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement