29 #ifndef CAMERA_MATRIX_H 30 #define CAMERA_MATRIX_H 32 #include "transform.h" 55 void set_light_bias();
56 void set_perspective(
float p_fovy_degrees,
float p_aspect,
float p_z_near,
float p_z_far,
bool p_flip_fov=
false);
57 void set_orthogonal(
float p_left,
float p_right,
float p_bottom,
float p_top,
float p_znear,
float p_zfar);
58 void set_orthogonal(
float p_size,
float p_aspect,
float p_znear,
float p_zfar,
bool p_flip_fov=
false);
59 void set_frustum(
float p_left,
float p_right,
float p_bottom,
float p_top,
float p_near,
float p_far);
61 static float get_fovy(
float p_fovx,
float p_aspect) {
63 return Math::rad2deg(Math::atan(p_aspect * Math::tan(Math::deg2rad(p_fovx) * 0.5))*2.0);
66 float get_z_far()
const;
67 float get_z_near()
const;
68 float get_aspect()
const;
69 float get_fov()
const;
74 void get_viewport_size(
float& r_width,
float& r_height)
const;
86 void scale_translate_to_fit(
const AABB& p_aabb);
87 void make_scale(
const Vector3 &p_scale);
99 ret.x = matrix[0][0] * p_vec3.x + matrix[1][0] * p_vec3.y + matrix[2][0] * p_vec3.z + matrix[3][0];
100 ret.y = matrix[0][1] * p_vec3.x + matrix[1][1] * p_vec3.y + matrix[2][1] * p_vec3.z + matrix[3][1];
101 ret.z = matrix[0][2] * p_vec3.x + matrix[1][2] * p_vec3.y + matrix[2][2] * p_vec3.z + matrix[3][2];
102 float w = matrix[0][3] * p_vec3.x + matrix[1][3] * p_vec3.y + matrix[2][3] * p_vec3.z + matrix[3][3];
Vector< Plane > get_projection_planes(const Transform &p_transform) const
Definition: camera_matrix.cpp:259
Definition: camera_matrix.h:39
void invert()
Definition: camera_matrix.cpp:358