VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
visutwin::canvas::ShadowCatcher Class Reference

#include <framework/script/shadowCatcher.h>

Inheritance diagram for visutwin::canvas::ShadowCatcher:
[legend]

Public Member Functions

void initialize () override
float intensity () const
float planeScale () const
void setIntensity (float value)
void setPlaneScale (float value)
void setYOffset (float value)
float yOffset () const
Public Member Functions inherited from visutwin::canvas::Script
bool enabled () const
virtual void fixedUpdate (float fixedDt)
virtual void postInitialize ()
virtual void postUpdate (float dt)
virtual void update (float dt)
Public Member Functions inherited from visutwin::canvas::EventHandler
template<typename... Args>
EventHandlerfire (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>)
EventHandleroff (const std::string &name, Callback &&callback, void *scope=nullptr)
EventHandleroff (const std::string &name="", const HandleEventCallback &callback=HandleEventCallback(), void *scope=nullptr)
EventHandleroffByHandle (EventHandle *handle)
template<typename Callback>
requires (!std::is_same_v<std::decay_t<Callback>, HandleEventCallback>)
EventHandleon (const std::string &name, Callback &&callback, void *scope=nullptr)
EventHandleon (const std::string &name, HandleEventCallback callback, void *scope=nullptr)
template<typename Callback>
requires (!std::is_same_v<std::decay_t<Callback>, HandleEventCallback>)
EventHandleonce (const std::string &name, Callback &&callback, void *scope=nullptr)
EventHandleonce (const std::string &name, HandleEventCallback callback, void *scope=nullptr)
virtual ~EventHandler ()=default

Static Public Member Functions

static constexpr const char * scriptName ()

Additional Inherited Members

Protected Member Functions inherited from visutwin::canvas::Script
Entityentity () const
Protected Member Functions inherited from visutwin::canvas::EventHandler
EventHandleaddCallback (const std::string &name, HandleEventCallback callback, void *scope=nullptr, bool once=false)

Detailed Description

Shadow catcher script — creates an invisible ground plane that only renders shadows.

Attach this script to an entity (typically the same entity or parent that holds the model). The script creates a child plane entity with a special material that:

  • Uses multiplicative blending (BLEND_MULTIPLICATIVE)
  • Has the shadowCatcher flag set (triggers VT_FEATURE_SHADOW_CATCHER shader path)
  • Does not cast shadows itself
  • Has no diffuse/specular/emissive contribution

mirrors the behavior of

Definition at line 35 of file shadowCatcher.h.

Member Function Documentation

◆ initialize()

void visutwin::canvas::ShadowCatcher::initialize ( )
overridevirtual

Called when script is about to run for the first time. Override this method in subclasses to implement custom initialization logic.

Reimplemented from visutwin::canvas::Script.

Definition at line 35 of file shadowCatcher.cpp.

References visutwin::canvas::Script::entity(), visutwin::canvas::BlendState::multiplicativeBlend(), and visutwin::canvas::DepthState::noWrite().

◆ intensity()

float visutwin::canvas::ShadowCatcher::intensity ( ) const
inline

Definition at line 51 of file shadowCatcher.h.

◆ planeScale()

float visutwin::canvas::ShadowCatcher::planeScale ( ) const
inline

Definition at line 43 of file shadowCatcher.h.

References planeScale().

Referenced by planeScale().

◆ scriptName()

constexpr const char * visutwin::canvas::ShadowCatcher::scriptName ( )
inlinestaticconstexpr

Definition at line 38 of file shadowCatcher.h.

◆ setIntensity()

void visutwin::canvas::ShadowCatcher::setIntensity ( float value)
inline

Definition at line 52 of file shadowCatcher.h.

◆ setPlaneScale()

void visutwin::canvas::ShadowCatcher::setPlaneScale ( float value)

Definition at line 19 of file shadowCatcher.cpp.

◆ setYOffset()

void visutwin::canvas::ShadowCatcher::setYOffset ( float value)

Definition at line 27 of file shadowCatcher.cpp.

◆ yOffset()

float visutwin::canvas::ShadowCatcher::yOffset ( ) const
inline

Definition at line 47 of file shadowCatcher.h.


The documentation for this class was generated from the following files: