Merge pull request #92 from QuasarApp/addedDocs

Added documentation about light class
This commit is contained in:
Andrei Yankovich 2021-07-24 13:34:21 +03:00 committed by GitHub
commit 0e66b52865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 61 additions and 4 deletions

View File

@ -12,11 +12,19 @@ if(TARGET ${PROJECT_NAME})
return()
endif()
set(QT_VERSION_MAJOR 5)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Test REQUIRED)
find_package(QT NAMES Qt5 Qt6 COMPONENTS Core REQUIRED)
include(submodules/QuasarAppLib/CMake/QuasarApp.cmake)
if (NOT ${QT_VERSION_MAJOR} EQUAL 5)
message("The ${PROJECT_NAME} support only qt5. please rebuild this project with qt6")
initAll()
addDoc(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)
return()
endif()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Test REQUIRED)
if (DEFINED TARGET_PLATFORM_TOOLCHAIN)
if (${TARGET_PLATFORM_TOOLCHAIN} STREQUAL "wasm32")
initAll()

View File

@ -20,8 +20,32 @@ template <class Sun, class Moon>
/**
* @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<CRAWL::Sun, CRAWL::Moon>;
return new CRAWL::WorldRule {
{0, {
{registerObject<Day>(), 1},
}
},
{1000, {
{registerObject<Day>(), 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
{

View File

@ -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
{

View File

@ -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<MyLightObject>(), 1},
}
},
{1000, {
{registerObject<MyLightObject>(), 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);