Sprite Class Reference

A 2d plane that can be rendered to the screen. More...

#include <Sprite.h>

Inherits Model.

Inherited by TextSprite.

Public Member Functions

 Sprite ()
 Constructor. More...
 
 Sprite (MaterialPtr material, bool flipT, PropertiesPtr properties=nullptr)
 Constructor. More...
 
 Sprite (ObjectManager *o, const std::string &textureFileName, const std::string &materialName, ShaderPtr shader, bool flipT, PropertiesPtr properties=nullptr)
 Constructor. More...
 
 Sprite (ObjectManager *o, const std::string &name, const std::string &textureFileName, GLuint shaderMaxLights, bool variableNumberOfLights, bool flipT, PropertiesPtr properties=nullptr)
 Constructor. More...
 
virtual ~Sprite ()
 Virtual destructor. More...
 
- Public Member Functions inherited from Model
 Model ()
 Constructor. More...
 
 Model (ObjectManager *o, const ModelData &modelData, GLuint shaderMaxLights, bool variableNumberOfLights, bool shaderFromFile, bool ambientLighting, PropertiesPtr properties=nullptr)
 Constructor. More...
 
 Model (ObjectManager *o, const ModelData &modelData, ShaderPtr shader, PropertiesPtr properties=nullptr)
 Constructor. More...
 
 Model (const ModelData &modelData, MaterialPtr material, PropertiesPtr properties=nullptr)
 Constructor. More...
 
virtual ~Model ()
 Virtual destructor. More...
 
virtual void draw (GLenum mode=GL_TRIANGLES) override
 Draws the model to the screen. More...
 
virtual void draw (const std::string &geometryName, GLenum mode=GL_TRIANGLES)
 Draws the specified group of geometry to the screen. More...
 
virtual void drawInstance (const std::string &instanceName, GLenum mode=GL_TRIANGLES) override
 Draws an instance of the model to the screen. More...
 
virtual InstanceMapPtr addInstance (const std::string &instanceName)
 Creates an instance of this model and associated geometry. More...
 
virtual PropertiesPtr getInstanceProperties (const std::string &instanceName, const std::string &geometryName)
 Get the properties of a geometry instance. More...
 
virtual InstanceMapPtr getInstanceProperties (const std::string &instanceName)
 Get the instance properties for every shader used in the model. More...
 
virtual void removeInstance (const std::string &instanceName)
 Removes an instance of the model and associated geometry. More...
 
virtual void clearInstances ()
 Removes all instances of the model and associated geometry. More...
 
MaterialPtr getMaterial ()
 Returns the material of the model. More...
 
void setMaterial (MaterialPtr arg)
 Sets the material of the model. More...
 
PropertiesPtr getProperties ()
 Returns the properties of the model. More...
 
void setProperties (PropertiesPtr arg)
 Sets the properties of the model. More...
 
GroupMapgetGroups ()
 Returns the groups of geometry of the model. More...
 
vmml::AABBf & getBoundingBoxObjectSpace ()
 Returns the bounding box of the geometry in object space. More...
 
void setBoundingBoxObjectSpace (vmml::AABBf arg)
 Sets the bounding box of the geometry in object space. More...
 
virtual void addGeometry (const std::string &name, GeometryPtr geometry)
 Adds geometry to the model. More...
 
virtual void removeGeometry (const std::string &name)
 Removes geometry from the model. More...
 
virtual void deleteModelGeometry ()
 Deletes all geometry of the model. More...
 
- Public Member Functions inherited from IDrawable
virtual ~IDrawable ()
 Virtual destructor. More...
 

Additional Inherited Members

- Public Types inherited from Model
typedef std::unordered_map< std::string, GeometryPtrGroupMap
 
typedef std::shared_ptr< std::unordered_map< ShaderPtr, PropertiesPtr > > InstanceMapPtr
 
typedef std::unordered_map< std::string, InstanceMapPtrInstancesMap
 

Detailed Description

A 2d plane that can be rendered to the screen.

Author
Benjamin Buergisser

Constructor & Destructor Documentation

Sprite::Sprite ( )
inline

Constructor.

Sprite::Sprite ( MaterialPtr  material,
bool  flipT,
PropertiesPtr  properties = nullptr 
)

Constructor.

Parameters
[in]material
[in]flipTFlip T axis of texture
[in]propertiesProperties that will be passed to the shader of the model (optional)
Sprite::Sprite ( ObjectManager o,
const std::string &  textureFileName,
const std::string &  materialName,
ShaderPtr  shader,
bool  flipT,
PropertiesPtr  properties = nullptr 
)

Constructor.

Parameters
[in]oObject management
[in]textureFileNameThe filename of the texture that should be loaded and displayed
[in]materialNameThe name of the material that should be created
[in]shader
[in]flipTFlip T axis of texture
[in]propertiesProperties that will be passed to the shader of the model (optional)
Sprite::Sprite ( ObjectManager o,
const std::string &  name,
const std::string &  textureFileName,
GLuint  shaderMaxLights,
bool  variableNumberOfLights,
bool  flipT,
PropertiesPtr  properties = nullptr 
)

Constructor.

Parameters
[in]oObject management
[in]nameThe name for the shader and material that will be generated
[in]textureFileNameThe filename of the texture that should be loaded and displayed
[in]shaderMaxLightsThe maximum number of light sources to be used
[in]variableNumberOfLightsSet true if the number of lights may vary, otherwise the number of lights has to be the same as specified as maximum number of lights
[in]flipTFlip T axis of texture
[in]propertiesProperties that will be passed to the shader of the model (optional)
virtual Sprite::~Sprite ( )
inlinevirtual

Virtual destructor.