Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. b2Vec2 Camera::PositionToWorld(b2Vec2 entityPosition, float depth)
  2. {
  3.     b2Vec2 worldPos = entityPosition;
  4.     float parallaxFactor = pow(2, -depth);
  5.     worldPos *= parallaxFactor;
  6.     worldPos = _screenOffset - _position;
  7.     return worldPos;
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement