molecular
Public Member Functions | List of all members
molecular::gfx::ViewSetup Class Reference

#include <ViewSetup.h>

Inheritance diagram for molecular::gfx::ViewSetup:
molecular::gfx::SingleCalleeRenderFunction molecular::gfx::RenderFunction

Public Member Functions

template<class TRenderManager >
 ViewSetup (TRenderManager &manager, RenderContext &renderContext)
 
template<class TRenderManager >
 ViewSetup (TRenderManager &manager)
 
void Execute () override
 
void SetProjectionPerspective (float fieldOfView, float nearPlane, float farPlane)
 Set projection matrix to a perspective projection. More...
 
void SetProjectionOrthographic (float width, float height, float nearPlane, float farPlane)
 Set projection matrix to an orthographic projection. More...
 
void SetCamera (const Vector3 &position, const Quaternion &orientation)
 Sets the view matrix according to a camera with the given parameters. More...
 
void SetCamera (const Matrix4 &cameraMatrix)
 Set view matrix. More...
 
- Public Member Functions inherited from molecular::gfx::SingleCalleeRenderFunction
template<class TRenderManager >
 SingleCalleeRenderFunction (TRenderManager &manager)
 
 SingleCalleeRenderFunction (Scoping &scoping, RenderCmdSink &renderer)
 
util::AxisAlignedBox GetBounds () const override
 
bool BoundsChangedSince (int framecounter) const override
 
void SetCallee (RenderFunction *callee)
 
- Public Member Functions inherited from molecular::gfx::RenderFunction
template<class TRenderManager >
 RenderFunction (TRenderManager &manager)
 
 RenderFunction (Scoping &scoping, RenderCmdSink &renderer)
 
virtual ~RenderFunction ()
 
virtual void Set (Hash, bool)
 Set bool property with given name. More...
 

Additional Inherited Members

- Protected Member Functions inherited from molecular::gfx::RenderFunction
template<class T >
const T * GetVariable (Hash key)
 Convenience shortcut to a variable pointer from the dynamic scope. More...
 
- Protected Attributes inherited from molecular::gfx::SingleCalleeRenderFunction
RenderFunctionmCallee = nullptr
 
- Protected Attributes inherited from molecular::gfx::RenderFunction
ScopingmScoping
 
RenderCmdSinkmRenderer
 

Constructor & Destructor Documentation

template<class TRenderManager >
molecular::gfx::ViewSetup::ViewSetup ( TRenderManager &  manager,
RenderContext renderContext 
)
inline
template<class TRenderManager >
molecular::gfx::ViewSetup::ViewSetup ( TRenderManager &  manager)
inline

Member Function Documentation

void molecular::gfx::ViewSetup::Execute ( )
overridevirtual
void molecular::gfx::ViewSetup::SetCamera ( const Vector3 position,
const Quaternion orientation 
)

Sets the view matrix according to a camera with the given parameters.

This is cheaper than calling SetView with an inverted matrix.

void molecular::gfx::ViewSetup::SetCamera ( const Matrix4 cameraMatrix)
inline

Set view matrix.

void molecular::gfx::ViewSetup::SetProjectionOrthographic ( float  width,
float  height,
float  nearPlane,
float  farPlane 
)

Set projection matrix to an orthographic projection.

void molecular::gfx::ViewSetup::SetProjectionPerspective ( float  fieldOfView,
float  nearPlane,
float  farPlane 
)

Set projection matrix to a perspective projection.

Todo:
Don't pass aspect ratio here. Recalculate on viewport change.

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