#include <camera.h>

Public Types | |
| enum | AutoNearFarCullingMode { NO_AUTO_NEAR_FAR = 0, BOUNDING_VOLUME_NEAR_FAR, PRIMITIVE_NEAR_FAR } |
Public Member Functions | |
| Camera (const std::string &name="camera") | |
| Camera (dtCore::View *view, const std::string &name="camera") | |
| void | SetNearFarCullingMode (AutoNearFarCullingMode mode) |
| Change how the near/far culling planes get automatically calculated. | |
| void | SetEnabled (bool enabled) |
| bool | GetEnabled () const |
| Is this Camera enabled? | |
| DeltaWin * | GetWindow () |
| Get the supplied DeltaWin (could be NULL). | |
| const DeltaWin * | GetWindow () const |
| void | SetWindow (DeltaWin *win) |
| Use the supplied DeltaWin to draw into. | |
| const std::string | TakeScreenShot (const std::string &namePrefix) |
| Take a screen shot at end of next frame. | |
| void | SetPerspectiveParams (double vfov, double aspectRatio, double nearClip, double farClip) |
| Set the perspective parameters of this Camera. | |
| void | SetPerspective (double hfov, double vfov, double nearClip, double farClip) |
| DEPRECATED 01/22/08. | |
| void | GetPerspectiveParams (double &vfov, double &aspectRatio, double &nearClip, double &farClip) |
| Get the perspective parameters of this Camera. | |
| void | GetPerspective (double &hfov, double &vfov, double &nearClip, double &farClip) |
| DEPRECATED 01/22/08. | |
| void | SetFrustum (double left, double right, double bottom, double top, double nearClip, double farClip) |
| Set view frustrum of camera lens. | |
| void | GetFrustum (double &left, double &right, double &bottom, double &top, double &nearClip, double &farClip) |
| Get view frustrum in the projection matrix. | |
| void | SetOrtho (double left, double right, double bottom, double top, double nearClip, double farClip) |
| set orthographic mode | |
| float | GetHorizontalFov () |
| |
| float | GetVerticalFov () |
| |
| void | SetProjectionResizePolicy (osg::Camera::ProjectionResizePolicy prp) |
| osg::Camera::ProjectionResizePolicy | GetProjection () |
| void | SetAspectRatio (double aspectRatio) |
| takes a number from 0-1 to set as the aspect ratio | |
| double | GetAspectRatio () |
| |
| void | SetClearColor (float r, float g, float b, float a) |
| Get a handle to the Producer Lens that this Camera uses. | |
| void | SetClearColor (const osg::Vec4 &color) |
| void | GetClearColor (float &r, float &g, float &b, float &a) |
| void | GetClearColor (osg::Vec4 &color) |
| osg::Camera * | GetOSGCamera () |
| Get a non-const handle to the underlying Producer::Camera. | |
| const osg::Camera * | GetOSGCamera () const |
| Get a const handle to the underlying Producer::Camera. | |
| void | SetLODScale (float newScale) |
| Changes the multiplier applied to the Level of Detail distance calculation when rendering. | |
| float | GetLODScale () const |
| |
| virtual void | AddedToScene (Scene *scene) |
| Supply the Scene this Camera has been added to. | |
Protected Member Functions | |
| virtual | ~Camera () |
| virtual void | FrameSynch (const double deltaFrameTime) |
| Override for FrameSynch. | |
| virtual void | OnMessage (MessageData *data) |
| Base override to receive messages. | |
It requires a dtCore::DeltaWin to render the the Scene into. If no DeltaWin is supplied, a default DeltaWin will be created and will be overridden when a valid DeltaWin is supplied using SetWindow().
The method SetScene() supplies the geometry to be rendered from the Camera's point of view.
Any part of the Scene that doesn't contain renderable geometry will be drawn a solid color using the values supplied to SetClearColor().
The Frame() method must be called once per frame. This will update the scene, then cull and draw the visual objects.
| dtCore::Camera::Camera | ( | const std::string & | name = "camera" |
) |
| dtCore::Camera::Camera | ( | dtCore::View * | view, | |
| const std::string & | name = "camera" | |||
| ) |
| dtCore::Camera::~Camera | ( | ) | [protected, virtual] |
| void dtCore::Camera::SetNearFarCullingMode | ( | AutoNearFarCullingMode | mode | ) |
Change how the near/far culling planes get automatically calculated.
| void dtCore::Camera::SetEnabled | ( | bool | enabled | ) |
| bool dtCore::Camera::GetEnabled | ( | ) | const |
Is this Camera enabled?
| const DeltaWin* dtCore::Camera::GetWindow | ( | ) | const [inline] |
| const std::string dtCore::Camera::TakeScreenShot | ( | const std::string & | namePrefix | ) |
Take a screen shot at end of next frame.
| namePrefix | the prefix of the screenshot file to write |
| void dtCore::Camera::SetPerspectiveParams | ( | double | vfov, | |
| double | aspectRatio, | |||
| double | nearClip, | |||
| double | farClip | |||
| ) |
| void dtCore::Camera::SetPerspective | ( | double | hfov, | |
| double | vfov, | |||
| double | nearClip, | |||
| double | farClip | |||
| ) | [inline] |
DEPRECATED 01/22/08.
| void dtCore::Camera::GetPerspectiveParams | ( | double & | vfov, | |
| double & | aspectRatio, | |||
| double & | nearClip, | |||
| double & | farClip | |||
| ) |
| void dtCore::Camera::GetPerspective | ( | double & | hfov, | |
| double & | vfov, | |||
| double & | nearClip, | |||
| double & | farClip | |||
| ) | [inline] |
DEPRECATED 01/22/08.
| void dtCore::Camera::SetFrustum | ( | double | left, | |
| double | right, | |||
| double | bottom, | |||
| double | top, | |||
| double | nearClip, | |||
| double | farClip | |||
| ) |
Set view frustrum of camera lens.
| void dtCore::Camera::GetFrustum | ( | double & | left, | |
| double & | right, | |||
| double & | bottom, | |||
| double & | top, | |||
| double & | nearClip, | |||
| double & | farClip | |||
| ) |
Get view frustrum in the projection matrix.
| void dtCore::Camera::SetOrtho | ( | double | left, | |
| double | right, | |||
| double | bottom, | |||
| double | top, | |||
| double | nearClip, | |||
| double | farClip | |||
| ) |
set orthographic mode
| float dtCore::Camera::GetHorizontalFov | ( | ) |
| float dtCore::Camera::GetVerticalFov | ( | ) |
| void dtCore::Camera::SetProjectionResizePolicy | ( | osg::Camera::ProjectionResizePolicy | prp | ) | [inline] |
| osg::Camera::ProjectionResizePolicy dtCore::Camera::GetProjection | ( | ) | [inline] |
| void dtCore::Camera::SetAspectRatio | ( | double | aspectRatio | ) |
takes a number from 0-1 to set as the aspect ratio
| double dtCore::Camera::GetAspectRatio | ( | ) |
| void dtCore::Camera::SetClearColor | ( | float | r, | |
| float | g, | |||
| float | b, | |||
| float | a | |||
| ) |
Get a handle to the Producer Lens that this Camera uses.
| void dtCore::Camera::SetClearColor | ( | const osg::Vec4 & | color | ) |
| void dtCore::Camera::GetClearColor | ( | float & | r, | |
| float & | g, | |||
| float & | b, | |||
| float & | a | |||
| ) |
| void dtCore::Camera::GetClearColor | ( | osg::Vec4 & | color | ) |
| osg::Camera* dtCore::Camera::GetOSGCamera | ( | ) | [inline] |
Get a non-const handle to the underlying Producer::Camera.
| const osg::Camera* dtCore::Camera::GetOSGCamera | ( | ) | const [inline] |
Get a const handle to the underlying Producer::Camera.
| void dtCore::Camera::SetLODScale | ( | float | newScale | ) |
Changes the multiplier applied to the Level of Detail distance calculation when rendering.
For example, setting this to 2 would double the distance used when picking the LOD. This means the detail will decrease twice as fast.
| float dtCore::Camera::GetLODScale | ( | ) | const |
| void dtCore::Camera::AddedToScene | ( | Scene * | scene | ) | [virtual] |
Supply the Scene this Camera has been added to.
Normally this is done inside dtCore::Scene. So you should probably never have to call this.
Reimplemented from dtCore::Transformable.
| void dtCore::Camera::FrameSynch | ( | const double | deltaFrameTime | ) | [protected, virtual] |
Override for FrameSynch.
| void dtCore::Camera::OnMessage | ( | MessageData * | data | ) | [protected, virtual] |
Base override to receive messages.
This method should be called from derived classes
| data | the message to receive |
Reimplemented from dtCore::Base.