Camera Class Reference

#include <Camera.h>

Description

The viewport object.

The Camera is the symbolic viewing port for Dynacoe. It acts as the bridge between the rendered scene and the viewer. Any number of Camera s can be maintained, but only one may be used at a time. See Graphics::SetCamera3D(), Graphics::SetCamera2D, and Graphics::SetRenderCamera()

Public Types

enum  Type {
  Perspective3D,
  Orthographic2D
}
 
- Public Types inherited from Entity
enum  UpdateClass {
  Before,
  After
}
 

Functions

void SetType (Type)
 
void Refresh ()
 
void SetTarget (const Dynacoe::Vector &pos)
 
Dynacoe::Vector TransformScreenToWorld (const Dynacoe::Vector &point, float distance)
 
Dynacoe::Vector TransformWorldToScreen (const Dynacoe::Vector &point)
 
void SetRenderResolution (int w, int h)
 
int Width ()
 
int Height ()
 
TransformMatrix GetViewTransform ()
 
TransformMatrix GetProjectionTransform ()
 
FramebufferGetFramebuffer ()
 
AssetID CopyDisplay ()
 
void OnStep ()
 
- Functions inherited from Entity
const std::vector< Entity::ID > & GetChildren () const
 
std::vector< Entity::IDGetAllSubEntities () const
 
bool Contains (Entity::ID)
 
std::vector< Entity::IDFindChildByName (const std::string &)
 
void Step ()
 
void Draw ()
 
void Attach (Entity::ID)
 
void Detach (Entity::ID)
 
template<typename T >
T * CreateChild ()
 
int GetNumChildren ()
 
double StepDuration ()
 
double DrawDuration ()
 
void SetPriority (Priority p)
 
void SetPriorityLast ()
 
void SetPriorityFirst ()
 
Priority GetPriority ()
 
EntityGetParent ()
 
bool HasParent ()
 
void Remove ()
 
void SetName (const std::string &name)
 
ID GetID ()
 
std::string GetName ()
 
void Watch (Variable v)
 
Variable GetWatched (const std::string &name)
 
std::vector< VariableGetWatchedVars ()
 
void Unwatch (const std::string &varName)
 
template<typename T >
T * AddComponent (UpdateClass when=UpdateClass::Before)
 
template<typename T >
T * QueryComponent ()
 
const std::vector< Component * > & GetComponents () const
 
void RemoveComponent (const std::string &tag)
 
void RemoveComponent (const Component *)
 
bool IsStepping ()
 
bool IsDrawing ()
 

Properties

bool autoRefresh
 
- Properties inherited from Entity
bool step
 
bool draw
 

Additional Inherited Members

- Static Functions inherited from Entity
template<typename T >
static Entity::ID Create ()
 
static Entity::ID Create ()
 
template<typename T >
static T * CreateReference ()
 
static std::vector< Entity::IDGetAll ()
 
- Protected Member Functions inherited from Entity
virtual void OnEnter ()
 
virtual void OnDepart ()
 
virtual void OnRemove ()
 
virtual void OnPreStep ()
 
virtual void OnPreDraw ()
 
virtual void OnDraw ()
 

Member Enumeration Documentation

enum Type
strong

The type of Camera.

Enumerator
Perspective3D 

Indicates use for 3D perspective viewing.

Orthographic2D 

brief Indicates use for 2D orthographics viewing

Member Function Documentation

void SetType ( Type  )

Sets the Type of Camera.

void Refresh ( )

Forces clearing of the results of drawing stored within the Camera.

void SetTarget ( const Dynacoe::Vector pos)

Sets the Camera's target.

When called, the Camera will orient itself so that it "looks" at the given point in 3D space.

Parameters
posThe position to face.
Dynacoe::Vector TransformScreenToWorld ( const Dynacoe::Vector point,
float  distance 
)

Converts a point representing a pixel on a display to a point in 3D space.

Parameters
point2DThe point to convert.
disanceThe distance to project the Vector to. In the case of a 3D perspective camera: Since the source is 2D, the Z value is ignored. However, when projecting, since there is no source Z value, The actual depth from the Camera's point of view is undefined when projecting. Thus a distance from the viewpoint is needed.
Dynacoe::Vector TransformWorldToScreen ( const Dynacoe::Vector point)

Converts a point in transformed space to a pixel position on the display.

Parameters
pointThe source point to project onto the Display.
void SetRenderResolution ( int  w,
int  h 
)

Convenience function to set the rendering resultion.

Parameters
wWidth in pixels
hHeight in pixels
int Width ( )

Returns the width of the Camera's framebuffer.

int Height ( )

Returns the height of the Camera's framebuffer.

TransformMatrix GetViewTransform ( )

Returns the viewing matrix of the Camera.

TransformMatrix GetProjectionTransform ( )

Returns the projection matrix of the Camera.

Framebuffer* GetFramebuffer ( )

Returns the framebuffer for the camera.

AssetID CopyDisplay ( )

Returns a copy of the last rendered visual stored to this camera.

void OnStep ( )
virtual

Called when Step() is called.

Reimplemented from Entity.

Field Documentation

bool autoRefresh

Sets whether to call Refresh() automatically.


The documentation for this class was generated from the following file:
  • /home/jc/git/Dynacoe/DynacoeSrc/includes/Dynacoe/Camera.h