class Decal

Wraps Decal as a Component.

Public

Constructors

Decal

Decal(const HSceneObject &parent)

Methods

SetSize

void SetSize(const Vector2 &size)

Width and height of the decal.

SetMaterial

void SetMaterial(const HMaterial &material)

Determines the material to use when rendering the decal.

SetMaxDistance

void SetMaxDistance(float distance)

Determines the maximum distance (from its origin) at which the decal is displayed.

SetLayerMask

void SetLayerMask(u32 mask)

Bitfield that allows you to mask on which objects will the decal be projected onto.

Only objects with the matching layers will be projected onto. Note that decal layer mask only supports 32-bits and objects with layers in bits >= 32 will always be projected onto.

SetLayer

void SetLayer(u64 layer)

Determines the layer that controls whether a system is considered visible in a specific camera.

Layer must match camera layer bitfield in order for the camera to render the decal.

GetBounds

Bounds GetBounds() const

Gets world bounds of this object.

staticGetRttiStatic

static RTTIType *GetRttiStatic()

GetRtti

RTTIType *GetRtti() const override

Returns an interface you can use to access class' Run Time Type Information.

GetSize

Vector2 GetSize() const

Width and height of the decal.

GetMaterial

const MaterialType &GetMaterial() const

Determines the material to use when rendering the decal.

GetMaxDistance

float GetMaxDistance() const

Determines the maximum distance (from its origin) at which the decal is displayed.

GetLayerMask

u32 GetLayerMask() const

Bitfield that allows you to mask on which objects will the decal be projected onto.

Only objects with the matching layers will be projected onto. Note that decal layer mask only supports 32-bits and objects with layers in bits >= 32 will always be projected onto.

GetLayer

u64 GetLayer() const

Determines the layer that controls whether a system is considered visible in a specific camera.

Layer must match camera layer bitfield in order for the camera to render the decal.

Protected

Constructors

Decal

Decal()

Methods

GetCoreDependencies

void GetCoreDependencies(Vector<CoreObject *> &dependencies) override

Populates the provided array with all core objects that this core object depends upon.

Dependencies are required for syncing to the render thread, so the system can be aware to update the dependant objects if a dependency is marked as dirty (for example updating a camera's viewport should also trigger an update on camera so it has a chance to potentially update its data).

Initialize

void Initialize() override

Construct any resources the component needs before use.

Called when the parent scene object is initialized. A non-initialized component shouldn't be used in a live scene (i.e. it should not receive any of the component logic updates or events).

OnEnabled

void OnEnabled() override

Called every time a component leaves the Stopped state, if the component is enabled.

This includes component creation if requirements for leaving the Stopped state are met. When called during creation it is called after OnBeginPlay.

OnDisabled

void OnDisabled() override

Called every time a component is placed into the Stopped state.

This includes component destruction if component wasn't already in Stopped state during destruction. When called during destruction it is called before OnDestroyed.

OnDestroyed

void OnDestroyed() override

Called once just before the component is destroyed.

Called regardless of the state the component is in.

OnSceneChanged

void OnSceneChanged(SceneInstance *oldScene, ecs::Entity oldEntity) override

Called when the parent SceneObject's ECS entity is migrated to a new registry (e.g. when moving between scenes).

The old scene and entity are provided so that components can access sub-systems (renderer, physics, etc.) and read any data stored only in ECS fragments.

OnTransformChanged

void OnTransformChanged(TransformChangedFlags flags) override

Called when the component's parent scene object has changed.

Not called if the component is in Stopped state. Also only called if necessary notify flags are set via SetNotifyFlagsInternal().

Private

Methods

GetDecalData

const TDecalData<false> &GetDecalData() const

Returns a reference to the decal data for the CRTP getter interface.

GetFragment

ecs::Decal &GetFragment()

Returns a mutable reference to the ECS decal fragment.

GetFragment

const ecs::Decal &GetFragment() const

Returns a const reference to the ECS decal fragment.

MarkRenderProxyDataDirty

void MarkRenderProxyDataDirty(ComponentDirtyFlag flag = ComponentDirtyFlag::Everything)

Marks the render proxy data as dirty.

This causes the SyncToRenderProxy() method to trigger the next time objects are synced to the render thread.

flags
Flags in case you want to signal that only part of the internal data is dirty. SyncToRenderProxy() will be called regardless and it's up to the implementation to read the flags value if needed.

UpdateBounds

void UpdateBounds()

Updates the internal bounds for the decal.

Call this whenever a property affecting the bounds changes.

Fields

mBounds

Bounds mBounds