Polycode::Camera Class Reference
Camera in a 3D scene.
More...
Inherits Polycode::SceneEntity.
List of all members.
Public Member Functions |
| Camera (Scene *parentScene) |
| Constructor.
|
bool | isSphereInFrustrum (Vector3 pos, Number fRadius) |
| Checks if the camera can see a sphere.
|
bool | canSee (SceneEntity *entity) |
| Checks if the camera can see an entity based on its bounding radius.
|
void | setFOV (Number fov) |
| Sets the field of view (FOV) for the camera.
|
Number | getFOV () |
| Returns the current FOV value for the camera.
|
void | setExposureLevel (Number level) |
| Sets the exposure for the camera.
|
Number | getExposureLevel () |
| Returns the camera's exposure value.
|
void | setPostFilter (const String &shaderName) |
| Sets the post-processing shader for the camera.
|
void | removePostFilter () |
| Removes the currently assigned post filter.
|
std::vector< ShaderBinding * > | getLocalShaderOptions () |
| Returns the local shader options for the camera post processing material.
|
Material * | getScreenShaderMaterial () |
| Returns the shader material applied to the camera.
|
Detailed Description
Camera in a 3D scene.
Cameras can be added to a scene and changed between dynamically. You can also set a shader to a camera that will run as a screen shader for post-processing effects.
Constructor & Destructor Documentation
Camera::Camera |
( |
Scene * |
parentScene |
) |
|
Constructor.
- Parameters:
-
| parentScene | Scene to add the camera to. |
Member Function Documentation
Checks if the camera can see an entity based on its bounding radius.
- Parameters:
-
- Returns:
- Returns true if the entity's bounding radius is within the camera's frustrum, or false if it isn't.
- See also:
- isSphereInFrustrum()
Number Camera::getExposureLevel |
( |
|
) |
|
Returns the camera's exposure value.
- Returns:
- Current exposure value.
Number Camera::getFOV |
( |
|
) |
|
Returns the current FOV value for the camera.
- Returns:
- Current FOV value for the camera.
bool Camera::isSphereInFrustrum |
( |
Vector3 |
pos, |
|
|
Number |
fRadius | |
|
) |
| | |
Checks if the camera can see a sphere.
- Parameters:
-
| pos | Position of the sphere to check. |
| fRadius | Radius of the sphere. |
- Returns:
- Returns true if the sphere is within the camera's frustrum, or false if it isn't.
- See also:
- canSee()
void Camera::setExposureLevel |
( |
Number |
level |
) |
|
Sets the exposure for the camera.
The exposure value can be passed to a shader for HDR rendering.
- Parameters:
-
| level | The new exposure value. |
void Camera::setFOV |
( |
Number |
fov |
) |
|
Sets the field of view (FOV) for the camera.
The larger the field of view, the more the camera can see, the smaller it is, the more zoomed in it is.
- Parameters:
-
void Camera::setPostFilter |
( |
const String & |
shaderName |
) |
|
Sets the post-processing shader for the camera.
- Parameters:
-
| shaderName | The shader name of the post-processing filter. |