Maria GDK 5.0.0.738
Documentation of native code in develop branch
Loading...
Searching...
No Matches
STK::BillboardRenderItem Class Reference

#include <StkBillboardRenderItem.h>

Inheritance diagram for STK::BillboardRenderItem:
STK::MeshGraphicsModel STK::GraphicsModel Maria::EntityBadge3D STK::TextLabel3D Maria3D::PointSymbolLabel

Public Member Functions

 BillboardRenderItem (const std::shared_ptr< STK::GraphicsRender2D > &gfx_render, const STK::Viewport &vp, const std::string &name)
 
void setShaderName (const std::string &shader_name)
 
const std::string & getShaderName () const
 
void setScale (float scale)
 
float getScale () const
 
void setRenderer (const std::shared_ptr< STK::GraphicsRender2D > &gfx_render)
 
const std::shared_ptr< STK::GraphicsRender2D > & getRenderer () const
 
void setViewport (const STK::Viewport &vp)
 
const STK::ViewportgetViewport () const
 
void setDepthTest (bool depth_test)
 
bool getDepthTest () const
 
void redraw (const STK::Camera &cam, const STK::Viewport &vp, int render_mask, const std::vector< std::shared_ptr< STK::Uniform > > *uniforms) override
 
void calcBoundingSphere (STK::Vector3f &center, double &radius) override
 
void calcBoundingBox (STK::Vector3f &min, STK::Vector3f &max) override
 
- Public Member Functions inherited from STK::MeshGraphicsModel
 MeshGraphicsModel (std::shared_ptr< ShaderProgramManager > prg_mgr, const std::string &name="")
 
void addMeshRender (std::shared_ptr< MeshRender > mesh_render)
 
unsigned int addMeshGroup (std::shared_ptr< MaterialMeshGroup > mesh_grp, const unsigned int layer=0)
 
std::shared_ptr< MaterialMeshGroupgetMeshGroup (const unsigned int id)
 
void setMeshGroup (const unsigned int id, std::shared_ptr< MaterialMeshGroup > mesh_grp)
 
void removeMeshGroup (const unsigned int id)
 
const std::map< unsigned int, std::shared_ptr< MaterialMeshGroup > > & getMeshGroups () const
 
std::map< unsigned int, std::shared_ptr< MaterialMeshGroup > > & getMeshGroups ()
 
std::shared_ptr< STK::MaterialfindMaterial (const std::string &name) const
 
void needsUpdate (const bool needs_update)
 
std::shared_ptr< const MeshNodegetRoot () const
 
std::shared_ptr< MeshNodegetRoot ()
 
void setRoot (const std::shared_ptr< MeshNode > &node)
 
void redraw (const STK::Camera &cam, const STK::Viewport &vp, int render_mask=STK::OpaqueMask, const std::vector< std::shared_ptr< STK::Uniform > > *uniforms=nullptr) override
 
void calcBoundingSphere (STK::Vector3f &center, double &radius) override
 
void drawShadowMap (const STK::Camera &cam, const STK::Viewport &vp, const Camera &shd_cam, const Viewport &shd_vp, STK::ShaderProgram *shader, STK::ShaderProgram *tex_shader) override
 
void addAnimation (std::shared_ptr< AnimationController > anim)
 
const std::vector< std::shared_ptr< AnimationController > > & getAnimations () const
 
int findAnimations (const std::string &search, std::list< std::shared_ptr< AnimationController > > &anims)
 
std::shared_ptr< AnimationControllerfindAnimation (const std::string &name)
 Find the animation with the exact name.
 
void findMeshNodes (const std::string &search, std::vector< std::shared_ptr< STK::MeshNode > > &nodes) const
 
void findMeshNodes (const std::regex &re, std::vector< std::shared_ptr< STK::MeshNode > > &nodes) const
 
std::shared_ptr< STK::MeshNodefindMeshNode (const std::string &name) const
 
void calcBoundingBox (STK::Vector3f &min, STK::Vector3f &max) override
 
std::shared_ptr< STK::ShaderProgramManagershaderProgramManager ()
 
std::shared_ptr< MeshGraphicsModelrefCopy ()
 
void redrawBackToFront (const Camera &cam, const STK::Viewport &, int render_mask, const std::vector< std::shared_ptr< Uniform > > *uniforms)
 
- Public Member Functions inherited from STK::GraphicsModel
 GraphicsModel (const std::string &name="")
 
void setName (const std::string &name)
 
const std::string & getName () const
 
virtual void filterChildren (const filter_fn &fn, std::vector< std::shared_ptr< GraphicsModel > > &matched)
 
void setTransform (const STK::Matrix4x4f &transform)
 
const STK::Matrix4x4fgetTransform () const
 
void setEnvironmentMap (const std::shared_ptr< STK::CubeMap > &env_map)
 
std::shared_ptr< STK::CubeMapgetEnvironmentMap ()
 
std::shared_ptr< const STK::CubeMapgetEnvironmentMap () const
 
void setWireframe (bool wireframe)
 
bool getWireframe () const
 
void setInvisible (bool invisible)
 
bool getInvisible () const
 
void setCastShadows (bool cast_shadows)
 
bool getCastShadows () const
 
void setDebugGraphics (bool debug_gfx)
 
bool getDebugGraphics () const
 
virtual void redraw (const STK::Camera &cam, const STK::Viewport &vp, int render_mask=STK::OpaqueMask, const std::vector< std::shared_ptr< STK::Uniform > > *uniforms=nullptr)=0
 
virtual void drawShadowMap (const STK::Camera &cam, const STK::Viewport &vp, const STK::Camera &shd_cam, const STK::Viewport &shd_vp, STK::ShaderProgram *shader, STK::ShaderProgram *tex_shader)=0
 
virtual void calcBoundingSphere (STK::Vector3f &center, double &radius)=0
 
virtual void calcBoundingBox (STK::Vector3f &min, STK::Vector3f &max)=0
 

Protected Member Functions

virtual void updateGeometry ()
 
bool initGeometry ()
 
- Protected Member Functions inherited from STK::MeshGraphicsModel
void calcNodeBounds (const MeshNode &parent, const STK::Matrix4x4f &m, STK::Vector3f &min, STK::Vector3f &max)
 
void drawHilitMeshes (const STK::Matrix4x4f &mesh_mvp, const STK::Matrix4x4f &pj, const std::vector< HilitMesh > &hilitMeshes)
 
void update ()
 
void updateIfNeeded ()
 

Protected Attributes

std::shared_ptr< FBOTexturefbo_tex_
 
std::shared_ptr< MaterialMeshGroupmesh_grp_
 
std::shared_ptr< STK::GraphicsRender2Dgfx_render_
 
bool dirty_ = true
 
std::string shader_name_ = "BillboardFixedSizeTextureNoLighting"
 
float scale_ = 1.0f
 
STK::Viewport viewport_
 
bool depth_test_ = true
 
- Protected Attributes inherited from STK::MeshGraphicsModel
std::shared_ptr< MeshNoderoot_
 
std::map< unsigned int, std::shared_ptr< MaterialMeshGroup > > material_meshes_
 
bool needs_update_
 
std::shared_ptr< ShaderProgramManagerprg_mgr_
 
std::vector< std::shared_ptr< AnimationController > > animations_
 
- Protected Attributes inherited from STK::GraphicsModel
std::string name_
 
STK::Matrix4x4f transform_
 
std::shared_ptr< STK::CubeMapenv_map_
 
bool wireframe_
 
bool invisible_
 
bool cast_shadows_
 
bool debug_gfx_
 

Additional Inherited Members

- Public Types inherited from STK::GraphicsModel
using filter_fn = std::function< bool(const GraphicsModel &)>
 
- Static Public Member Functions inherited from STK::MeshGraphicsModel
static void getMeshModels (std::shared_ptr< STK::GraphicsModel > rootModel, std::vector< std::shared_ptr< STK::MeshGraphicsModel > > &mesh_models)
 
- Protected Types inherited from STK::MeshGraphicsModel
using visit_func = std::function< void(const std::shared_ptr< GraphicsModel > &)>
 
- Static Protected Member Functions inherited from STK::MeshGraphicsModel
static void visitTree (const std::shared_ptr< GraphicsModel > &root, visit_func func)
 

Detailed Description

BillboardRenderItem - 3D billboard of a 2D renderitem graphic.

Constructor & Destructor Documentation

◆ BillboardRenderItem()

BillboardRenderItem::BillboardRenderItem ( const std::shared_ptr< STK::GraphicsRender2D > &  gfx_render,
const STK::Viewport vp,
const std::string &  name 
)

Create a 2D render item as a 2D billboard.

Parameters
gfx_render2D Renderer with the relevant items added for creating offscreen texture.
vpSpecific view in the coordinate system of the 2D render to show in the billboard.
nameString ID for the scene graph node.

Member Function Documentation

◆ calcBoundingBox()

void BillboardRenderItem::calcBoundingBox ( STK::Vector3f min,
STK::Vector3f max 
)
overridevirtual

Implements STK::GraphicsModel.

◆ calcBoundingSphere()

void BillboardRenderItem::calcBoundingSphere ( STK::Vector3f center,
double &  radius 
)
overridevirtual

Implements STK::GraphicsModel.

◆ redraw()

void BillboardRenderItem::redraw ( const STK::Camera cam,
const STK::Viewport vp,
int  render_mask,
const std::vector< std::shared_ptr< STK::Uniform > > *  uniforms 
)
overridevirtual

Implements STK::GraphicsModel.

◆ setShaderName()

void STK::BillboardRenderItem::setShaderName ( const std::string &  shader_name)
inline

Set text to be rendered. Multiline text is supported with newline characters '
' in the string.


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