mirror of
https://github.com/QuasarApp/Snake.git
synced 2025-04-30 11:44:42 +00:00
Merge pull request #92 from QuasarApp/addedDocs
Added documentation about light class
This commit is contained in:
commit
0e66b52865
@ -12,11 +12,19 @@ if(TARGET ${PROJECT_NAME})
|
|||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(QT_VERSION_MAJOR 5)
|
find_package(QT NAMES Qt5 Qt6 COMPONENTS Core REQUIRED)
|
||||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Test REQUIRED)
|
|
||||||
|
|
||||||
include(submodules/QuasarAppLib/CMake/QuasarApp.cmake)
|
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 (DEFINED TARGET_PLATFORM_TOOLCHAIN)
|
||||||
if (${TARGET_PLATFORM_TOOLCHAIN} STREQUAL "wasm32")
|
if (${TARGET_PLATFORM_TOOLCHAIN} STREQUAL "wasm32")
|
||||||
initAll()
|
initAll()
|
||||||
|
@ -20,8 +20,32 @@ template <class Sun, class Moon>
|
|||||||
/**
|
/**
|
||||||
* @brief The Day class is template wrapper for the moon and sun objects.
|
* @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.
|
* 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 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.
|
* @note This class automaticly sets ligth force for the light objects.
|
||||||
|
*
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
class Day: public IWorldItem, public Claster
|
class Day: public IWorldItem, public Claster
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,9 @@
|
|||||||
namespace CRAWL {
|
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
|
class DefaultLight final: public IWorldLight
|
||||||
{
|
{
|
||||||
|
@ -18,6 +18,28 @@ namespace CRAWL {
|
|||||||
* You need to create own qml file with light.
|
* 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.
|
* @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
|
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)
|
Q_PROPERTY(float shadowBias READ shadowBias WRITE setShadowBias NOTIFY shadowBiasChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
IWorldLight(const QString& name,
|
IWorldLight(const QString& name,
|
||||||
const QString& viewTempalte = "qrc:/CrawlModule/Light.qml",
|
const QString& viewTempalte = "qrc:/CrawlModule/Light.qml",
|
||||||
QObject *ptr = nullptr);
|
QObject *ptr = nullptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user