#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 } |
![]() | |
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 () |
Framebuffer * | GetFramebuffer () |
AssetID | CopyDisplay () |
void | OnStep () |
![]() | |
const std::vector< Entity::ID > & | GetChildren () const |
std::vector< Entity::ID > | GetAllSubEntities () const |
bool | Contains (Entity::ID) |
std::vector< Entity::ID > | FindChildByName (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 () |
Entity & | GetParent () |
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< Variable > | GetWatchedVars () |
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 |
![]() | |
bool | step |
bool | draw |
Additional Inherited Members | |
![]() | |
template<typename T > | |
static Entity::ID | Create () |
static Entity::ID | Create () |
template<typename T > | |
static T * | CreateReference () |
static std::vector< Entity::ID > | GetAll () |
![]() | |
virtual void | OnEnter () |
virtual void | OnDepart () |
virtual void | OnRemove () |
virtual void | OnPreStep () |
virtual void | OnPreDraw () |
virtual void | OnDraw () |
Member Enumeration Documentation
|
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 Refresh | ( | ) |
Forces clearing of the results of drawing stored within the Camera.
void SetTarget | ( | const Dynacoe::Vector & | pos | ) |
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
-
point2D The point to convert. disance The 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
-
point The source point to project onto the Display.
void SetRenderResolution | ( | int | w, |
int | h | ||
) |
Convenience function to set the rendering resultion.
- Parameters
-
w Width in pixels h Height 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.
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