Polycode
|
Inherits Polycode::SceneEntity.
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. |
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.
Camera::Camera | ( | Scene * | parentScene | ) |
Constructor.
parentScene | Scene to add the camera to. |
bool Camera::canSee | ( | SceneEntity * | entity | ) |
Checks if the camera can see an entity based on its bounding radius.
entity | Entity to check. |
Number Camera::getExposureLevel | ( | ) |
Returns the camera's exposure value.
Number Camera::getFOV | ( | ) |
Returns the current FOV value for the camera.
bool Camera::isSphereInFrustrum | ( | Vector3 | pos, |
Number | fRadius | ||
) |
Checks if the camera can see a sphere.
pos | Position of the sphere to check. |
fRadius | Radius of the sphere. |
void Camera::setExposureLevel | ( | Number | level | ) |
Sets the exposure for the camera.
The exposure value can be passed to a shader for HDR rendering.
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.
fov | The new FOV value. |
void Camera::setPostFilter | ( | const String & | shaderName | ) |
Sets the post-processing shader for the camera.
shaderName | The shader name of the post-processing filter. |