Public Member Functions

Camera Class Reference

Search for all occurrences

Detailed Description

Represents the projection matrix and common properties of a perspective or orthographic camera.

#include <gfx.h>

Inheritance diagram for Camera:
Inheritance graph
[legend]

List of all members.

Public Member Functions

DllExport  Camera ()
void  setPersp (float f, float asp)
  Initializes the camera with a perspective view given a field-of-view value and aspect ratio.
void  setOrtho (float l, float t, float r, float b)
  Initializes the camera with a orthographic view.
void  setClip (float h, float y)
  Sets the camera clipping hither and yon values.
CameraType  getType (void)
  Returns the type of camera whether it is a perspective camera (PERSP_CAM) or orthographic camera (ORTHO_CAM)
float  getHither (void)
  Returns the clipping hither value.
float  getYon (void)
  Returns the clipping yon value.
DllExport void  reset ()
  Resets the projection matrix.
DllExport void  getProj (float mat[4][4])
  Returns the projection matrix.

Constructor & Destructor Documentation

DllExport Camera ( )

Member Function Documentation

void setPersp ( float  f,
float  asp 
) [inline]

Initializes the camera with a perspective view given a field-of-view value and aspect ratio.

                        { type = PERSP_CAM; persp.fov = f; 
                          persp.aspect = asp; makeMatrix(); }
void setOrtho ( float  l,
float  t,
float  r,
float  b 
) [inline]

Initializes the camera with a orthographic view.

                        { type = ORTHO_CAM; ortho.left = l; ortho.top = t; 
                          ortho.right = r; ortho.bottom = b; makeMatrix(); }
void setClip ( float  h,
float  y 
) [inline]

Sets the camera clipping hither and yon values.

                        { hither = h; yon = y; makeMatrix(); }
CameraType getType ( void  ) [inline]

Returns the type of camera whether it is a perspective camera (PERSP_CAM) or orthographic camera (ORTHO_CAM)

{ return type; }
float getHither ( void  ) [inline]

Returns the clipping hither value.

{ return hither; }
float getYon ( void  ) [inline]

Returns the clipping yon value.

{ return yon; }
DllExport void reset ( )

Resets the projection matrix.

DllExport void getProj ( float  mat[4][4] )

Returns the projection matrix.


Member Data Documentation

float fov
float aspect
float left
float right
float bottom
float top

Camera Camera Camera Camera Camera Camera Camera Camera Camera Camera
Camera Camera Camera Camera Camera Camera Camera Camera Camera Camera