|
VisuTwin Canvas
C++ 3D Engine — Metal Backend
|
#include <framework/components/render/renderComponent.h>
Public Member Functions | |
| int | batchGroupId () const |
| bool | castShadows () const |
| void | cloneFrom (const Component *source) override |
| void | initializeComponentData () override |
| const std::vector< int > & | layers () const |
| Material * | material () const |
| std::vector< MeshInstance * > & | meshInstances () |
| const std::vector< MeshInstance * > & | meshInstances () const |
| bool | receiveShadows () const |
| RenderComponent (IComponentSystem *system, Entity *entity) | |
| void | setBatchGroupId (int id) |
| void | setCastShadows (bool value) |
| void | setLayers (const std::vector< int > &layers) |
| void | setMaterial (Material *material) |
| void | setReceiveShadows (bool value) |
| void | setType (const std::string &type) |
| const std::string & | type () const |
| ~RenderComponent () override | |
| Public Member Functions inherited from visutwin::canvas::Component | |
| Component (IComponentSystem *system, Entity *entity) | |
| virtual bool | enabled () const |
| Entity * | entity () const |
| virtual void | onDisable () |
| virtual void | onEnable () |
| virtual void | onPostStateChange () |
| virtual void | setEnabled (bool value) |
| IComponentSystem * | system () const |
| virtual | ~Component ()=default |
| Public Member Functions inherited from visutwin::canvas::EventHandler | |
| template<typename... Args> | |
| EventHandler * | fire (const std::string &name, Args &&... args) |
| bool | hasEvent (const std::string &name) const |
| void | initEventHandler () |
| template<typename Callback> requires (!std::is_same_v<std::decay_t<Callback>, HandleEventCallback>) | |
| EventHandler * | off (const std::string &name, Callback &&callback, void *scope=nullptr) |
| EventHandler * | off (const std::string &name="", const HandleEventCallback &callback=HandleEventCallback(), void *scope=nullptr) |
| EventHandler * | offByHandle (EventHandle *handle) |
| template<typename Callback> requires (!std::is_same_v<std::decay_t<Callback>, HandleEventCallback>) | |
| EventHandle * | on (const std::string &name, Callback &&callback, void *scope=nullptr) |
| EventHandle * | on (const std::string &name, HandleEventCallback callback, void *scope=nullptr) |
| template<typename Callback> requires (!std::is_same_v<std::decay_t<Callback>, HandleEventCallback>) | |
| EventHandle * | once (const std::string &name, Callback &&callback, void *scope=nullptr) |
| EventHandle * | once (const std::string &name, HandleEventCallback callback, void *scope=nullptr) |
| virtual | ~EventHandler ()=default |
Static Public Member Functions | |
| static const std::vector< RenderComponent * > & | instances () |
Additional Inherited Members | |
| Protected Member Functions inherited from visutwin::canvas::Component | |
| virtual void | onSetEnabled (bool oldValue, bool newValue) |
| Protected Member Functions inherited from visutwin::canvas::EventHandler | |
| EventHandle * | addCallback (const std::string &name, HandleEventCallback callback, void *scope=nullptr, bool once=false) |
| Protected Attributes inherited from visutwin::canvas::Component | |
| bool | _enabled = true |
| Entity * | _entity |
The RenderComponent enables an Entity to render 3D meshes. The type property can be set to one of several predefined shapes (such as box, sphere, cone and so on). Alternatively, the component can be configured to manage an arbitrary array of MeshInstances. These can either be created programmatically or loaded from an Asset.
Definition at line 30 of file renderComponent.h.
| visutwin::canvas::RenderComponent::RenderComponent | ( | IComponentSystem * | system, |
| Entity * | entity ) |
Definition at line 476 of file renderComponent.cpp.
References visutwin::canvas::Component::Component(), visutwin::canvas::Component::entity(), and visutwin::canvas::Component::system().
Referenced by cloneFrom().
|
override |
Definition at line 482 of file renderComponent.cpp.
|
inline |
Definition at line 66 of file renderComponent.h.
|
inline |
Definition at line 55 of file renderComponent.h.
|
overridevirtual |
Clones mesh instances (sharing mesh/material), layers, type, shadow flags.
Reimplemented from visutwin::canvas::Component.
Definition at line 536 of file renderComponent.cpp.
References visutwin::canvas::Component::_entity, visutwin::canvas::Component::Component(), RenderComponent(), and visutwin::canvas::Component::setEnabled().
|
inlineoverridevirtual |
Implements visutwin::canvas::Component.
Definition at line 36 of file renderComponent.h.
|
inlinestatic |
Definition at line 74 of file renderComponent.h.
Referenced by visutwin::canvas::RenderPassShadowDirectional::execute(), visutwin::canvas::RenderPassShadowLocalNonClustered::execute(), visutwin::canvas::BatchManager::prepare(), visutwin::canvas::Picker::prepare(), and visutwin::canvas::Renderer::renderForwardLayer().
|
inline |
Definition at line 41 of file renderComponent.h.
Referenced by setLayers().
|
inline |
Definition at line 47 of file renderComponent.h.
Referenced by setMaterial(), and visutwin::canvas::ElementInput::syncTextElements().
|
inline |
Definition at line 38 of file renderComponent.h.
|
inline |
Definition at line 39 of file renderComponent.h.
|
inline |
Definition at line 52 of file renderComponent.h.
|
inline |
Definition at line 67 of file renderComponent.h.
| void visutwin::canvas::RenderComponent::setCastShadows | ( | bool | value | ) |
Definition at line 525 of file renderComponent.cpp.
|
inline |
Definition at line 42 of file renderComponent.h.
References layers().
| void visutwin::canvas::RenderComponent::setMaterial | ( | Material * | material | ) |
Definition at line 502 of file renderComponent.cpp.
References material().
| void visutwin::canvas::RenderComponent::setReceiveShadows | ( | bool | value | ) |
Definition at line 514 of file renderComponent.cpp.
| void visutwin::canvas::RenderComponent::setType | ( | const std::string & | type | ) |
Definition at line 493 of file renderComponent.cpp.
References type().
|
inline |
Definition at line 44 of file renderComponent.h.
Referenced by setType().