Cogs.Core
|
Exposes material properties for legacy entities and code. More...
#include <MaterialComponent.h>
Public Member Functions | |
void COGSCORE_DLL_API | copyProperties (const MaterialComponent *source) |
![]() | |
class Entity * | getContainer () const |
Get the container currently owning this component instance. | |
void | setContainer (class Entity *container) |
Set the container owning this component instance. | |
template<typename ComponentType > | |
ComponentType * | getComponent () const |
COGSFOUNDATION_API Component * | getComponent (const Reflection::Name &name) const |
COGSFOUNDATION_API Component * | getComponent (const Reflection::TypeId &id) const |
template<typename ComponentType > | |
ComponentHandle | getComponentHandle () const |
COGSFOUNDATION_API ComponentHandle | getComponentHandle (const Reflection::Name &name) const |
COGSFOUNDATION_API ComponentHandle | getComponentHandle (const Reflection::TypeId &id) const |
void | setActive () |
Sets the component to the ComponentFlags::Active state. | |
bool | isActive () const |
Gets if the component is currently set to the ComponentFlags::Active state. | |
void | setChanged () |
Sets the component to the ComponentFlags::Changed state with carry. | |
void | setChangedTransient () |
Sets the component to the ComponentFlags::Changed state without carry. | |
void | setFieldChanged (const Reflection::FieldId fieldId) |
Sets the component to the ComponentFlags::Changed state without carry. | |
template<typename ClassType , typename FieldType > | |
void | setFieldChanged (FieldType ClassType::*field) |
Sets a flag indicating that the given field has changed. | |
void | setFieldChangedTransient (const Reflection::FieldId fieldId) |
Sets the component to the ComponentFlags::Changed state without carry. | |
bool | hasChanged () const |
bool | hasAnyfieldChanged () const |
Gets if any fields have been changed. | |
bool | hasFieldChanged (const Reflection::FieldId fieldId) const |
Gets if the field with the given id on this component instance has changed. | |
template<typename ClassType , typename FieldType > | |
bool | hasFieldChanged (FieldType ClassType::*field) const |
Gets if the given field has changed. | |
void | resetCarryChanged () |
Reset the CarryChanged flag. Called at start of redraw. See ComponentFlags::CarryChanged. | |
void | resetChanged () |
Resets the changed state of the component, respecting any carry state set. | |
template<typename ClassType , typename FieldType > | |
Reflection::FieldId | getFieldId (FieldType ClassType::*field) const |
Gets field ID of the given field. | |
void | resetFieldsChanged () |
Resets the state of all changed field flags. | |
void | resetFieldChanged (const Reflection::FieldId fieldId) |
Resets the changed state of the given fieldId. | |
template<typename ClassType , typename FieldType > | |
void | resetFieldChanged (FieldType ClassType::*field) |
Resets the changed state of the given field. | |
constexpr void | setFlags (const uint32_t flags) |
Override all flags of the Component, setting the given flags. | |
constexpr void | setFlag (const uint32_t flag) |
Set the given flags. Does not override the currently set flags. | |
constexpr void | unsetFlag (const uint32_t flag) |
Unset the given flag. Does not remove the status of other than the given flags. | |
constexpr bool | isSet (const uint32_t flag) const |
Checks if the given flag is set. Requires exact bit match if test of several bits. | |
constexpr void | setTypeId (const Reflection::TypeId typeId) |
Set the Reflection::TypeId of the component. | |
constexpr Reflection::TypeId | getTypeId () const |
Get the Reflection::TypeId of the component. | |
COGSFOUNDATION_API const Reflection::Type & | getType () const |
Get the full Reflection::Type of the component. | |
constexpr void | setIndex (const ComponentIndex index) |
Set the components pool index. For internal use only. | |
constexpr ComponentIndex | getIndex () const |
Get the components pool index. For internal use only. | |
constexpr void | setGeneration (uint16_t generation) |
Sets the component generation. | |
constexpr uint16_t | getGeneration () const |
Gets the component generation. | |
size_t | hash (size_t hashValue=Cogs::hash()) const |
Calculates a hash of this component's members. | |
Static Public Member Functions | |
static void | registerType () |
![]() | |
static COGSFOUNDATION_API void | registerType () |
Register the Component type in the global type database. | |
static COGSFOUNDATION_API Reflection::TypeId | getComponentTypeId (const StringView &name) |
Get the type id of the component type with the given name. | |
Exposes material properties for legacy entities and code.
The values used in the material components will automatically be applied to the material instance(s) on the MeshRenderComponent from the same entity. If no instances are found, a new or shared material will be created.
Definition at line 21 of file MaterialComponent.h.
void Cogs::Core::MaterialComponent::copyProperties | ( | const MaterialComponent * | source | ) |
Definition at line 55 of file MaterialComponent.cpp.
|
static |
Definition at line 7 of file MaterialComponent.cpp.
SamplerState::AddressMode Cogs::Core::MaterialComponent::addressMode = SamplerState::Wrap |
Definition at line 59 of file MaterialComponent.h.
glm::vec4 Cogs::Core::MaterialComponent::ambientColor = glm::vec4(0, 0, 0, 1) |
Definition at line 41 of file MaterialComponent.h.
bool Cogs::Core::MaterialComponent::backdrop = false |
If true the MaterialFlags::Backdrop on the material instance.
Definition at line 63 of file MaterialComponent.h.
BlendMode Cogs::Core::MaterialComponent::blendMode = BlendMode::None |
Definition at line 58 of file MaterialComponent.h.
CullMode Cogs::Core::MaterialComponent::cullMode = CullMode::None |
Definition at line 57 of file MaterialComponent.h.
float Cogs::Core::MaterialComponent::depthBiasClamp = 0.f |
Definition at line 51 of file MaterialComponent.h.
float Cogs::Core::MaterialComponent::depthBiasConstant = 0.f |
Definition at line 49 of file MaterialComponent.h.
bool Cogs::Core::MaterialComponent::depthBiasEnable = false |
Definition at line 69 of file MaterialComponent.h.
float Cogs::Core::MaterialComponent::depthBiasSlope = 0.f |
Definition at line 50 of file MaterialComponent.h.
bool Cogs::Core::MaterialComponent::depthTestAlwaysPass = false |
Definition at line 68 of file MaterialComponent.h.
bool Cogs::Core::MaterialComponent::depthTestEnabled = true |
Definition at line 67 of file MaterialComponent.h.
bool Cogs::Core::MaterialComponent::depthWriteEnabled = true |
Definition at line 66 of file MaterialComponent.h.
glm::vec4 Cogs::Core::MaterialComponent::diffuseColor = glm::vec4(1, 1, 1, 1) |
Definition at line 38 of file MaterialComponent.h.
TextureHandle Cogs::Core::MaterialComponent::diffuseMap = TextureHandle::NoHandle |
Definition at line 35 of file MaterialComponent.h.
glm::vec2 Cogs::Core::MaterialComponent::diffuseMapScale = glm::vec2(1, 1) |
Definition at line 42 of file MaterialComponent.h.
int32_t Cogs::Core::MaterialComponent::drawOrder = 0 |
Manages draw order, maps to MaterialOptions::drawOrder.
Definition at line 55 of file MaterialComponent.h.
glm::vec4 Cogs::Core::MaterialComponent::emissiveColor = glm::vec4(0, 0, 0, 1) |
Definition at line 39 of file MaterialComponent.h.
bool Cogs::Core::MaterialComponent::enableAlphaOverride = true |
Definition at line 72 of file MaterialComponent.h.
bool Cogs::Core::MaterialComponent::enableColorOverride = true |
Definition at line 71 of file MaterialComponent.h.
bool Cogs::Core::MaterialComponent::enableLighting = true |
Definition at line 64 of file MaterialComponent.h.
bool Cogs::Core::MaterialComponent::enableOverride = false |
Definition at line 70 of file MaterialComponent.h.
bool Cogs::Core::MaterialComponent::enableTextureOverride = true |
Definition at line 73 of file MaterialComponent.h.
SamplerState::FilterMode Cogs::Core::MaterialComponent::filterMode = SamplerState::FilterMode::MinMagMipLinear |
Definition at line 60 of file MaterialComponent.h.
bool Cogs::Core::MaterialComponent::instancedLine = false |
Lines rendered with instancing.
Definition at line 61 of file MaterialComponent.h.
Referenced by Cogs::Core::ShapeSystem::update().
float Cogs::Core::MaterialComponent::lineWidth = 1.0f |
Definition at line 47 of file MaterialComponent.h.
WeakEntityPtr Cogs::Core::MaterialComponent::material |
Master material entity. When set, all material properties of this instance will be overridden by the values of a MaterialComponent on the master material entity.
Definition at line 25 of file MaterialComponent.h.
Referenced by Cogs::Core::VariableExtrusionSystem::update(), and Cogs::Core::EchoSounder::SwathBottomSystem::update().
TextureHandle Cogs::Core::MaterialComponent::normalMap = TextureHandle::NoHandle |
Definition at line 36 of file MaterialComponent.h.
float Cogs::Core::MaterialComponent::normalMapFactor = 1.0f |
Definition at line 52 of file MaterialComponent.h.
glm::vec2 Cogs::Core::MaterialComponent::normalMapScale = glm::vec2(1, 1) |
Definition at line 43 of file MaterialComponent.h.
float Cogs::Core::MaterialComponent::pointSize = 1.0f |
Definition at line 48 of file MaterialComponent.h.
PrimitiveType::EPrimitiveType Cogs::Core::MaterialComponent::primitiveType = PrimitiveType::TriangleList |
Definition at line 56 of file MaterialComponent.h.
bool Cogs::Core::MaterialComponent::shadowReceiver = true |
If false, object never gets shadowed.
Definition at line 65 of file MaterialComponent.h.
glm::vec4 Cogs::Core::MaterialComponent::specularColor = glm::vec4(0, 0, 0, 1) |
Definition at line 40 of file MaterialComponent.h.
TextureHandle Cogs::Core::MaterialComponent::specularMap = TextureHandle::NoHandle |
Definition at line 37 of file MaterialComponent.h.
glm::vec2 Cogs::Core::MaterialComponent::specularMapScale = glm::vec2(1, 1) |
Definition at line 44 of file MaterialComponent.h.
float Cogs::Core::MaterialComponent::specularPower = 80 |
Definition at line 45 of file MaterialComponent.h.
uint32_t Cogs::Core::MaterialComponent::stippleFactor = 1 |
Definition at line 53 of file MaterialComponent.h.
uint32_t Cogs::Core::MaterialComponent::stipplePattern = 0xFFFFFFFF |
Definition at line 54 of file MaterialComponent.h.
float Cogs::Core::MaterialComponent::transparency = 0 |
Definition at line 46 of file MaterialComponent.h.
bool Cogs::Core::MaterialComponent::vertexColor = false |
Definition at line 62 of file MaterialComponent.h.