diff --git a/src/Core/Crawl/day.h b/src/Core/Crawl/day.h index 6ac569b..a3e4a08 100644 --- a/src/Core/Crawl/day.h +++ b/src/Core/Crawl/day.h @@ -20,8 +20,32 @@ template /** * @brief The Day class is template wrapper for the moon and sun objects. * The moon and sun objects moving around world center for imitation of the day. + * + * ### Integration on the world. + * You need to add one object of this class in the IWorld::initWorldRules method. + * **Example:** + * + * ```cpp + * CRAWL::WorldRule *World::initWorldRules() { + + using Day = CRAWL::Day; + + return new CRAWL::WorldRule { + {0, { + {registerObject(), 1}, + } + }, + {1000, { + {registerObject(), 1}, + } + }, + }; +} + * ``` * @note All objects will be moving around this objects with radius. The Radius by default is 2000. * @note This class automaticly sets ligth force for the light objects. + * + * */ class Day: public IWorldItem, public Claster { diff --git a/src/Core/Crawl/defaultlight.h b/src/Core/Crawl/defaultlight.h index 4764537..50c14e2 100644 --- a/src/Core/Crawl/defaultlight.h +++ b/src/Core/Crawl/defaultlight.h @@ -14,7 +14,9 @@ namespace CRAWL { /** - * @brief The DefaultLight class This is default implementation of the wirld light. + * @brief The DefaultLight class This is default implementation of the world light. + * This object create uniform illumination for all world. + * For integration This object yo worl see the IWorld::initWorldRules method */ class DefaultLight final: public IWorldLight { diff --git a/src/Core/Crawl/iworldlight.h b/src/Core/Crawl/iworldlight.h index 74d33c5..50dac42 100644 --- a/src/Core/Crawl/iworldlight.h +++ b/src/Core/Crawl/iworldlight.h @@ -18,6 +18,28 @@ namespace CRAWL { * You need to create own qml file with light. * * @note If you wnat to create a new qml file the you need to inherit from the Light.qml file. + * + * ### Integration on the world. + * You need to add one object of this class in the IWorld::initWorldRules method. + * **Example:** + * + * ```cpp + * CRAWL::WorldRule *World::initWorldRules() { + + return new CRAWL::WorldRule { + {0, { + {registerObject(), 1}, + } + }, + {1000, { + {registerObject(), 1}, + } + }, + }; +} + * ``` + * + * For integration This object you world see the IWorld::initWorldRules method */ class CRAWL_EXPORT IWorldLight: public ClasterItem { @@ -30,6 +52,7 @@ class CRAWL_EXPORT IWorldLight: public ClasterItem Q_PROPERTY(float shadowBias READ shadowBias WRITE setShadowBias NOTIFY shadowBiasChanged) public: + IWorldLight(const QString& name, const QString& viewTempalte = "qrc:/CrawlModule/Light.qml", QObject *ptr = nullptr);