DzBasicCamera Class Reference
[Scene Items]

A basic camera. More...

Inheritance diagram for DzBasicCamera:

DzCamera DzNode DzElement DzBase QObject Object DzShaderCamera List of all members.

Properties

Number currentViewHeight
Number currentViewWidth
Boolean depthOfField
Number fStop
Boolean isPerspective

Methods

void aimAt (DzVec3 pos)
DzVec3 cursorToRay (Number x, Number y)
DzVec3 cursorToScene (Number x, Number y, Number z)
void frame (DzBox3 box, Number aspect)
DzBoolProperty getDepthOfFieldChannel ()
DzBoolProperty getDisplayPersistenceChannel ()
DzColorProperty getDofColorChannel ()
DzColorProperty getDofOverlayColorChannel ()
DzFloatProperty getDofOverlayOpacityChannel ()
DzBoolProperty getDofVisibilityChannel ()
DzBoolProperty getFarDofVisibilityChannel ()
DzFloatProperty getFocalDistChannel ()
DzFloatProperty getFocalLengthChannel ()
DzFloatProperty getFocalPointScaleChannel ()
DzColorProperty getFovColorChannel ()
DzFloatProperty getFovLengthChannel ()
DzFloatProperty getFovOpacityChannel ()
DzFloatProperty getFStopChannel ()
DzBoolProperty getNearDofVisibilityChannel ()
DzFloatProperty getSightLineOpacityChannel ()
void reset ()
void setType (DzCamera::CameraType type)

Constructors

 DzBasicCamera (DzCamera::CameraType type=DzCamera::PERSPECTIVE_CAMERA, Boolean isViewCamera=false)

Signals

void depthOfFieldChanged ()
 Signature: "projectionChanged()"
void fStopChanged (DzTimeRange range)
 Signature: "fStopChanged(const DzTimeRange&)"

Detailed Description

A basic camera.

This is the basic camera implementation for DAZ Studio. It supplies commonly-used features like focal length adjustment and depth of field alteration.


Constructor & Destructor Documentation

DzBasicCamera::DzBasicCamera ( DzCamera::CameraType  type = DzCamera::PERSPECTIVE_CAMERA,
Boolean  isViewCamera = false 
)

Create a camera of the given type. If isViewCam is true, then the camera will be non-animatable.

Parameters:
type The type of the camera
isViewCamera If true, the camera is a view camera - that is, it only exists as a camera for the purpose of viewing the scene, but is not a member of the scene. If false, the camera is a normal camera that is a member of the scene.
Example:
    // Create a new orthographic camera that looks forward on the Z axis.
    DzCamera    *cam = new DzBasicCamera( DzCamera::FRONT_CAMERA );

    // Name the camera and add it to the scene
    cam->setName( "My Camera" );
    dzScene->addNode( cam );


Member Function Documentation

void DzBasicCamera::aimAt ( DzVec3  pos  ) 

Rotates the camera and adjusts its focal distance so that its focal point is at the given point.

Parameters:
pos The point to aim the camera at.

Reimplemented from DzCamera.

DzVec3 DzBasicCamera::cursorToRay ( Number  x,
Number  y 
)

A ray through the scene for a perspective view

Parameters:
x The x position of the cursor in the viewport
y The y position of the cursor in the viewport
Returns:
A directional vector that defines a ray that intersects the camera's center point.

DzVec3 DzBasicCamera::cursorToScene ( Number  x,
Number  y,
Number  z 
)

Calculates a location in the scene based on an x, y position in the viewport and distance from the camera.

Parameters:
x The x coordinate of the cursor in the viewport
y The y coordinate of the cursor in the viewport
z The distance from the camera in world space at which to calculate the target point.
Returns:
A positional vector that represents the resulting location in the scene.

void DzBasicCamera::depthOfFieldChanged (  )  [signal]

Signature: "projectionChanged()"

Emitted when the camera's depth of field setting has changed.

void DzBasicCamera::frame ( DzBox3  box,
Number  aspect 
)

Translates the camera so that its view frames the given box, and sets the camera's focal point to the center of the box, given the aspect ratio of the current view (w / h)

Parameters:
box The bounding box to frame in the camera's view
aspect The aspect ratio of the current view.

Reimplemented from DzCamera.

void DzBasicCamera::fStopChanged ( DzTimeRange  range  )  [signal]

Signature: "fStopChanged(const DzTimeRange&)"

Emitted when the camera's f-Stop setting has changed.

DzBoolProperty DzBasicCamera::getDepthOfFieldChannel (  ) 

Returns:
A pointer to the depth of field property for the camera.

DzBoolProperty DzBasicCamera::getDisplayPersistenceChannel (  ) 

Returns:
A pointer to the Display Persistence property for the camera.

DzColorProperty DzBasicCamera::getDofColorChannel (  ) 

Returns:
A pointer to the DOF Color property for the camera.

DzColorProperty DzBasicCamera::getDofOverlayColorChannel (  ) 

Returns:
A pointer to the DOF Overlay Color property for the camera.

DzColorProperty DzBasicCamera::getDofOverlayOpacityChannel (  ) 

Returns:
A pointer to the DOF Overlay Opacity property for the camera.

DzBoolProperty DzBasicCamera::getDofVisibilityChannel (  ) 

Returns:
A pointer to the DOF Visibility property for the camera.

DzBoolProperty DzBasicCamera::getFarDofVisibilityChannel (  ) 

Returns:
A pointer to the Far DOF Visibility property for the camera.

DzFloatProperty DzBasicCamera::getFocalDistChannel (  ) 

Returns:
A pointer to the depth of field property for this camera

DzFloatProperty DzBasicCamera::getFocalLengthChannel (  ) 

Returns:
A pointer to the focal length property for this camera

DzFloatProperty DzBasicCamera::getFocalPointScaleChannel (  ) 

Returns:
A pointer to the Focal Point Scale property for the camera.

DzColorProperty DzBasicCamera::getFovColorChannel (  ) 

Returns:
A pointer to the FOV Color property for the camera.

DzFloatProperty DzBasicCamera::getFovLengthChannel (  ) 

Returns:
A pointer to the FOV Length property for the camera.

DzFloatProperty DzBasicCamera::getFovOpacityChannel (  ) 

Returns:
A pointer to the FOV Opacity property for the camera.

DzFloatProperty DzBasicCamera::getFStopChannel (  ) 

Returns:
A pointer to the f/stop property for this camera

DzBoolProperty DzBasicCamera::getNearDofVisibilityChannel (  ) 

Returns:
A pointer to the Near DOF Visibility property for the camera.

DzFloatProperty DzBasicCamera::getSightLineOpacityChannel (  ) 

Returns:
A pointer to the Sight Line Opacity property for the camera.

void DzBasicCamera::reset (  ) 

Resets the camera to its default settings.

Reimplemented from DzCamera.

void DzBasicCamera::setType ( DzCamera::CameraType  type  ) 

Changes the type of the camera.

Parameters:
type The new type for the camera.
Example:
    DzMainWindow    *mw = dzApp->getInterface();

    if( mw ){
        // Get the active camera from the active viewport
        DzCamera    *cam = mw->getViewportMgr()->getActiveViewport()->get3DViewport()->getActiveCamera();

        if( cam->inherits( "DzBasicCamera" ) ){
            // If the camera is a basic camera, make it a perspective view.
            ((DzBasicCamera*)cam)->setType( DzCamera::PERSPECTIVE_CAMERA );
        }
    }


Member Data Documentation

Number DzBasicCamera::currentViewHeight

This property holds the current height of the view (Read Only)

Number DzBasicCamera::currentViewWidth

This property holds the current width of the view (Read Only)

Boolean DzBasicCamera::depthOfField

This property determines whether the camera performs depth of field calculations.

Number DzBasicCamera::fStop

This property holds the f/stop of the camera.

bool DzBasicCamera::isPerspective

This property determines whether the camera is a persective or orthographic view.


Generated on Thu Sep 24 12:21:10 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.