#include <ddgcamera.h>
Public Members | |||
ddgCamera ( ddgContext *ctx ) | |||
Create a camera object. | |||
void | scene ( ddgScene* s ) | ||
Set the scene which this camera will render. | |||
bool | init (void) | ||
Callback which is called to initialize the camera. | |||
void | draw (void) | ||
Render the scene maintained by this camera. | |||
void | update (void) | ||
Update the camera for the next frame. | |||
bool | map (ddgVector3 vin, ddgVector3 *vout) | ||
Map a 3D world coordinate to view space. More... | |||
bool | unmap (ddgVector3 vin, ddgVector3 *vout) | ||
Map a view coordinate to world space. More... | |||
void | ortho ( unsigned int w, unsigned int h) | ||
Set up an ortho graphic camera. | |||
void | viewport ( int vp[4] ) | ||
Return the window size. vp returns the viewport dimensions in pixels. | |||
ddgContext* | context (void) | ||
Return the context for this camera. |
Class which supports OpenGL camera capabilities. Contains parameters to control various settings Also registers keys for camera motion control.
Should define a set of activities which camera can perform. These activities can then be mapped to events. ddgVector of events is then mapped to activities to allow alternate key mappings.
bool ddgCamera::map (ddgVector3 vin, ddgVector3 * vout) |
Map a 3D world coordinate to view space.
vin is in world space, vout is in view space, Returns false if point is not on view and vout is left unchanged. (Uses OpenGL)
bool ddgCamera::unmap (ddgVector3 vin, ddgVector3 * vout) |
Map a view coordinate to world space.
vin is in view space, vout is in world space, Returns false if point is not in view and vout is left unchanged. (Uses OpenGL)