#include <StkCamera.h>
|
enum | ProjectionType { Orthographic
, Perspective
} |
|
enum | FrustumPlanes {
LeftPlane = 0
, RightPlane
, TopPlane
, BottomPlane
,
NumPlanes
} |
|
enum | FrustumTestResult { Outside = 0
, Inside = 1
, Straddle = 2
} |
|
|
float | getLeft () const |
|
float | getRight () const |
|
float | getTop () const |
|
float | getBottom () const |
|
float | getNear () const |
| Get near clip plane distance.
|
|
float | getFar () const |
| Get far clip plane distance.
|
|
float | getFovY () const |
|
float | getAspectRatio () const |
| Get aspect ratio of the frustum (width/height)
|
|
ProjectionType | getProjectionType () const |
|
void | setProjectionType (ProjectionType pj_type) |
|
void | setPerspective (float fovy, float aspect, float clip_near, float clip_far) |
|
void | setOrthographic (float left, float right, float bottom, float top, float z_near, float z_far) |
|
void | adjustNearFar (float z_near, float z_far) |
|
const STK::Matrix4x4f & | getProjectionMatrix () const |
| Get the current projection matrix.
|
|
void | setFrustum (float left, float right, float bottom, float top, float z_near, float z_far) |
|
const STK::Matrix4x4f & | getViewMatrix () const |
|
void | setViewMatrix (const STK::Matrix4x4f &vm) |
|
const STK::Matrix4x4f & | getInverseViewMatrix () const |
|
float | calcProjPixelSize (double dist, int resolution) const |
|
void | setLODPixelScale (float s) |
|
float | getLODPixelScale () const |
|
int | frustumSphereTestView (float x, float y, float z, float r) const |
|
int | frustumSphereTestView (const STK::Vector3f &c, float r) const |
|
int | frustumSphereTest (const STK::Vector3f &c, float r) const |
|
int | frustumBoxTestView (const STK::Vector3f ¢er, const STK::Vector3f &xAxis, const STK::Vector3f &yAxis, const STK::Vector3f &zAxis) const |
|
int | frustumBoxTest (const STK::Vector3f ¢er, const STK::Vector3f &xAxis, const STK::Vector3f &yAxis, const STK::Vector3f &zAxis) const |
|
STK::Vector3f | getPosition () const |
|
|
void | calcFrustumPlanes () const |
|
void | calcOrthographicProjection () const |
|
void | calcPerspectiveProjection () const |
|
Camera - Simple camera class.
◆ adjustNearFar()
void Camera::adjustNearFar |
( |
float |
z_near, |
|
|
float |
z_far |
|
) |
| |
Adjust clipping planes. This method assumes that you already have a valid frustum.
◆ calcProjPixelSize()
float STK::Camera::calcProjPixelSize |
( |
double |
dist, |
|
|
int |
resolution |
|
) |
| const |
|
inline |
Return pixel size in units/pixel at the given distance and screen resolution This value can be used for LOD calculations and is scaled by the LOD scale value.
- See also
- setPixelScale()
◆ frustumBoxTest()
Check frustum against oriented bounding box in world coordinates. The OBB is defined by a center point and three half-axes
- Parameters
-
center | Center of the box |
xAxis | Direction and half the length of the box along the x axis. |
xAxis | Direction and half the length of the box along the y axis. |
xAxis | Direction and half the length of the box along the z axis. |
◆ frustumBoxTestView()
Check frustum against oriented bounding box in view coordinates. The OBB is defined by a center point and three half-axes
- Parameters
-
center | Center of the box |
xAxis | Direction and half the length of the box along the x axis. |
xAxis | Direction and half the length of the box along the y axis. |
xAxis | Direction and half the length of the box along the z axis. |
◆ frustumSphereTest()
int STK::Camera::frustumSphereTest |
( |
const STK::Vector3f & |
c, |
|
|
float |
r |
|
) |
| const |
|
inline |
Check if a sphere intersects the frustum. This check assumes the sphere is given in world coordinates
- See also
- frustumSphereTestView
◆ frustumSphereTestView()
int Camera::frustumSphereTestView |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z, |
|
|
float |
r |
|
) |
| const |
Check if a sphere intersects the frustum in view coordinates. This method checks if the sphere centered at (x, y, z) with radius r intersects the frustum. This check requires the sphere to be given in view coordinates.
- Returns
- Inside if sphere is fully contained in the frustum
-
Outside if sphere is fully outsde the frustum
-
Straddle if sphere is partially inside the frustum
◆ getBottom()
float STK::Camera::getBottom |
( |
| ) |
const |
|
inline |
Get frustum bottom. For a perspective frustum this corresponds to the bottom of the near clipping plane.
◆ getFovY()
float STK::Camera::getFovY |
( |
| ) |
const |
|
inline |
Get vertical field of view in degrees. Only valid if frustum is symmetrical in y-direction
◆ getLeft()
float STK::Camera::getLeft |
( |
| ) |
const |
|
inline |
Get frustum left side For a perspective frustum this corresponds to the right side of the near clipping plane.
◆ getPosition()
Get the world position of the camera.
◆ getRight()
float STK::Camera::getRight |
( |
| ) |
const |
|
inline |
Get frustum right side. For a perspective frustum this corresponds to the left side of the near clipping plane.
◆ getTop()
float STK::Camera::getTop |
( |
| ) |
const |
|
inline |
Get frustum top. For a perspective frustum this corresponds to the top of the near clipping plane.
◆ setOrthographic()
void Camera::setOrthographic |
( |
float |
left, |
|
|
float |
right, |
|
|
float |
bottom, |
|
|
float |
top, |
|
|
float |
z_near, |
|
|
float |
z_far |
|
) |
| |
Set orthographic projection.
◆ setPerspective()
void Camera::setPerspective |
( |
float |
fovy, |
|
|
float |
aspect, |
|
|
float |
clip_near, |
|
|
float |
clip_far |
|
) |
| |
Set perspective projection.
The documentation for this class was generated from the following files:
- Native/SilentToolkit/StkScene/StkCamera.h
- Native/SilentToolkit/StkScene/StkCamera.cpp