Number5
Visualisierung 2 Project - Florian Schober (0828151, f.schober@live.com), Andreas Walch (0926780, walch.andreas89@gmail.com)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Private Attributes | List of all members
SimpleMeshInstance Class Reference

#include <SimpleMesh.hpp>

Inheritance diagram for SimpleMeshInstance:
ISceneObject

Public Member Functions

TransformationgetTransform ()
 
 SimpleMeshInstance (Application *app, SimpleMesh *mesh, bool pickable=true)
 
virtual ~SimpleMeshInstance ()
 
void prepareDraw (DrawArgs &args, Shader *shader)
 
virtual bool update (double time, double timeDelta)
 
template<typename t >
void uniform (string const &name, t value)
 
id_t const & getId () const
 
id_t const getPickId () const
 

Protected Attributes

Applicationm_app
 
id_t m_id
 
bool m_pickable
 

Private Attributes

SimpleMeshm_mesh
 
Transformation m_transformation
 
map< string, function< void(Shader *)> > m_uniforms
 

Detailed Description

SimpleMeshInstance is an instance of a simple-mesh. It will actually be rendered and is registered in the scene-graph.

Definition at line 11 of file SimpleMesh.hpp.

Constructor & Destructor Documentation

SimpleMeshInstance ( Application app,
SimpleMesh mesh,
bool  pickable = true 
)

Creates a SimpleMeshInstance

Parameters
appThe global application
meshThe SimpleMesh of which this object is an instance
pickableIf pickable is true this object will be drawn into the id-buffer to make it visible to the picker

Definition at line 6 of file SimpleMesh.cpp.

~SimpleMeshInstance ( )
virtual

Destructs a SimpleMeshInstance and unregisters it at its SimpleMesh.

Definition at line 11 of file SimpleMesh.cpp.

Member Function Documentation

id_t const& getId ( ) const
inlineinherited

Accessor to the objects id.

Returns
The objects id.

Definition at line 23 of file ISceneObject.hpp.

id_t const getPickId ( ) const
inlineinherited

Accessor to the picking-id. This is 0 for non-pickable obejcts, and the objects id for every other object.

Returns
The picking-id.

Definition at line 28 of file ISceneObject.hpp.

Transformation& getTransform ( )
inline

Accessor for instances transformation

Returns
a reference of the instances transformation

Definition at line 22 of file SimpleMesh.hpp.

void prepareDraw ( DrawArgs args,
Shader shader 
)

Sets all uniforms in the shader that are necessary for this instance to be drawn.

Parameters
argsThe DrawArgs that should be used for this rendering
shaderThe shader that should be used for this rendering

Definition at line 17 of file SimpleMesh.cpp.

void uniform ( string const &  name,
value 
)
inline

Sets a specific uniform for this instance.

Parameters
nameThe uniform-name
valueThe uniform's value

Definition at line 58 of file SimpleMesh.hpp.

bool update ( double  time,
double  timeDelta 
)
virtual

Actually does nothing but to return wheter or not the objects transformation has changed since the last frame.

Parameters
timeThe absolute frame time - ignored
timeDeltaThe time since the last frame - ignored

Reimplemented from ISceneObject.

Definition at line 30 of file SimpleMesh.cpp.

Member Data Documentation

Application* m_app
protectedinherited

The global application

Definition at line 14 of file ISceneObject.hpp.

id_t m_id
protectedinherited

The id of this object

Definition at line 15 of file ISceneObject.hpp.

SimpleMesh* m_mesh
private

The SimpleMesh of which this object is an instance

Definition at line 13 of file SimpleMesh.hpp.

bool m_pickable
protectedinherited

Wheter the object is packable or not

Definition at line 16 of file ISceneObject.hpp.

Transformation m_transformation
private

The transformation of this instance

Definition at line 14 of file SimpleMesh.hpp.

map<string,function<void(Shader*)> > m_uniforms
private

A map of modifier to enable custom uniform-settings for each instance

Definition at line 15 of file SimpleMesh.hpp.


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