Class hierarchy Compound list File list Compound Members File Members

# Camera Class Reference

A camera that gives a view point of the 3D world. More...

Inherits Interface.

List of all members.

## Public Members

- virtual long clear (long Color=-1, int ClearView=1, int ClearZBuf=1) = 0
    Clear the view screen, should be called before rendering a scene.

- virtual long preRender () = 0
    Called prior to rendering for internal special effects.

- virtual long postRender () = 0
    Called after rendering for internal special effects.

- virtual long setViewable (int x, int y, int width, int height) = 0
    Set the viewable area position and dimensions in 2D screen coordinates.

- virtual long setPosition (float x, float y, float z) = 0
    Set the position of the camera in the 3D World.

- virtual long setDirection (float tox, float toy, float toz, float upx, float upy, float upz) = 0
    Set the direction that the camera is pointed to.

- virtual long setVelocity (float v) = 0
    Set the camera velocity.

- virtual long setStars (int Number=1000) = 0
    Add stars to a space scene, to be rendered in the preRender stage.

- virtual long addLight (Light* L) = 0
    Add a light to the scene.

- virtual long removeLight (Light* L) = 0
    remove a light from the scene.

- virtual long follow (const Transformable& t) = 0
    Set the camera to show what the object 'sees'.

- virtual long activate () = 0
    Activate the camera.

- virtual long status () = 0
    Returns non zero if an error has occured.

- virtual Vector3D getPosition () = 0
    Gets the camera's position in the 3D World.

- virtual Vector3D getObjectPosition (Mesh* O) = 0
    Gets the position of an object relative to the camera.

- virtual TColor getBackgroundColor () = 0
    Gets the color used when the frame buffer is cleared.

- virtual void setBackgroundColor (TColor Color) = 0
    Sets the color used when the frame buffer is cleared.

## Related Functions

(Note that these are not member functions.)

- DLLExport Camera* newCamera ()
    Create a new camera object.

## Detailed Description

A camera that gives a view point of the 3D world.

Only one camera can be active at a time, due to a tie with a virtual microphone, giving the 3D sounds of the world.

## Member Function Documentation

### virtual long Camera::clear(long Color=-1, int ClearView=1, int ClearZBuf=1) = 0`[pure virtual]`

Clear the view screen, should be called before rendering a scene.

Color default of -1 uses the background color as set by setBackgroundColor.

### virtual long Camera::preRender() = 0`[pure virtual]`

Called prior to rendering for internal special effects.

### virtual long Camera::postRender() = 0`[pure virtual]`

Called after rendering for internal special effects.

### virtual long Camera::setViewable(int x, int y, int width, int height) = 0`[pure virtual]`

Set the viewable area position and dimensions in 2D screen coordinates.

### virtual long Camera::setPosition(float x, float y, float z) = 0`[pure virtual]`

Set the position of the camera in the 3D World.

### virtual long Camera::setDirection(float tox, float toy, float toz, float upx, float upy, float upz) = 0`[pure virtual]`

Set the direction that the camera is pointed to.

### virtual long Camera::setVelocity(float v) = 0`[pure virtual]`

Set the camera velocity.

This currently is used for audio doppler effects

### virtual long Camera::setStars(int Number=1000) = 0`[pure virtual]`

Add stars to a space scene, to be rendered in the preRender stage.

### virtual long Camera::addLight(Light* L) = 0`[pure virtual]`

Add a light to the scene.

Light objects are not maintained by the camera, and should be allocated and freed by the application

### virtual long Camera::removeLight(Light* L) = 0`[pure virtual]`

remove a light from the scene.

### virtual long Camera::follow(const Transformable& t) = 0`[pure virtual]`

Set the camera to show what the object 'sees'.

### virtual long Camera::activate() = 0`[pure virtual]`

Activate the camera.

### virtual long Camera::status() = 0`[pure virtual]`

Returns non zero if an error has occured.

### virtual Vector3D Camera::getPosition() = 0`[pure virtual]`

Gets the camera's position in the 3D World.

### virtual Vector3D Camera::getObjectPosition(Mesh* O) = 0`[pure virtual]`

Gets the position of an object relative to the camera.

### virtual TColor Camera::getBackgroundColor() = 0`[pure virtual]`

Gets the color used when the frame buffer is cleared.

### virtual void Camera::setBackgroundColor(TColor Color) = 0`[pure virtual]`

Sets the color used when the frame buffer is cleared.

### DLLExport Camera* newCamera()

Create a new camera object.

The documentation for this class was generated from the following file:

- CON_3D.h