zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Zeni::Projector2D Class Reference

The 2D Projector. More...

#include <Projector.h>

Inherits Zeni::Projector.

Public Member Functions

 Projector2D (const std::pair< Point2f, Point2f > &camera2d=std::make_pair(Point2f(0.0f, 0.0f), Point2f(float(get_Video().get_render_target_size().x), float(get_Video().get_render_target_size().y))), const std::pair< Point2i, Point2i > &viewport=std::make_pair(Point2i(), get_Video().get_render_target_size()))
 
Vector3f project (const Vector3f &world_coord) const
 Map coordinates in the viewing area to screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [-1, 1]) More...
 
Point3f project (const Point3f &world_coord) const
 Map coordinates in the viewing area to screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [-1, 1]) More...
 
Point2f project (const Point2f &world_coord) const
 Map coordinates in the viewing area to screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [-1, 1]) More...
 
Vector3f unproject (const Vector3f &screen_coord) const
 Map screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [-1, 1]) to coordinates in the viewing area. More...
 
Point3f unproject (const Point3f &screen_coord) const
 Map screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [-1, 1]) to coordinates in the viewing area. More...
 
Point2f unproject (const Point2f &screen_coord) const
 Map screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [-1, 1]) to coordinates in the viewing area. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Zeni::Projector
 Projector (const std::pair< Point2i, Point2i > &viewport=std::make_pair(Point2i(), get_Video().get_render_target_size()))
 
 ~Projector ()
 
void init (const std::pair< Point2i, Point2i > &viewport)
 
const Vector3foffset () const
 
const Vector3fsize () const
 

Detailed Description

The 2D Projector.

For converting between world and screen coordinates in 2D

Author
bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 86 of file Projector.h.

Constructor & Destructor Documentation

Zeni::Projector2D::Projector2D ( const std::pair< Point2f, Point2f > &  camera2d = std::make_pair(Point2f(0.0f, 0.0f), Point2f(float(get_Video().get_render_target_size().x), float(get_Video().get_render_target_size().y))),
const std::pair< Point2i, Point2i > &  viewport = std::make_pair(Point2i(), get_Video().get_render_target_size()) 
)
inline

Definition at line 55 of file Projector.hxx.

Member Function Documentation

Vector3f Zeni::Projector2D::project ( const Vector3f world_coord) const
inline

Map coordinates in the viewing area to screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [-1, 1])

Definition at line 62 of file Projector.hxx.

Referenced by project().

Point3f Zeni::Projector2D::project ( const Point3f world_coord) const
inline

Map coordinates in the viewing area to screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [-1, 1])

Definition at line 66 of file Projector.hxx.

References project().

Point2f Zeni::Projector2D::project ( const Point2f world_coord) const
inline

Map coordinates in the viewing area to screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [-1, 1])

Definition at line 70 of file Projector.hxx.

References project().

Vector3f Zeni::Projector2D::unproject ( const Vector3f screen_coord) const
inline

Map screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [-1, 1]) to coordinates in the viewing area.

Definition at line 74 of file Projector.hxx.

Referenced by Zeni::Widget::on_event(), and unproject().

Point3f Zeni::Projector2D::unproject ( const Point3f screen_coord) const
inline

Map screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [-1, 1]) to coordinates in the viewing area.

Definition at line 78 of file Projector.hxx.

References unproject().

Point2f Zeni::Projector2D::unproject ( const Point2f screen_coord) const
inline

Map screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [-1, 1]) to coordinates in the viewing area.

Definition at line 82 of file Projector.hxx.

References unproject().


The documentation for this class was generated from the following files: