|
SleakEngine 1.0.0
C++23 multi-backend game engine
|
#include <MaterialComponent.hpp>
Public Member Functions | |
| MaterialComponent (GameObject *object, const RefPtr< Material > &material) | |
| MaterialComponent (GameObject *object, const std::string &diffuseTexture) | |
| MaterialComponent (GameObject *object, Material *material) | |
| MaterialComponent (GameObject *object, Math::Color diffuseColor=Math::Color::White) | |
| ~MaterialComponent () override=default | |
| const RefPtr< Material > & | GetMaterial () const |
| Material * | GetMaterialRaw () const |
| bool | Initialize () override |
| Initializes the owned material's GPU resources. | |
| void | OnDisable () override |
| void | OnEnable () override |
| void | SetDiffuseColor (Math::Color color) |
| void | SetDiffuseTexture (const std::string &path) |
| void | SetMaterial (const RefPtr< Material > &material) |
| Replaces the material, re-initializing it if the component is already initialized. | |
| void | SetMaterial (Material *material) |
| Takes ownership of a raw material pointer, re-initializing it if already initialized. | |
| void | SetMetallic (float metallic) |
| void | SetNormalTexture (const std::string &path) |
| void | SetRoughness (float roughness) |
| void | SetShininess (float shininess) |
| void | Update (float DeltaTime) override |
| Submits the material to the render command queue for this frame. | |
| Public Member Functions inherited from Sleak::Component | |
| Component (GameObject *object) | |
| virtual | ~Component ()=default |
| virtual void | FixedUpdate (float fixedDeltaTime) |
| GameObject * | GetOwner () |
| virtual void | LateUpdate (float deltaTime) |
| virtual void | OnDestroy () |
| Called when the component is detached or the owner is destroyed. | |
| Public Member Functions inherited from Sleak::Object | |
| Object (const std::string &name="Object") | |
| virtual | ~Object ()=default |
| const std::string & | GetName () const |
| uint64_t | GetUniqueID () const |
| void | SetName (const std::string &value) |
Additional Inherited Members | |
| Protected Attributes inherited from Sleak::Component | |
| bool | bIsInitialized |
| GameObject * | owner |
Owns and binds a Material for rendering; submits it into the draw command queue each Update while enabled.
Definition at line 13 of file MaterialComponent.hpp.
| Sleak::MaterialComponent::MaterialComponent | ( | GameObject * | object, |
| const RefPtr< Material > & | material ) |
Definition at line 6 of file MaterialComponent.cpp.
| Sleak::MaterialComponent::MaterialComponent | ( | GameObject * | object, |
| Material * | material ) |
Definition at line 10 of file MaterialComponent.cpp.
| Sleak::MaterialComponent::MaterialComponent | ( | GameObject * | object, |
| Math::Color | diffuseColor = Math::Color::White ) |
Definition at line 19 of file MaterialComponent.cpp.
| Sleak::MaterialComponent::MaterialComponent | ( | GameObject * | object, |
| const std::string & | diffuseTexture ) |
Definition at line 27 of file MaterialComponent.cpp.
|
overridedefault |
Definition at line 73 of file MaterialComponent.cpp.
| Material * Sleak::MaterialComponent::GetMaterialRaw | ( | ) | const |
Definition at line 77 of file MaterialComponent.cpp.
|
overridevirtual |
Initializes the owned material's GPU resources.
Implements Sleak::Component.
Definition at line 35 of file MaterialComponent.cpp.
|
overridevirtual |
Reimplemented from Sleak::Component.
Definition at line 52 of file MaterialComponent.cpp.
|
overridevirtual |
Reimplemented from Sleak::Component.
Definition at line 50 of file MaterialComponent.cpp.
| void Sleak::MaterialComponent::SetDiffuseColor | ( | Math::Color | color | ) |
Definition at line 81 of file MaterialComponent.cpp.
| void Sleak::MaterialComponent::SetDiffuseTexture | ( | const std::string & | path | ) |
Definition at line 86 of file MaterialComponent.cpp.
Replaces the material, re-initializing it if the component is already initialized.
Definition at line 54 of file MaterialComponent.cpp.
| void Sleak::MaterialComponent::SetMaterial | ( | Material * | material | ) |
Takes ownership of a raw material pointer, re-initializing it if already initialized.
Definition at line 62 of file MaterialComponent.cpp.
| void Sleak::MaterialComponent::SetMetallic | ( | float | metallic | ) |
Definition at line 103 of file MaterialComponent.cpp.
| void Sleak::MaterialComponent::SetNormalTexture | ( | const std::string & | path | ) |
Definition at line 92 of file MaterialComponent.cpp.
| void Sleak::MaterialComponent::SetRoughness | ( | float | roughness | ) |
Definition at line 108 of file MaterialComponent.cpp.
| void Sleak::MaterialComponent::SetShininess | ( | float | shininess | ) |
Definition at line 98 of file MaterialComponent.cpp.
|
overridevirtual |
Submits the material to the render command queue for this frame.
Implements Sleak::Component.
Definition at line 43 of file MaterialComponent.cpp.