Camera¶
Inherited: None
Description¶
Public Methods¶
castRay (float x, float y) |
|
color () const |
|
float |
farPlane () const |
float |
focalDistance () const |
float |
fov () const |
bool |
isScreenSpace () const |
float |
nearPlane () const |
float |
orthoSize () const |
bool |
orthographic () const |
project (const Vector3 & worldSpace) |
|
projectionMatrix () const |
|
float |
ratio () const |
void |
setColor (const Vector4 color) |
void |
setFar (const float distance) |
void |
setFocalDistance (const float focal) |
void |
setFov (const float angle) |
void |
setNear (const float distance) |
void |
setOrthoSize (const float size) |
void |
setOrthographic (const bool mode) |
void |
setRatio (float ratio) |
void |
setScreenSpace (bool mode) |
unproject (const Vector3 & screenSpace) |
|
viewMatrix () const |
Static Methods¶
Camera * |
current () |
std::array<Vector3, 8> |
frustumCorners (const Camera & camera) |
std::array<Vector3, 8> |
frustumCorners (bool ortho, float sigma, float ratio, const Vector3 & position, const Quaternion & rotation, float nearPlane, float farPlane) |
void |
setCurrent (Camera * current) |
Methods Description¶
Ray Camera::castRay (float x, float y)
Returns ray with origin point in camera position and direction to projection plane with x and y coordinates.
Vector4 Camera::color () const
Returns the color with which the screen will be cleared.
See also setColor().
Camera * Camera::current ()
Returns current active camera.
See also setCurrent().
float Camera::farPlane () const
Returns a distance to far cut plane.
float Camera::focalDistance () const
Returns a focal distance for the camera.
See also setFocalDistance().
float Camera::fov () const
Returns field of view angle for the camera in degrees.
See also setFov().
std::array<Vector3, 8> Camera::frustumCorners (Camera & camera)
Returns frustum corners for the camera.
std::array<Vector3, 8> Camera::frustumCorners (bool ortho, float sigma, float ratio, Vector3 & position, Quaternion & rotation, float nearPlane, float farPlane)
Returns frustum corners with provided parameters. This function accepts a list of parameters: ortho is a flag that points orthographic or perspective camera. sigma is an angle of frustum or ortho size in the case of an orthographic camera. ratio is an aspect ratio. position of the frustum in world space. rotation of frustum in world space. nearPlane clipping plane. farPlane clipping plane.
bool Camera::isScreenSpace () const
Returns true is this camera in the screen space mode. Typically used for Editor.
float Camera::nearPlane () const
Returns a distance to near cut plane.
float Camera::orthoSize () const
Returns camera size for orthographic mode.
See also setOrthoSize().
bool Camera::orthographic () const
Returns true for the orthographic mode; for the perspective mode, returns false.
See also setOrthographic().
Transforms position from worldSpace into screen space. Returns result of transformation.
Matrix4 Camera::projectionMatrix () const
Returns projection matrix for the camera.
float Camera::ratio () const
Returns the aspect ratio (width divided by height).
See also setRatio().
void Camera::setColor (Vector4 color)
Sets the color with which the screen will be cleared.
See also color().
void Camera::setCurrent (Camera * current)
Sets current active camera.
See also current().
void Camera::setFar (float distance)
Sets a distance to far cut plane.
void Camera::setFocalDistance (float focal)
Sets a focal distance for the camera.
See also focalDistance().
void Camera::setFov (float angle)
Sets field of view angle for the camera in degrees.
Note: Applicable only for the perspective mode.
See also fov().
void Camera::setNear (float distance)
Sets a distance to near cut plane.
void Camera::setOrthoSize (float size)
Sets camera size for orthographic mode.
See also orthoSize().
void Camera::setOrthographic (bool mode)
Sets orthographic mode.
See also orthographic().
void Camera::setRatio (float ratio)
Sets the aspect ratio (width divided by height).
See also ratio().
void Camera::setScreenSpace (bool mode)
Sets the screen space mode for the camera. Typically used for Editor.
See also isScreenSpace().
Transforms position from screenSpace into world space. Returns result of transformation.
Matrix4 Camera::viewMatrix () const
Returns view matrix for the camera.