Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Engine::Scene::SurfaceMeshComponent< CoreMeshType > Class Template Reference

Main class to convert Ra::Core::Asset::GeometryData to Ra::Engine::Mesh. More...

#include <Engine/Scene/GeometryComponent.hpp>

+ Inheritance diagram for Ra::Engine::Scene::SurfaceMeshComponent< CoreMeshType >:
+ Collaboration diagram for Ra::Engine::Scene::SurfaceMeshComponent< CoreMeshType >:

Public Types

using RenderMeshType = typename Data::RenderMeshType::getType<CoreMeshType>::Type
 

Public Member Functions

 SurfaceMeshComponent (const std::string &name, Entity *entity, const Ra::Core::Asset::GeometryData *data)
 
 SurfaceMeshComponent (const std::string &name, Entity *entity, std::shared_ptr< RenderMeshType > data)
 
 SurfaceMeshComponent (const std::string &name, Entity *entity, CoreMeshType &&mesh, Core::Asset::MaterialData *mat=nullptr)
 
 SurfaceMeshComponent (const std::string &name, Entity *entity, CoreMeshType &&mesh, std::shared_ptr< Data::Material > mat)
 
const CoreMeshType & getCoreGeometry () const
 Returns the current display geometry.
 
RenderMeshType * getDisplayable ()
 
void setupIO (const std::string &id) override
 
void setDeformable (bool b)
 
- Public Member Functions inherited from Ra::Engine::Scene::GeometryComponent
 GeometryComponent (const std::string &name, Entity *entity)
 
void initialize () override
 Pure virtual method to be overridden by any component. When this method is called you are guaranteed that all other startup systems have been loaded.
 
void setContentName (const std::string &name)
 
- Public Member Functions inherited from Ra::Engine::Scene::Component
 Component (const std::string &name, Entity *entity)
 CONSTRUCTOR.
 
virtual ~Component ()
 DESTRUCTOR.
 
virtual void setEntity (Entity *entity)
 Set entity the component is part of. This method is called by the entity.
 
virtual EntitygetEntity () const
 Return the entity the component belongs to.
 
virtual const std::stringgetName () const
 Return the component's name.
 
virtual void setSystem (System *system)
 Set the system to which the component belongs.
 
virtual SystemgetSystem () const
 Returns the system to which the component belongs.
 
Core::Utils::Index addRenderObject (Rendering::RenderObject *renderObject)
 Add a new render object to the component. This adds the RO to the manager for drawing.
 
void removeRenderObject (const Core::Utils::Index &roIdx)
 Remove the render object from the component.
 
virtual bool canEdit (const Core::Utils::Index &) const
 Returns true if a transform can be edited with the render object index given as a key.
 
virtual Core::Transform getTransform (const Core::Utils::Index &) const
 Get the transform associated with the given RO index key.
 
virtual void setTransform (const Core::Utils::Index &, const Core::Transform &)
 Set the new transform associated with the RO index key.
 
void notifyRenderObjectExpired (const Core::Utils::Index &idx)
 
virtual Core::Aabb computeAabb ()
 
void invalidateAabb ()
 
const std::vector< Core::Utils::Index > & getRenderObjects ()
 

Additional Inherited Members

- Public Attributes inherited from Ra::Engine::Scene::Component
std::vector< Core::Utils::Index > m_renderObjects
 
- Static Protected Member Functions inherited from Ra::Engine::Scene::Component
static Rendering::RenderObjectManager * getRoMgr ()
 Shortcut to access the render object manager.
 
- Protected Attributes inherited from Ra::Engine::Scene::GeometryComponent
Ra::Core::Utils::Index m_roIndex {}
 
std::string m_contentName {}
 
- Protected Attributes inherited from Ra::Engine::Scene::Component
std::string m_name {}
 
Entitym_entity { nullptr }
 
Systemm_system { nullptr }
 

Detailed Description

template<typename CoreMeshType>
class Ra::Engine::Scene::SurfaceMeshComponent< CoreMeshType >

Main class to convert Ra::Core::Asset::GeometryData to Ra::Engine::Mesh.

Exports access to the mesh geometry:

  • SurfaceMeshComponent: get, rw (set vertices, normals and triangles dirty)
  • Vertices: rw (if deformable)
  • normals: rw (if deformable)
  • triangles: rw (if deformable)

Definition at line 63 of file GeometryComponent.hpp.

Member Typedef Documentation

◆ RenderMeshType

template<typename CoreMeshType >
using Ra::Engine::Scene::SurfaceMeshComponent< CoreMeshType >::RenderMeshType = typename Data::RenderMeshType::getType<CoreMeshType>::Type

Definition at line 68 of file GeometryComponent.hpp.

Constructor & Destructor Documentation

◆ SurfaceMeshComponent() [1/4]

template<typename CoreMeshType >
Ra::Engine::Scene::SurfaceMeshComponent< CoreMeshType >::SurfaceMeshComponent ( const std::string & name,
Entity * entity,
const Ra::Core::Asset::GeometryData * data )
inline

Definition at line 219 of file GeometryComponent.hpp.

◆ SurfaceMeshComponent() [2/4]

template<typename CoreMeshType >
Ra::Engine::Scene::SurfaceMeshComponent< CoreMeshType >::SurfaceMeshComponent ( const std::string & name,
Entity * entity,
std::shared_ptr< RenderMeshType > data )
inline

Definition at line 228 of file GeometryComponent.hpp.

◆ SurfaceMeshComponent() [3/4]

template<typename CoreMeshType >
Ra::Engine::Scene::SurfaceMeshComponent< CoreMeshType >::SurfaceMeshComponent ( const std::string & name,
Entity * entity,
CoreMeshType && mesh,
Core::Asset::MaterialData * mat = nullptr )
inline

Constructor from an existing mesh

Warning
Moves the mesh and takes its ownership

Definition at line 236 of file GeometryComponent.hpp.

◆ SurfaceMeshComponent() [4/4]

template<typename CoreMeshType >
Ra::Engine::Scene::SurfaceMeshComponent< CoreMeshType >::SurfaceMeshComponent ( const std::string & name,
Entity * entity,
CoreMeshType && mesh,
std::shared_ptr< Data::Material > mat )
inline

Definition at line 247 of file GeometryComponent.hpp.

Member Function Documentation

◆ getCoreGeometry()

template<typename CoreMeshType >
const CoreMeshType & Ra::Engine::Scene::SurfaceMeshComponent< CoreMeshType >::getCoreGeometry ( ) const
inline

Returns the current display geometry.

Definition at line 319 of file GeometryComponent.hpp.

◆ getDisplayable()

template<typename CoreMeshType >
SurfaceMeshComponent< CoreMeshType >::RenderMeshType * Ra::Engine::Scene::SurfaceMeshComponent< CoreMeshType >::getDisplayable ( )
inline

Definition at line 326 of file GeometryComponent.hpp.

◆ setupIO()

template<typename CoreMeshType >
void Ra::Engine::Scene::SurfaceMeshComponent< CoreMeshType >::setupIO ( const std::string & id)
inlineoverridevirtual

Reimplemented from Ra::Engine::Scene::GeometryComponent.

Definition at line 332 of file GeometryComponent.hpp.


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