#include <Camera.h>
Inheritance diagram for Teddy::Scenes::Camera:


Public Methods | |
| Camera (const std::string &name, Teddy::Scenes::Scene *scene) | |
| Camera constructor. More... | |
| Teddy::Models::Model * | pick (Teddy::PhysicalComponents::Projection *p, const Teddy::Maths::TVector2< int > &pos) |
| virtual void | projectScene (Teddy::PhysicalComponents::Projection *p) |
| Draw the scene as seen from the camera. More... | |
| void | setMirrorX (const bool mirror_x) |
| void | setNearFar (const float near_clip, const float far_clip) |
| double | getNear () |
| double | getFar () |
| void | setFov (const float fov) |
| Set field of vision. More... | |
| float | getFov () const |
| Return field of vision. More... | |
| void | modFov (const float mod) |
| void | setScene (Teddy::Scenes::Scene *scene) |
| Set Scene for camera. More... | |
| Scene * | getScene () const |
| Return Scene of camera. More... | |
| void | updatePlanes () |
| Calculate view frustum planes. More... | |
| bool | cull (const Teddy::Models::Model &mi) |
| Teddy::Maths::Matrix | getFrustumMatrix (const float left, const float right, const float bottom, const float top, const float nearval, const float farval) const |
| Calculate frustum matrix. More... | |
| Teddy::Maths::Matrix | getPerspectiveMatrix (const float fovy, const float aspect, const float zNear, const float zFar) const |
| Calculate perspective projection matrix. More... | |
| Teddy::Maths::Matrix | getPickMatrix (const Teddy::Maths::TVector2< int > &pos, const Teddy::Maths::TVector2< int > &size, const Teddy::Maths::TRect< int > &viewport) const |
| Teddy::Maths::TVector4< float > | projectVector (const Teddy::Maths::TVector4< float > &v) const |
| void | doProjection (Teddy::PhysicalComponents::Projection *p, const bool load_matrix=true) |
| Calculate and apply perpective camera projection. More... | |
| void | doCamera (Teddy::PhysicalComponents::Projection *p, const bool load_matrix=true) |
| Calculate and apply camera projection according to Projection. More... | |
| void | doObjectMatrix (Teddy::PhysicalComponents::Projection *p, const Teddy::Maths::Matrix &m, const bool load_matrix=true) |
| void | pushObjectMatrix () |
| void | popObjectMatrix () |
| void | updateFrustum () |
| bool | cullPoint (const Teddy::Maths::TVector< float > &v) const |
| bool | cullSphere (const Teddy::Maths::TVector< float > &v, const float radius) const |
| bool | cullAABox (const Teddy::Maths::TVector< float > &pos, const Teddy::Maths::TVector< float > &size) |
Protected Attributes | |
| Teddy::Scenes::Scene * | scene |
| Scene to draw. More... | |
| Teddy::PhysicalComponents::Projection * | active_projection |
| Last active projection where to draw. More... | |
| Teddy::Maths::Matrix | to_screen_s_matrix |
| To screen space -matrix. More... | |
| Teddy::Maths::Matrix | view_matrix |
| Current/latest view matrix. More... | |
| Teddy::Maths::Matrix | projection_matrix |
| Current/latest projection matrix. More... | |
| Teddy::Maths::Matrix | model_view_matrix [MSD] |
| ModelView Matrix stack. More... | |
| Teddy::Maths::TRect< int > | rect |
| Teddy::Maths::Plane | view_plane [6] |
| Camera view volume planes for clipping. More... | |
| int | model_view_matrix_sp |
| ModelView Matrix stack pointer. More... | |
| double | near_clip |
| Near clip plane z. More... | |
| double | far_clip |
| Far clip plane z. More... | |
| double | fov |
| Field of vision. More... | |
| float | frustum [6][4] |
| bool | mirror_x |
| Mirror X. More... | |
| bool | projection_dirty |
| Projection needs to be redone? More... | |
GL_EXT_ cull_vertex
Definition at line 60 of file Camera.h.
|
||||||||||||
|
Camera constructor.
Definition at line 50 of file Camera.cpp. References active_projection, mirror_x, model_view_matrix, model_view_matrix_sp, MSD, and projection_dirty. |
|
|
|
|
||||||||||||
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
Calculate and apply camera projection according to Projection.
Definition at line 96 of file Camera.cpp. References Teddy::Models::Model::getWorldToLocalMatrix, and view_matrix. Referenced by projectScene. |
|
||||||||||||||||
|
|
|
||||||||||||
|
Calculate and apply perpective camera projection.
Definition at line 77 of file Camera.cpp. References far_clip, fov, getPerspectiveMatrix, near_clip, projection_matrix, and updatePlanes. Referenced by projectScene. |
|
|
Definition at line 190 of file Camera.cpp. References far_clip. |
|
|
Return field of vision.
Definition at line 207 of file Camera.cpp. References fov. |
|
||||||||||||||||||||||||||||
|
Calculate frustum matrix.
Definition at line 258 of file Camera.cpp. Referenced by getPerspectiveMatrix. |
|
|
Definition at line 185 of file Camera.cpp. References near_clip. |
|
||||||||||||||||||||
|
Calculate perspective projection matrix.
Definition at line 281 of file Camera.cpp. References getFrustumMatrix, and M_PI. Referenced by doProjection. |
|
||||||||||||||||
|
|
|
|
Return Scene of camera.
Definition at line 219 of file Camera.cpp. References scene. |
|
|
Definition at line 201 of file Camera.cpp. References fov. |
|
||||||||||||
|
|
|
|
Definition at line 112 of file Camera.cpp. References model_view_matrix_sp. |
|
|
Draw the scene as seen from the camera.
Definition at line 139 of file Camera.cpp. References active_projection, doCamera, doProjection, Teddy::Scenes::Scene::draw, IntRect, Teddy::MixIn::Mutex::lock, rect, scene, and Teddy::MixIn::Mutex::unlock. |
|
|
|
|
|
Definition at line 107 of file Camera.cpp. References model_view_matrix_sp. |
|
|
Set field of vision.
Definition at line 196 of file Camera.cpp. References fov. |
|
|
Definition at line 68 of file Camera.cpp. References Teddy::SysSupport::M_INIT, mirror_x, and Teddy::SysSupport::msg. |
|
||||||||||||
|
Definition at line 179 of file Camera.cpp. |
|
|
Set Scene for camera.
Definition at line 213 of file Camera.cpp. References scene. |
|
|
Definition at line 353 of file Camera.cpp. References frustum. |
|
|
Calculate view frustum planes.
Definition at line 329 of file Camera.cpp. References projection_matrix, Teddy::Maths::Matrix::transpose, Vector4, and view_plane. Referenced by doProjection. |
|
|
Last active projection where to draw.
Definition at line 105 of file Camera.h. Referenced by Camera, and projectScene. |
|
|
Far clip plane z.
Definition at line 114 of file Camera.h. Referenced by doProjection, getFar, and setNearFar. |
|
|
Field of vision.
Definition at line 115 of file Camera.h. Referenced by doProjection, getFov, modFov, and setFov. |
|
|
Definition at line 116 of file Camera.h. Referenced by updateFrustum. |
|
|
Mirror X.
Definition at line 117 of file Camera.h. Referenced by Camera, and setMirrorX. |
|
|
ModelView Matrix stack.
Definition at line 109 of file Camera.h. Referenced by Camera. |
|
|
ModelView Matrix stack pointer.
Definition at line 112 of file Camera.h. Referenced by Camera, popObjectMatrix, and pushObjectMatrix. |
|
|
Near clip plane z.
Definition at line 113 of file Camera.h. Referenced by doProjection, getNear, and setNearFar. |
|
|
Projection needs to be redone?
Definition at line 118 of file Camera.h. Referenced by Camera. |
|
|
Current/latest projection matrix.
Definition at line 108 of file Camera.h. Referenced by doProjection, and updatePlanes. |
|
|
Definition at line 110 of file Camera.h. Referenced by projectScene. |
|
|
Scene to draw.
Definition at line 104 of file Camera.h. Referenced by getScene, projectScene, and setScene. |
|
|
To screen space -matrix.
|
|
|
Current/latest view matrix.
Definition at line 107 of file Camera.h. Referenced by doCamera. |
|
|
Camera view volume planes for clipping.
Definition at line 111 of file Camera.h. Referenced by updatePlanes. |