![]() |
#include <camera_matrix.h>
Public Types | |
enum | Planes { PLANE_NEAR, PLANE_FAR, PLANE_LEFT, PLANE_TOP, PLANE_RIGHT, PLANE_BOTTOM } |
Public Member Functions | |
void | set_identity () |
void | set_zero () |
void | set_light_bias () |
void | set_perspective (float p_fovy_degrees, float p_aspect, float p_z_near, float p_z_far, bool p_flip_fov=false) |
void | set_orthogonal (float p_left, float p_right, float p_bottom, float p_top, float p_znear, float p_zfar) |
void | set_orthogonal (float p_size, float p_aspect, float p_znear, float p_zfar, bool p_flip_fov=false) |
void | set_frustum (float p_left, float p_right, float p_bottom, float p_top, float p_near, float p_far) |
float | get_z_far () const |
float | get_z_near () const |
float | get_aspect () const |
float | get_fov () const |
Vector< Plane > | get_projection_planes (const Transform &p_transform) const |
bool | get_endpoints (const Transform &p_transform, Vector3 *p_8points) const |
void | get_viewport_size (float &r_width, float &r_height) const |
void | invert () |
CameraMatrix | inverse () const |
CameraMatrix | operator* (const CameraMatrix &p_matrix) const |
Plane | xform4 (const Plane &p_vec4) |
_FORCE_INLINE_ Vector3 | xform (const Vector3 &p_vec3) const |
operator String () const | |
void | scale_translate_to_fit (const AABB &p_aabb) |
void | make_scale (const Vector3 &p_scale) |
operator Transform () const | |
CameraMatrix (const Transform &p_transform) | |
Static Public Member Functions | |
static float | get_fovy (float p_fovx, float p_aspect) |
Public Attributes | |
float | matrix [4][4] |
Fast Plane Extraction from combined modelview/projection matrices. References: http://www.markmorley.com/opengl/frustumculling.html http://www2.ravensoft.com/users/ggribb/plane%20extraction.pdf
void CameraMatrix::invert | ( | ) |
Locate k'th pivot element
Initialize for search
Product of pivots, gives determinant when finished
"Interchange" rows (with sign change stuff)
If rows are different
"Interchange" columns
If columns are different
Divide column by minus pivot value
Reduce the matrix
Divide row by pivot
Replace pivot by reciprocal (at last we can touch it).