A base class that encapsulates behavior of perspective.
#include <AlCamera.h> class AlCamera : public AlObject virtual ~AlCamera(); virtual statusCode deleteObject(); virtual AlObject* copyWrapper() const; virtual AlObjectType type() const; virtual const char* name() const; virtual statusCode setName( const char* ); statusCode addImagePlane( const char * ); AlImagePlane* firstImagePlane( void ); statusCode applyIteratorToImagePlanes( AlIterator*, int& ); AlWindow* firstWindow( void ); AlWindow* nextWindow( AlWindow *lastWindow ); statusCode nextWindowD( AlWindow *lastWindow ); statusCode nearClippingPlane( double& ) const; statusCode farClippingPlane( double& ) const; statusCode setNearClippingPlane( double ); statusCode setFarClippingPlane( double ); statusCode stereoView(boolean&, double&) const; statusCode setStereoView(boolean, double); statusCode motionBlur(boolean&) const; statusCode setMotionBlur(boolean);
This class represents all of the functionality of Alias perspective cameras. When the AlWindow class was developed and it became possible to get and set the window associated with a camera, it became necessary not only to provide an interface to orthographic cameras as well, but also to separate the differences in functionality into two child classes. The AlCamera class remains as a base class, providing access to the behavior that all cameras share. In places where AlCameras were formerly used, it is possible to easily convert old code simply by substituting AlPerspectiveCamera for AlCamera almost everywhere. (A few other small modifications may be necessary.)
Any camera can have image planes attached to it. To create an image plane on a camera, use the addImagePlane() method.
If a window is associated with this camera (which will always be the case for orthographic cameras, but not so for perspective cameras) the firstWindow() function will return it.
Deletes an AlCamera wrapper object.
Makes a copy of the AlCamera. The returned AlCamera will reference the same data as the original.
Abstract base class function, always returns sFailure.
Returns the class identifier ’kCameraType’.
Returns a pointer to this camera’s name.
Changes the camera’s name to the given name. If the given name is not a unique one, then a unique name is generated based on the given name and assigned to the camera. In this case, a status code of sNameChangedToUniqueOne is returned. A copy of the argument string is made, so you are responsible for deleting it.
< newName - the name to be given to the camera
sSuccess - successful
sInvalidObject - the camera is not valid
sInvalidArgument - given pointer is NULL
Builds an image from an image file and attaches it to the camera.
fname - the name of the image to attach to the camera
sSuccess - successful
sInvalidObject - the camera is not valid
sInvalidArgument - given pointer is NULL
sFailure - image could not be built
Returns the first image plane attached to this camera.
Applies an iterator to each image that is attached to this camera.
iter - the iterator to apply
> rc - the return variable for the return value of the last iterator’s application
sSuccess - successful
sInvalidObject - the camera is not valid
sInvalidArgument - given pointer is NULL
Returns the first window attached to this camera.
Returns the next window attached to this camera.
< window - the window from which to walk forward
Destructively points the given wrapper to the next window attached to this camera.
< lastWindow - the window from which to walk forward
sSuccess - the wrapper now points to the next object in the list
sFailure - there is no next window
sInvalidObject - the camera is invalid
sInvalidArgument - the given window is invalid
Returns the distance from the eye position to the near clipping plane.
> ncp - return variable for the distance to the clipping plane
sSuccess - plane was retrieved
sInvalidObject - the camera is not valid
Returns the distance from the eye position to the far clipping plane.
> fcp - return variable for the distance to the clipping plane
sSuccess - plane was retrieved
sInvalidObject - the camera is not valid
Sets the distance between the eye position to the near clipping plane. The new distance to the near clipping plane must be SMALLER than the distance to the far clipping plane.
< newNearDistance - the new distance to the clipping plane
sSuccess - plane was set
sInvalidArgument - new near distance was greater than current far distance
sInvalidObject - the camera is not valid
Sets the distance to the far clipping plane. The new distance to the far clipping plane must be larger than the near clipping plane.
< double newFarDistance - the new distance to the clipping plane
sSuccess - plane was set
sInvalidArgument - new far distance was less than current near list
sInvalidObject - the camera is not valid
Returns the camera stereo view information.
> stereoEnabled - TRUE if stereo view is enabled, FALSE if not
> eyeOffset - ocular separation
sSuccess - successful
sInvalidObject - the camera is not valid
Sets the camera stereo view information.
< stereoEnabled - TRUE to enable stereo viewing, FALSE to disable it
< eyeOffset - ocular separation
sSuccess - successful
sInvalidObject - the camera is not valid
Returns the camera motion blur information.
> blur - TRUE if motion blur is on
sSuccess - successful
sInvalidObject - the camera is not valid
Sets the camera motion blur information.
< blurEnabled - TRUE to enable motion blur
sSuccess - successful
sInvalidObject - the camera is not valid