|
VisuTwin Canvas
C++ 3D Engine — Metal Backend
|
#include <framework/script/shadowCatcher.h>
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> | |
| EventHandler * | fire (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>) | |
| EventHandler * | off (const std::string &name, Callback &&callback, void *scope=nullptr) |
| EventHandler * | off (const std::string &name="", const HandleEventCallback &callback=HandleEventCallback(), void *scope=nullptr) |
| EventHandler * | offByHandle (EventHandle *handle) |
| template<typename Callback> requires (!std::is_same_v<std::decay_t<Callback>, HandleEventCallback>) | |
| EventHandle * | on (const std::string &name, Callback &&callback, void *scope=nullptr) |
| EventHandle * | on (const std::string &name, HandleEventCallback callback, void *scope=nullptr) |
| template<typename Callback> requires (!std::is_same_v<std::decay_t<Callback>, HandleEventCallback>) | |
| EventHandle * | once (const std::string &name, Callback &&callback, void *scope=nullptr) |
| EventHandle * | once (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 | |
| Entity * | entity () const |
| Protected Member Functions inherited from visutwin::canvas::EventHandler | |
| EventHandle * | addCallback (const std::string &name, HandleEventCallback callback, void *scope=nullptr, bool once=false) |
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:
mirrors the behavior of
Definition at line 35 of file shadowCatcher.h.
|
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().
|
inline |
Definition at line 51 of file shadowCatcher.h.
|
inline |
|
inlinestaticconstexpr |
Definition at line 38 of file shadowCatcher.h.
|
inline |
Definition at line 52 of file shadowCatcher.h.
| void visutwin::canvas::ShadowCatcher::setPlaneScale | ( | float | value | ) |
Definition at line 19 of file shadowCatcher.cpp.
| void visutwin::canvas::ShadowCatcher::setYOffset | ( | float | value | ) |
Definition at line 27 of file shadowCatcher.cpp.
|
inline |
Definition at line 47 of file shadowCatcher.h.