godexsoft/x2d

Object - position encapsulation

Closed this issue · 0 comments

  1. Code a new class for position. It should encapsulate glm::vec3 for the x,y,z position and be convertible to camera space, parent space and world space.
  2. Rewrite object's position usage to the new class

draft ideas:
x2d::position mws( world_space(0.0f, 0.0f, 0.0f) ); // -> middle of world in world space
x2d::position mcs( camera_space(0.5f, 0.5f, 0.0f) ); // -> middle of screen in camera space
x2d::position p1 = mws.to_camera( camera_obj ); // -> convert world to camera space
x2d::position p2 = mcs.to_world( camera_obj ); // -> convert camera space to world