3#include "../../Flags.h"
5#include "Foundation/ComponentModel/Component.h"
11 constexpr uint32_t NoObjectId = 0;
58 Annotations = 1u << 2,
61 Controllers = 1u << 5,
62 AllStandard = 0x0000003Fu,
70 AllReserved = 0x00000FC0u,
92 AllCustom = 0xFFFFF000u,
123 uint8_t lodFraction = 0;
224 return ((layerMask & this->layer) != RenderLayers::None) &&
isVisible();
266 constexpr bool customMaterial()
const
281template<>
inline Cogs::StringView getName<Cogs::Core::RenderFlags>() {
return "RenderFlags"; }
282template<>
inline Cogs::StringView getName<Cogs::Core::RenderLayers>() {
return "RenderLayers"; }
283template<>
inline Cogs::StringView getName<Cogs::Core::RenderComponent>() {
return "RenderComponent"; }
Base class for Component instances.
Base component for all rendering content.
static void registerType()
Register the type in the type system.
ComponentModel::ComponentHandle clipShapeComponent
Handle to the currently active clip component, if any.
constexpr bool isVisibleInLayer(RenderLayers layerMask) const
Check if the entity should be visible in the given layer mask.
RenderLayers layer
Layer mask used to determine visibility for a given camera viewport.
int32_t drawOrder
Draw order within a render bucke.
constexpr bool disableCulling() const
Get if the object should skip culling.
constexpr void unsetRenderFlag(RenderFlags flag)
Unset the given flag.
constexpr bool isVisible() const
Check if the entity is visible or not.
constexpr void setRenderFlag(RenderFlags flag)
Sets the given flag.
constexpr void setRenderFlag(RenderFlags flag, bool status)
Set the given flag to the given status.
RenderFlags renderFlags
Render flags used to control rendering behavior.
constexpr bool isRenderFlagSet(RenderFlags flag) const
Check if the given flag is currently set.
constexpr bool isRenderFlagsSet(RenderFlags flags) const
Check if the given combination of flags are set.
constexpr bool castShadows() const
Get if the object should cast shadows.
constexpr bool isPickable() const
Check if the entity is pickable or not.
constexpr void setVisible(bool visible)
Set the specific visibility.
uint32_t objectId
Object identifier passed to rendering commands.
Provides a weakly referenced view over the contents of a string.
RenderFlags
Contains flags to describe rendering behavior.
@ ForcePickable
Ensure component is pickable though it is not rendered.
@ CastShadows
Casts shadows.
@ ParentVisibility
Parent visibility, used by the SceneSystem to toggle child entity visibility on/off.
@ CustomMaterial
Custom material set. Keeps legacy material component from changing the material instance.
@ ParentPickable
Parent pickable, used by the SceneSystem to toggle child entity pickable on/off.
@ Default
Default set of flags.
@ SelfVisibility
Self visibility, used by the SceneSystem to toggle entity visibility on/off.
@ DisableCulling
Disable culling and always force this component to be rendered.
@ SelfPickable
Self pickable, used by the SceneSystem to toggle entity pickable on/off.
RenderLayers
Contains common render layers.
Contains all Cogs related functionality.
Handle to a Component instance.
static ComponentHandle Empty()
Returns an empty, invalid handle. Will evaluate to false if tested against using operator bool().
Lod data holding the LoD state of the entity this render component belongs to.
uint8_t numLods
Total number of LoDs available.
uint8_t currentLod
The assigned LoD of the current component.
uint8_t selectedLod
The selected LoD of the composite entity.