├── .gitignore ├── .gitmodules ├── README.md ├── Spkgen.pro ├── assets └── Spark │ ├── Effects │ ├── Bubbles.xml │ ├── Fire1.xml │ ├── FireAtlas.xml │ ├── MagicBall.xml │ ├── Spark1.xml │ └── Vortex.xml │ ├── Materials │ ├── SparkParticleAdd.xml │ ├── SparkParticleAddAlpha.xml │ └── SparkParticleAlpha.xml │ ├── Techniques │ ├── DiffUnlitParticleAdd.xml │ ├── DiffUnlitParticleAddAlpha.xml │ └── DiffUnlitParticleAlpha.xml │ └── Textures │ ├── Animated │ ├── FlameArc8.png │ ├── smokeball.png │ ├── sprite-flame.jpg │ └── torusflame1.png │ └── Static │ ├── Bubbles │ ├── bubble_10_256.png │ ├── bubble_11_256.png │ ├── bubble_12_256.png │ ├── bubble_1_256.png │ ├── bubble_2_256.png │ ├── bubble_3_256.png │ ├── bubble_4_256.png │ ├── bubble_5_256.png │ ├── bubble_6_256.png │ ├── bubble_7_256.png │ ├── bubble_8_256.png │ └── bubble_9_256.png │ ├── Electric │ ├── Electric1.png │ ├── Electric2.png │ ├── Electric3.png │ ├── Electric4.png │ ├── Electric5.png │ ├── Electric6.png │ └── ElectricGroup1.png │ ├── Flames │ ├── FireBall1.png │ ├── FireBall2.png │ ├── FireBall3.png │ ├── FireBall4.png │ ├── FireBall5.png │ ├── FlameElement.png │ ├── FlameElements3.png │ ├── FlameStill-Group.png │ ├── FlameStill1.png │ ├── FlameStill2.png │ ├── FlameStill3.png │ ├── FlameStill4.png │ ├── FlameStill5.png │ ├── FlameStill6.png │ ├── FlameStill7.png │ ├── FlameStill8.png │ ├── Flames1.png │ └── flame1.png │ ├── Glows │ ├── Flare1.png │ ├── Flare10.png │ ├── Flare11.png │ ├── Flare2.png │ ├── Flare3.png │ ├── Flare4.png │ ├── Flare5.png │ ├── Flare6.png │ ├── Flare7.png │ ├── Flare8.png │ ├── Flare9.png │ ├── PlasmaBall1.png │ ├── PlasmaBall5.png │ ├── PlasmaBall6.png │ ├── PlasmaBall7.png │ ├── PlasmaBall8.png │ ├── PlasmaBall9.png │ ├── PlasmaElectric4.png │ ├── PlasmaFlare3.png │ ├── PlasmaFlare4.png │ ├── PlasmaFlare7.png │ ├── PlasmaPuff.png │ ├── PlasmaSmoke1.png │ ├── glow.png │ ├── haloflare.png │ ├── sparkleflare.png │ ├── sparkleflare2.png │ └── sparkleflare3.png │ ├── Halos │ ├── BlastWave10.png │ ├── BlastWave3.png │ ├── BlastWave4.png │ ├── BlastWave5.png │ ├── BlastWave6.png │ ├── BlastWave7.png │ ├── BlastWave8.png │ ├── BlastWave9.png │ ├── BlastWaveGround.png │ ├── Halo1.png │ ├── Halo2.png │ ├── Halo3.png │ ├── HaloFlare1.png │ ├── SmokeyHalo1.png │ ├── SmokeyHalo2.png │ ├── blastwave1.png │ └── blastwave2.png │ ├── Liquids │ ├── BloodDroplet.png │ ├── Cracks.png │ ├── Cracks2.png │ ├── Cracks3.png │ ├── Droplets.png │ ├── Droplets2.png │ ├── Droplets3.png │ ├── Splash3.png │ ├── Splash4.png │ ├── Splash5.png │ ├── bubble.png │ ├── bubbles.png │ ├── lava1.png │ ├── lavaislands.png │ ├── lavaliquid.png │ ├── raindrop.png │ ├── splash.png │ ├── splash2.png │ └── splashes.png │ ├── Nature │ ├── Snow1.png │ ├── branch.png │ ├── grass1.png │ ├── leaf (2).png │ ├── leaf.png │ ├── leaf2.png │ └── leaves.png │ ├── Rays │ ├── Ray.png │ ├── beam1.png │ └── laser1.png │ ├── Smoke │ ├── Cloud1.png │ ├── Cloud2.png │ ├── Cloud3.png │ ├── Cloud4.png │ ├── Cloud6.png │ ├── CloudPart.png │ ├── DarkerWispySmoke1.png │ ├── FireCoudElements.png │ ├── Fog-Group.png │ ├── Fog-Group2.png │ ├── Fog1.png │ ├── PlasmaSmoke4.png │ ├── Plume.png │ ├── Plume2.png │ ├── Plume3.png │ ├── Plume4.png │ ├── Plume5.png │ ├── Plume6.png │ ├── Smoke.png │ ├── SmokeCollumn.png │ ├── debrie.png │ ├── fine-smoke-1.png │ ├── fine-smoke-10.png │ ├── fine-smoke-11.png │ ├── fine-smoke-12.png │ ├── fine-smoke-2.png │ ├── fine-smoke-3.png │ ├── fine-smoke-4.png │ ├── fine-smoke-5.png │ ├── fine-smoke-6.png │ ├── fine-smoke-7.png │ ├── fine-smoke-8.png │ ├── fine-smoke-9.png │ ├── fine-smoke-sheet-1.png │ ├── irregularcloud1.png │ ├── smoke-plume-1.png │ ├── smoke-plume-2.png │ ├── toonCloud.png │ ├── toonCloudFeathered.png │ └── tooncollumn.png │ └── Symbols │ ├── 6starfilled.png │ ├── 6starhollow.png │ ├── 6starsemifilled.png │ ├── 8starfilled.png │ ├── 8starhollow.png │ ├── Circle.png │ ├── Gradient.png │ ├── arrow.png │ ├── circlesymbol1.png │ ├── graphlines.png │ ├── lines.png │ ├── numbersverdana.png │ ├── pixel (2).png │ ├── pixel.png │ ├── spaceyfont.png │ ├── symbols.png │ ├── thinlines.png │ └── triangle.png ├── projects └── Tutorial.flow └── src ├── GraphEditor.cpp ├── GraphEditor.h ├── GraphView.cpp ├── GraphView.h ├── MainWindow.cpp ├── MainWindow.h ├── PageList.cpp ├── PageList.h ├── RenderWidget.cpp ├── RenderWidget.h ├── UrhoDevice.cpp ├── UrhoDevice.h ├── main.cpp ├── node-editor ├── common │ ├── BaseNode.cpp │ ├── BaseNode.h │ ├── Color.cpp │ ├── Color.h │ ├── CommentGraphicsItem.cpp │ ├── CommentGraphicsItem.h │ ├── Curve.cpp │ ├── Curve.h │ ├── CustomFlowScene.cpp │ ├── CustomFlowScene.h │ ├── CustomWidgets.cpp │ ├── CustomWidgets.h │ ├── Nodestyle.h │ ├── ParamWidget.cpp │ ├── ParamWidget.h │ ├── Parameter.cpp │ ├── Parameter.h │ ├── Path.cpp │ ├── Path.h │ ├── TrackEdit.cpp │ ├── Trackedit.h │ ├── Types.cpp │ ├── Types.h │ └── Variant.h └── spark-nodes │ ├── SparkNodeRender.cpp │ ├── SparkNodeRender.h │ ├── SparkNodesRegistry.cpp │ ├── SparkNodesRegistry.h │ ├── SpkEmitters.cpp │ ├── SpkEmitters.h │ ├── SpkInterpolators.cpp │ ├── SpkInterpolators.h │ ├── SpkModifiers.cpp │ ├── SpkModifiers.h │ ├── SpkSystem.cpp │ ├── SpkSystem.h │ ├── SpkUtils.cpp │ ├── SpkUtils.h │ ├── SpkZones.cpp │ ├── SpkZones.h │ └── spark-nodes.h └── urho ├── BaseRenderer.cpp ├── BaseRenderer.h ├── CameraController.cpp ├── CameraController.h ├── GridGeometry.cpp └── GridGeometry.h /.gitignore: -------------------------------------------------------------------------------- 1 | *.pro.user 2 | bin/ -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "3rdparty/nodeeditor"] 2 | path = 3rdparty/nodeeditor 3 | url = https://github.com/fredakilla/nodeeditor.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Spkgen 2 | Spkgen is an editor for the [**SPARK**](https://github.com/fredakilla/SPARK) particles engine using a node-based interface to create particles effects for games. 3 | 4 | ## Screenshots 5 | 6 | 7 | ## Current status 8 | Spkgen is in developpement and is not yet fully functional. 9 | Development is done on linux. 10 | Building on another system is not tested but final release should be cross-platform. 11 | 12 | 13 | ## Features 14 | - C++ and Qt based interface. 15 | - Spkgen internally use [**Urho3D**](https://github.com/urho3d/Urho3D) for rendering particles. 16 | - and [**Urhox**](https://github.com/fredakilla/Urhox) library to bind the SPARK particle engine to Urho3D. 17 | - node core system is provided by the external qt [**nodeeditor**](https://github.com/paceholder/nodeeditor) library. 18 | 19 | TODO 20 | - [x] implement generic nodes classes 21 | - [x] automatic node's parameters widgets creation from simple declaration 22 | - [x] show 3D debug zones geometries 23 | - [x] serialize node widget's parameters 24 | - [x] graph plot editor widget for spark graph interpolators 25 | - [x] complete all spark nodes 26 | - [x] interact with 3D view (camera move...) 27 | - [x] multiple scenes managment 28 | - [x] comments items on node view 29 | - [ ] set styles 30 | - [x] add shortcuts on node view : copy/paste/cut nodes 31 | - [ ] add samples and tutorials (WIP) 32 | 33 | ## Build 34 | 35 | Spkgen developpement is done with Qt 5.11.1 + QtCharts module for tgraph plot editor widget. 36 | WARNING : Do not use Qt 5.11.2, I experienced some bugs with FileDialogs on linux... 37 | 38 | 39 | ##### 1. Get submodules 40 | ``` 41 | git submodule init 42 | git submodule update 43 | ``` 44 | 45 | ##### 2. Build the external nodeeditor Qt library 46 | ``` 47 | cd 3rdparty/nodeeditor 48 | mkdir BUILD 49 | cd BUILD 50 | make 51 | ``` 52 | 53 | ##### 3. Set URHO3D_HOME and URHOX_HOME variable path in QtCreator : 54 | (Urho3D and Urhox libraries need to be builded) 55 | ```bash 56 | - Open spkgen.pro with QtCreator. 57 | - Edit spkgen.pro file 58 | - Set variable path : 59 | 60 | #-------------------------------------------------------------------- 61 | # path to Urho3D and Urhox 62 | #-------------------------------------------------------------------- 63 | URHO3D_HOME = /home/John/Dev/Urho3D/BUILD 64 | URHOX_HOME = /home/John/Dev/Urhox/output 65 | ``` 66 | 67 | ##### 4. Build 68 | ``` 69 | - Copy Urho3D assets 'Data' and 'CoreData' to Spkgen/Bin 70 | - Open Spkgen.pro with QtCreator 71 | - Build and Run 72 | ``` -------------------------------------------------------------------------------- /Spkgen.pro: -------------------------------------------------------------------------------- 1 | #-------------------------------------------------------------------- 2 | # path to Urho3D and Urhox 3 | #-------------------------------------------------------------------- 4 | URHO3D_HOME = /home/fred/Dev/Urho3D/BUILD 5 | URHOX_HOME = /home/fred/Dev/Urhox/output 6 | 7 | #-------------------------------------------------------------------- 8 | # project 9 | #-------------------------------------------------------------------- 10 | QT += core gui widgets charts 11 | TARGET = Spkgen 12 | TEMPLATE = app 13 | CONFIG += c++14 14 | CONFIG -= console 15 | CONFIG += windows 16 | CONFIG += no_keywords 17 | 18 | DESTDIR = $$PWD/bin 19 | QMAKE_CLEAN += $$DESTDIR/$$TARGET 20 | 21 | CONFIG(debug, debug|release): 22 | DEFINES += _DEBUG QT_NO_KEYWORDS 23 | 24 | INCLUDEPATH += $$URHO3D_HOME/include 25 | INCLUDEPATH += $$URHO3D_HOME/include/Urho3D/ThirdParty 26 | INCLUDEPATH += $$URHOX_HOME/include/Urhox 27 | INCLUDEPATH += $$URHOX_HOME/include/Urhox/ThirdParty 28 | 29 | # nodes editor library 30 | # build nodeeditor with : 31 | # cmake .. -DCMAKE_PREFIX_PATH=/opt/Qt5.11.1/5.11.1/gcc_64 -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF 32 | DEFINES += NODE_EDITOR_STATIC 33 | INCLUDEPATH += 3rdparty/nodeeditor/include 34 | LIBS += -L$$PWD/3rdparty/nodeeditor/BUILD/lib -lnodes 35 | 36 | #-------------------------------------------------------------------- 37 | # platform specific 38 | #-------------------------------------------------------------------- 39 | linux: { 40 | QT += x11extras 41 | DEFINES += __linux__ 42 | QMAKE_CXXFLAGS += -Wno-unused-parameter 43 | PRE_TARGETDEPS += $$URHOX_HOME/lib/libUrhox.a 44 | LIBS += -L$$URHOX_HOME/lib -lUrhox 45 | LIBS += -L$$URHO3D_HOME/lib -lUrho3D 46 | LIBS += -lXi -ldl -lpthread -lGL -lGLU -lX11 47 | } 48 | 49 | # force qmake 50 | #qmakeforce.target = dummy 51 | #qmakeforce.commands = rm -f Makefile ##to force rerun of qmake 52 | #qmakeforce.depends = FORCE 53 | #PRE_TARGETDEPS += $$qmakeforce.target 54 | #QMAKE_EXTRA_TARGETS += qmakeforce 55 | 56 | 57 | #-------------------------------------------------------------------- 58 | # files 59 | #-------------------------------------------------------------------- 60 | SOURCES += \ 61 | src/node-editor/common/BaseNode.cpp \ 62 | src/node-editor/common/Color.cpp \ 63 | src/node-editor/common/CommentGraphicsItem.cpp \ 64 | src/node-editor/common/CustomFlowScene.cpp \ 65 | src/node-editor/common/CustomWidgets.cpp \ 66 | src/node-editor/common/Parameter.cpp \ 67 | src/node-editor/common/ParamWidget.cpp \ 68 | src/node-editor/common/Path.cpp \ 69 | src/node-editor/common/TrackEdit.cpp \ 70 | src/node-editor/common/Types.cpp \ 71 | src/node-editor/spark-nodes/SpkEmitters.cpp \ 72 | src/node-editor/spark-nodes/SpkInterpolators.cpp \ 73 | src/node-editor/spark-nodes/SpkModifiers.cpp \ 74 | src/node-editor/spark-nodes/SpkSystem.cpp \ 75 | src/node-editor/spark-nodes/SpkZones.cpp \ 76 | src/node-editor/spark-nodes/SparkNodesRegistry.cpp \ 77 | src/GraphView.cpp \ 78 | src/main.cpp \ 79 | src/MainWindow.cpp \ 80 | src/node-editor/spark-nodes/SpkUtils.cpp \ 81 | src/node-editor/spark-nodes/SparkNodeRender.cpp \ 82 | src/UrhoDevice.cpp \ 83 | src/urho/GridGeometry.cpp \ 84 | src/urho/CameraController.cpp \ 85 | src/RenderWidget.cpp \ 86 | src/urho/BaseRenderer.cpp \ 87 | src/node-editor/common/Curve.cpp \ 88 | src/GraphEditor.cpp \ 89 | src/PageList.cpp 90 | 91 | HEADERS += \ 92 | src/node-editor/common/BaseNode.h \ 93 | src/node-editor/common/Color.h \ 94 | src/node-editor/common/CommentGraphicsItem.h \ 95 | src/node-editor/common/CustomFlowScene.h \ 96 | src/node-editor/common/CustomWidgets.h \ 97 | src/node-editor/common/Nodestyle.h \ 98 | src/node-editor/common/Parameter.h \ 99 | src/node-editor/common/ParamWidget.h \ 100 | src/node-editor/common/Path.h \ 101 | src/node-editor/common/Trackedit.h \ 102 | src/node-editor/common/Types.h \ 103 | src/node-editor/spark-nodes/SpkEmitters.h \ 104 | src/node-editor/spark-nodes/SpkInterpolators.h \ 105 | src/node-editor/spark-nodes/SpkModifiers.h \ 106 | src/node-editor/spark-nodes/SpkSystem.h \ 107 | src/node-editor/spark-nodes/SpkZones.h \ 108 | src/node-editor/spark-nodes/SparkNodesRegistry.h \ 109 | src/benchmark.h \ 110 | src/GraphView.h \ 111 | src/MainWindow.h \ 112 | src/node-editor/spark-nodes/spark-nodes.h \ 113 | src/node-editor/spark-nodes/SpkUtils.h \ 114 | src/node-editor/spark-nodes/SparkNodeRender.h \ 115 | src/UrhoDevice.h \ 116 | src/urho/GridGeometry.h \ 117 | src/urho/CameraController.h \ 118 | src/RenderWidget.h \ 119 | src/urho/BaseRenderer.h \ 120 | src/node-editor/common/Curve.h \ 121 | src/GraphEditor.h \ 122 | src/PageList.h 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /assets/Spark/Effects/Bubbles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /assets/Spark/Effects/Fire1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /assets/Spark/Effects/FireAtlas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /assets/Spark/Effects/MagicBall.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /assets/Spark/Effects/Spark1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /assets/Spark/Effects/Vortex.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /assets/Spark/Materials/SparkParticleAdd.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/Spark/Materials/SparkParticleAddAlpha.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/Spark/Materials/SparkParticleAlpha.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/Spark/Techniques/DiffUnlitParticleAdd.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/Spark/Techniques/DiffUnlitParticleAddAlpha.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/Spark/Techniques/DiffUnlitParticleAlpha.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/Spark/Textures/Animated/FlameArc8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Animated/FlameArc8.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Animated/smokeball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Animated/smokeball.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Animated/sprite-flame.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Animated/sprite-flame.jpg -------------------------------------------------------------------------------- /assets/Spark/Textures/Animated/torusflame1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Animated/torusflame1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Bubbles/bubble_10_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Bubbles/bubble_10_256.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Bubbles/bubble_11_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Bubbles/bubble_11_256.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Bubbles/bubble_12_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Bubbles/bubble_12_256.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Bubbles/bubble_1_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Bubbles/bubble_1_256.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Bubbles/bubble_2_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Bubbles/bubble_2_256.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Bubbles/bubble_3_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Bubbles/bubble_3_256.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Bubbles/bubble_4_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Bubbles/bubble_4_256.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Bubbles/bubble_5_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Bubbles/bubble_5_256.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Bubbles/bubble_6_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Bubbles/bubble_6_256.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Bubbles/bubble_7_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Bubbles/bubble_7_256.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Bubbles/bubble_8_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Bubbles/bubble_8_256.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Bubbles/bubble_9_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Bubbles/bubble_9_256.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Electric/Electric1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Electric/Electric1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Electric/Electric2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Electric/Electric2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Electric/Electric3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Electric/Electric3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Electric/Electric4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Electric/Electric4.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Electric/Electric5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Electric/Electric5.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Electric/Electric6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Electric/Electric6.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Electric/ElectricGroup1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Electric/ElectricGroup1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FireBall1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FireBall1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FireBall2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FireBall2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FireBall3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FireBall3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FireBall4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FireBall4.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FireBall5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FireBall5.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FlameElement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FlameElement.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FlameElements3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FlameElements3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FlameStill-Group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FlameStill-Group.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FlameStill1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FlameStill1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FlameStill2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FlameStill2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FlameStill3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FlameStill3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FlameStill4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FlameStill4.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FlameStill5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FlameStill5.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FlameStill6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FlameStill6.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FlameStill7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FlameStill7.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/FlameStill8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/FlameStill8.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/Flames1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/Flames1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Flames/flame1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Flames/flame1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/Flare1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/Flare1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/Flare10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/Flare10.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/Flare11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/Flare11.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/Flare2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/Flare2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/Flare3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/Flare3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/Flare4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/Flare4.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/Flare5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/Flare5.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/Flare6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/Flare6.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/Flare7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/Flare7.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/Flare8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/Flare8.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/Flare9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/Flare9.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/PlasmaBall1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/PlasmaBall1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/PlasmaBall5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/PlasmaBall5.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/PlasmaBall6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/PlasmaBall6.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/PlasmaBall7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/PlasmaBall7.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/PlasmaBall8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/PlasmaBall8.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/PlasmaBall9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/PlasmaBall9.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/PlasmaElectric4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/PlasmaElectric4.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/PlasmaFlare3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/PlasmaFlare3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/PlasmaFlare4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/PlasmaFlare4.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/PlasmaFlare7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/PlasmaFlare7.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/PlasmaPuff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/PlasmaPuff.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/PlasmaSmoke1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/PlasmaSmoke1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/glow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/glow.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/haloflare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/haloflare.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/sparkleflare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/sparkleflare.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/sparkleflare2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/sparkleflare2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Glows/sparkleflare3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Glows/sparkleflare3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/BlastWave10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/BlastWave10.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/BlastWave3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/BlastWave3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/BlastWave4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/BlastWave4.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/BlastWave5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/BlastWave5.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/BlastWave6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/BlastWave6.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/BlastWave7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/BlastWave7.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/BlastWave8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/BlastWave8.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/BlastWave9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/BlastWave9.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/BlastWaveGround.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/BlastWaveGround.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/Halo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/Halo1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/Halo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/Halo2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/Halo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/Halo3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/HaloFlare1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/HaloFlare1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/SmokeyHalo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/SmokeyHalo1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/SmokeyHalo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/SmokeyHalo2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/blastwave1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/blastwave1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Halos/blastwave2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Halos/blastwave2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/BloodDroplet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/BloodDroplet.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/Cracks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/Cracks.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/Cracks2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/Cracks2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/Cracks3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/Cracks3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/Droplets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/Droplets.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/Droplets2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/Droplets2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/Droplets3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/Droplets3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/Splash3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/Splash3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/Splash4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/Splash4.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/Splash5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/Splash5.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/bubble.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/bubbles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/bubbles.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/lava1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/lava1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/lavaislands.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/lavaislands.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/lavaliquid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/lavaliquid.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/raindrop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/raindrop.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/splash.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/splash2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/splash2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Liquids/splashes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Liquids/splashes.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Nature/Snow1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Nature/Snow1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Nature/branch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Nature/branch.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Nature/grass1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Nature/grass1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Nature/leaf (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Nature/leaf (2).png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Nature/leaf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Nature/leaf.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Nature/leaf2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Nature/leaf2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Nature/leaves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Nature/leaves.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Rays/Ray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Rays/Ray.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Rays/beam1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Rays/beam1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Rays/laser1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Rays/laser1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Cloud1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Cloud1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Cloud2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Cloud2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Cloud3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Cloud3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Cloud4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Cloud4.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Cloud6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Cloud6.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/CloudPart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/CloudPart.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/DarkerWispySmoke1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/DarkerWispySmoke1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/FireCoudElements.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/FireCoudElements.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Fog-Group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Fog-Group.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Fog-Group2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Fog-Group2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Fog1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Fog1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/PlasmaSmoke4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/PlasmaSmoke4.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Plume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Plume.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Plume2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Plume2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Plume3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Plume3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Plume4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Plume4.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Plume5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Plume5.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Plume6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Plume6.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/Smoke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/Smoke.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/SmokeCollumn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/SmokeCollumn.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/debrie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/debrie.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/fine-smoke-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/fine-smoke-1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/fine-smoke-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/fine-smoke-10.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/fine-smoke-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/fine-smoke-11.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/fine-smoke-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/fine-smoke-12.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/fine-smoke-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/fine-smoke-2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/fine-smoke-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/fine-smoke-3.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/fine-smoke-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/fine-smoke-4.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/fine-smoke-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/fine-smoke-5.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/fine-smoke-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/fine-smoke-6.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/fine-smoke-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/fine-smoke-7.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/fine-smoke-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/fine-smoke-8.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/fine-smoke-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/fine-smoke-9.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/fine-smoke-sheet-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/fine-smoke-sheet-1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/irregularcloud1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/irregularcloud1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/smoke-plume-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/smoke-plume-1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/smoke-plume-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/smoke-plume-2.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/toonCloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/toonCloud.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/toonCloudFeathered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/toonCloudFeathered.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Smoke/tooncollumn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Smoke/tooncollumn.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/6starfilled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/6starfilled.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/6starhollow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/6starhollow.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/6starsemifilled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/6starsemifilled.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/8starfilled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/8starfilled.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/8starhollow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/8starhollow.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/Circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/Circle.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/Gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/Gradient.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/arrow.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/circlesymbol1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/circlesymbol1.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/graphlines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/graphlines.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/lines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/lines.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/numbersverdana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/numbersverdana.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/pixel (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/pixel (2).png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/pixel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/pixel.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/spaceyfont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/spaceyfont.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/symbols.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/symbols.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/thinlines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/thinlines.png -------------------------------------------------------------------------------- /assets/Spark/Textures/Static/Symbols/triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredakilla/spkgen/90ceb87c9dd7885cbce3e6c9ba0aa06154d96a53/assets/Spark/Textures/Static/Symbols/triangle.png -------------------------------------------------------------------------------- /src/GraphEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphEditor.h" 2 | #include "GraphView.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | GraphEditor::GraphEditor(GraphView* graphView, QWidget* parent) : 11 | QWidget(parent) 12 | , _graphView(graphView) 13 | { 14 | _radioX = new QRadioButton(tr("X")); 15 | _radioY = new QRadioButton(tr("Y")); 16 | _radioZ = new QRadioButton(tr("Z")); 17 | _radioW = new QRadioButton(tr("W")); 18 | 19 | _radioX->setVisible(true); 20 | _radioY->setVisible(false); 21 | _radioZ->setVisible(false); 22 | _radioW->setVisible(false); 23 | _radioX->setChecked(true); 24 | 25 | QHBoxLayout *hbox = new QHBoxLayout; 26 | hbox->addWidget(new QLabel("Selected path : ")); 27 | hbox->addWidget(_radioX); 28 | hbox->addWidget(_radioY); 29 | hbox->addWidget(_radioZ); 30 | hbox->addWidget(_radioW); 31 | hbox->addStretch(1); 32 | 33 | QGroupBox* groupBox = new QGroupBox(); 34 | groupBox->setLayout(hbox); 35 | 36 | QVBoxLayout* vbox = new QVBoxLayout; 37 | vbox->addWidget(graphView); 38 | vbox->addWidget(groupBox); 39 | setLayout(vbox); 40 | 41 | connect(_radioX, &QRadioButton::clicked, graphView, &GraphView::onPathSelectedX); 42 | connect(_radioY, &QRadioButton::clicked, graphView, &GraphView::onPathSelectedY); 43 | connect(_radioZ, &QRadioButton::clicked, graphView, &GraphView::onPathSelectedZ); 44 | connect(_radioW, &QRadioButton::clicked, graphView, &GraphView::onPathSelectedW); 45 | } 46 | 47 | void GraphEditor::onSetPath() 48 | { 49 | _radioX->setVisible(true); 50 | _radioY->setVisible(false); 51 | _radioZ->setVisible(false); 52 | _radioW->setVisible(false); 53 | _radioX->setChecked(true); 54 | } 55 | 56 | void GraphEditor::onSetPath4() 57 | { 58 | _radioX->setVisible(true); 59 | _radioY->setVisible(true); 60 | _radioZ->setVisible(true); 61 | _radioW->setVisible(true); 62 | } 63 | -------------------------------------------------------------------------------- /src/GraphEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef GRAPHEDITOR_H 2 | #define GRAPHEDITOR_H 3 | 4 | #include 5 | #include 6 | 7 | class GraphView; 8 | 9 | class GraphEditor : public QWidget 10 | { 11 | Q_OBJECT 12 | public: 13 | GraphEditor(GraphView* graphView, QWidget* parent = nullptr); 14 | 15 | public Q_SLOTS: 16 | void onSetPath(); 17 | void onSetPath4(); 18 | 19 | private: 20 | QRadioButton* _radioX; 21 | QRadioButton* _radioY; 22 | QRadioButton* _radioZ; 23 | QRadioButton* _radioW; 24 | GraphView* _graphView; 25 | }; 26 | 27 | #endif // GRAPHEDITOR_H 28 | -------------------------------------------------------------------------------- /src/GraphView.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt Charts module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 or (at your option) any later version 20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by 21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 22 | ** included in the packaging of this file. Please review the following 23 | ** information to ensure the GNU General Public License requirements will 24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 25 | ** 26 | ** $QT_END_LICENSE$ 27 | ** 28 | ****************************************************************************/ 29 | 30 | #ifndef PATHEDITOR_H 31 | #define PATHEDITOR_H 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #include "node-editor/spark-nodes/SpkInterpolators.h" 40 | 41 | 42 | QT_CHARTS_USE_NAMESPACE 43 | 44 | class GraphView : public QChartView 45 | { 46 | Q_OBJECT 47 | 48 | public: 49 | GraphView(QWidget *parent = 0); 50 | ~GraphView(); 51 | 52 | QSize sizeHint() const override { return QSize(256,256); } 53 | void resizeEvent(QResizeEvent *event) override; 54 | void keyPressEvent(QKeyEvent *event) override; 55 | void keyReleaseEvent(QKeyEvent *event) override; 56 | void mousePressEvent(QMouseEvent *event) override; 57 | void mouseMoveEvent(QMouseEvent *event) override; 58 | void mouseReleaseEvent(QMouseEvent *event) override; 59 | void wheelEvent(QWheelEvent *event) override; 60 | 61 | public Q_SLOTS: 62 | void onSetPathNode(NodePath* node); 63 | void onSetPath4Node(NodePath4* node); 64 | void onPathSelectedX(); 65 | void onPathSelectedY(); 66 | void onPathSelectedZ(); 67 | void onPathSelectedW(); 68 | 69 | private Q_SLOTS: 70 | void handleClickedPoint(const QPointF &point); 71 | 72 | private: 73 | void zoom(); 74 | void addNewPoint(QPointF newPoint); 75 | void deleteSelectedKeys(); 76 | void rebuildKeys(); 77 | bool isKeyMovable(double newTime, int index); 78 | void plot(); 79 | void plot1(); 80 | void plot4(); 81 | void setStyle(); 82 | void setAxisStyle(); 83 | 84 | enum PathType 85 | { 86 | PATH_1, 87 | PATH_4, 88 | }; 89 | 90 | static const unsigned MAX_LINES = 4; // max path to draw in graph 91 | PathType _currentPathType; // current path type 92 | unsigned int _currentSelectedLine; // current selected line index 93 | NodePath* _pathNode; // current pathNode 94 | NodePath4* _pathNode4; // current pathNode4 95 | Path* _currentPath; // current path (or subpath for pathNode4) 96 | 97 | QLineSeries* _lines[MAX_LINES]; // used to draw path curve 98 | QScatterSeries* _scatter[MAX_LINES]; // used to draw path keys 99 | QScatterSeries* _scatterSelected; // used to draw selected keys 100 | 101 | QRectF _zoom; 102 | qreal _zoomFactorX; 103 | qreal _zoomFactorY; 104 | bool _isPointSelected; 105 | bool _isClicked; 106 | QPointF _selectedPoint; 107 | double _splineResolution; 108 | }; 109 | 110 | #endif // PATHEDITOR_H 111 | -------------------------------------------------------------------------------- /src/MainWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | 7 | #include "node-editor/common/CustomFlowScene.h" 8 | #include "GraphView.h" 9 | #include "GraphEditor.h" 10 | #include "RenderWidget.h" 11 | #include "PageList.h" 12 | 13 | class MainWindow : public QMainWindow 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit MainWindow(QWidget *parent = nullptr); 19 | ~MainWindow(); 20 | 21 | private Q_SLOTS: 22 | void onNewProject(); 23 | void onOpen(); 24 | void onSaveAs(); 25 | void onSave(); 26 | void onRenderViewResized(int width, int height); 27 | void onPageSwitch(Page* page); 28 | void onPageAdd(Page* page); 29 | void onShowSceneGrid(); 30 | void onShowScene1(); 31 | void onShowDebugShapes(bool enabled); 32 | 33 | private: 34 | void shutdown(); 35 | void createWidgets(); 36 | void createActions(); 37 | void createMenus(); 38 | void addDefaultPage(); 39 | void resetFlowViewTransform(); 40 | void setCurrentFile(const QString &filePath); 41 | void closeEvent(QCloseEvent* event) override; 42 | void timerEvent(QTimerEvent* event) override; 43 | 44 | 45 | // GUI stuff 46 | 47 | QString _currentFile; 48 | FlowView* _nodeFlowView; 49 | QWidget* _viewportContainer; 50 | RenderWidget* _renderView; 51 | GraphView* _pathView; 52 | GraphEditor* _pathEditor; 53 | PageList* _pageList; 54 | QDockWidget* _dockView; 55 | QDockWidget* _dockNodeFlowView; 56 | QDockWidget* _dockGraph; 57 | QDockWidget* _dockPageList; 58 | int _gameLoopTimerId; 59 | }; 60 | 61 | #endif // MAINWINDOW_H 62 | -------------------------------------------------------------------------------- /src/PageList.cpp: -------------------------------------------------------------------------------- 1 | #include "PageList.h" 2 | #include "node-editor/spark-nodes/SparkNodesRegistry.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | PageList::PageList(QWidget* parent) : 11 | QListWidget(parent) 12 | { 13 | _sparkNodesRegistry = registerSparkNodesDataModels(); 14 | 15 | setContextMenuPolicy(Qt::ContextMenuPolicy::ActionsContextMenu); 16 | setDragDropMode(InternalMove); 17 | 18 | _createActions(); 19 | 20 | connect(this, &PageList::itemSelectionChanged, this, &PageList::onSelectionChanged); 21 | connect(this, &PageList::itemChanged, this, &PageList::onItemChanged); 22 | } 23 | 24 | QSize PageList::sizeHint() const 25 | { 26 | return QSize(250, 0); 27 | } 28 | 29 | void PageList::mousePressEvent(QMouseEvent* event) 30 | { 31 | QModelIndex item = indexAt(event->pos()); 32 | QListWidget::mousePressEvent(event); 33 | if ((item.row() == -1 && item.column() == -1)) 34 | { 35 | clearSelection(); 36 | } 37 | } 38 | 39 | QListWidgetItem* PageList::_addPage(Page* page, QListWidgetItem *parent) 40 | { 41 | if (!parent && selectedItems().size() == 1) 42 | parent = selectedItems().first(); 43 | 44 | QListWidgetItem* item = new QListWidgetItem(); 45 | item->setText(page->flowScene->getName()); 46 | item->setData(Qt::UserRole, qVariantFromValue(page)); 47 | item->setFlags(item->flags()|Qt::ItemIsEditable); 48 | addItem(item); 49 | 50 | return item; 51 | } 52 | 53 | void PageList::_createActions() 54 | { 55 | QAction *act = new QAction("Add new", this); 56 | act->setShortcut(QKeySequence("a")); 57 | act->setShortcutContext(Qt::WidgetShortcut); 58 | connect(act, &QAction::triggered, this, &PageList::onAddPage); 59 | addAction(act); 60 | 61 | act = new QAction("Remove", this); 62 | act->setShortcut(QKeySequence::Delete); 63 | act->setShortcutContext(Qt::WidgetShortcut); 64 | connect(act, &QAction::triggered, this, &PageList::onRemovePage); 65 | addAction(act); 66 | 67 | act = new QAction(this); 68 | act->setSeparator(true); 69 | addAction(act); 70 | 71 | act = new QAction("Sort by name", this); 72 | connect(act, &QAction::triggered, this, &PageList::onSortByName); 73 | addAction(act); 74 | } 75 | 76 | void PageList::_clearAll() 77 | { 78 | // remove all items on each scene 79 | Q_FOREACH (Page* page, _nodeFlowScenes) 80 | { 81 | page->flowScene->clearComments(); 82 | page->flowScene->clearScene(); 83 | } 84 | 85 | // clear items in QListWidget 86 | clear(); 87 | 88 | // clear flowscene list 89 | _nodeFlowScenes.clear(); 90 | } 91 | 92 | void PageList::onNewProject() 93 | { 94 | _clearAll(); 95 | } 96 | 97 | void PageList::onAddPage() 98 | { 99 | Page* page = new Page(); 100 | page->flowScene = new CustomFlowScene(); 101 | page->flowScene->setRegistry(_sparkNodesRegistry); 102 | page->flowScene->setName("New page"); 103 | _nodeFlowScenes.push_back(page); 104 | 105 | QListWidgetItem* newItem = _addPage(page); 106 | 107 | clearSelection(); 108 | setItemSelected(newItem, true); 109 | 110 | Q_EMIT signalPageAdded(page); 111 | } 112 | 113 | void PageList::onRemovePage() 114 | { 115 | QList items = selectedItems(); 116 | 117 | Q_FOREACH (QListWidgetItem* item, items) 118 | { 119 | Page* page = (Page*)item->data(Qt::UserRole).value(); 120 | int index = _nodeFlowScenes.indexOf(page); 121 | Q_ASSERT(index != -1); 122 | _nodeFlowScenes.removeAt(index); 123 | delete item; 124 | } 125 | 126 | clearSelection(); 127 | } 128 | 129 | void PageList::onItemChanged(QListWidgetItem *item) 130 | { 131 | Page* page = (Page*)item->data(Qt::UserRole).value(); 132 | page->flowScene->setName(item->text()); 133 | } 134 | 135 | void PageList::onSelectionChanged() 136 | { 137 | Page* page = nullptr; 138 | if (selectedItems().size() > 0) 139 | page = (Page *)selectedItems().first()->data(Qt::UserRole).value(); 140 | 141 | Q_EMIT signalPageSwitch(page); 142 | } 143 | 144 | void PageList::onSortByName() 145 | { 146 | } 147 | 148 | void PageList::load(const QJsonObject &json) 149 | { 150 | _clearAll(); 151 | 152 | QJsonArray pageArray = json["pages"].toArray(); 153 | for (int pageIndex = 0; pageIndex < pageArray.size(); ++pageIndex) 154 | { 155 | // create new page 156 | onAddPage(); 157 | 158 | // get last created page 159 | int lastIndex = count()-1; 160 | Page* page = (Page*)item(lastIndex)->data(Qt::UserRole).value(); 161 | 162 | // load page 163 | QJsonObject pageJson = pageArray[pageIndex].toObject(); 164 | page->flowScene->load(pageJson); 165 | item(lastIndex)->setText(page->flowScene->getName()); 166 | } 167 | 168 | // select first page 169 | setCurrentRow(0); 170 | } 171 | 172 | void PageList::save(QJsonObject &json) 173 | { 174 | QJsonArray pageArray; 175 | Q_FOREACH (Page* page, _nodeFlowScenes) 176 | { 177 | QJsonObject jsonPageData; 178 | page->flowScene->save(jsonPageData); 179 | pageArray.append(jsonPageData); 180 | } 181 | json["pages"] = pageArray; 182 | } 183 | 184 | -------------------------------------------------------------------------------- /src/PageList.h: -------------------------------------------------------------------------------- 1 | #ifndef PAGELIST_H 2 | #define PAGELIST_H 3 | 4 | #include 5 | 6 | #include "node-editor/common/CustomFlowScene.h" 7 | 8 | 9 | struct Page 10 | { 11 | CustomFlowScene* flowScene; 12 | }; 13 | 14 | 15 | class PageList : public QListWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | PageList(QWidget* parent); 21 | QSize sizeHint() const override; 22 | void mousePressEvent(QMouseEvent* event) override; 23 | void load(const QJsonObject &json); 24 | void save(QJsonObject &json); 25 | 26 | Q_SIGNALS: 27 | void signalPageAdded(Page* page); 28 | void signalPageSwitch(Page* page); 29 | 30 | public Q_SLOTS: 31 | void onNewProject(); 32 | void onAddPage(); 33 | void onRemovePage(); 34 | void onItemChanged(QListWidgetItem *item); 35 | void onSelectionChanged(); 36 | void onSortByName(); 37 | 38 | private: 39 | void _createActions(); 40 | QListWidgetItem* _addPage(Page *page, QListWidgetItem *parent=nullptr); 41 | void _clearAll(); 42 | 43 | std::shared_ptr _sparkNodesRegistry; 44 | QList _nodeFlowScenes; 45 | 46 | }; 47 | 48 | #endif // PAGELIST 49 | -------------------------------------------------------------------------------- /src/RenderWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef RENDERWIDGET_H 2 | #define RENDERWIDGET_H 3 | 4 | #include 5 | #include 6 | 7 | class RenderWidget : public QWidget, public Urho3D::Object 8 | { 9 | Q_OBJECT 10 | URHO3D_OBJECT(RenderWidget, Urho3D::Object) 11 | 12 | public: 13 | 14 | RenderWidget(QWidget* parent); 15 | virtual ~RenderWidget(); 16 | 17 | QSize sizeHint() const override { return QSize(400,256); } 18 | void resizeEvent(QResizeEvent* event) override; 19 | void mousePressEvent(QMouseEvent* event) override; 20 | void mouseReleaseEvent(QMouseEvent* event) override; 21 | void mouseMoveEvent(QMouseEvent* event) override; 22 | void wheelEvent(QWheelEvent* event) override; 23 | void keyReleaseEvent(QKeyEvent* event) override; 24 | void keyPressEvent(QKeyEvent* event) override; 25 | 26 | 27 | Q_SIGNALS: 28 | void signalResized(int width, int height); 29 | 30 | private: 31 | QPoint _lastMousePos; 32 | QPoint _mouseDownPos; 33 | 34 | }; 35 | #endif // RENDERWIDGET_H 36 | -------------------------------------------------------------------------------- /src/UrhoDevice.cpp: -------------------------------------------------------------------------------- 1 | #include "UrhoDevice.h" 2 | #include "node-editor/common/BaseNode.h" 3 | #include "node-editor/spark-nodes/SparkNodeRender.h" 4 | #include "urho/BaseRenderer.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | ISubRenderer* _curentSubRenderer = nullptr; 11 | Urho3D::Context* UrhoDevice::gUrhoContext = nullptr; 12 | 13 | 14 | UrhoDevice::UrhoDevice() : 15 | Object(gUrhoContext), 16 | _engine(nullptr) 17 | { 18 | } 19 | 20 | UrhoDevice::~UrhoDevice() 21 | { 22 | } 23 | 24 | UrhoDevice* UrhoDevice::getInstance() 25 | { 26 | static UrhoDevice __urhoDeviceInstance; 27 | return &__urhoDeviceInstance; 28 | } 29 | 30 | void UrhoDevice::createContext() 31 | { 32 | eASSERT(!gUrhoContext); 33 | gUrhoContext = new Urho3D::Context(); 34 | eASSERT(gUrhoContext); 35 | } 36 | 37 | void UrhoDevice::freeContext() 38 | { 39 | if (gUrhoContext) 40 | delete gUrhoContext; 41 | gUrhoContext = nullptr; 42 | } 43 | 44 | void UrhoDevice::createRenderWindow(void* hwnd) 45 | { 46 | // set engine paramaters 47 | VariantMap engineParameters; 48 | engineParameters[EP_VSYNC] = false; 49 | engineParameters[EP_FULL_SCREEN] = false; 50 | engineParameters[EP_WINDOW_WIDTH] = 1280; 51 | engineParameters[EP_WINDOW_HEIGHT] = 720; 52 | engineParameters[EP_WINDOW_RESIZABLE] = true; 53 | engineParameters[EP_EXTERNAL_WINDOW] = hwnd; 54 | 55 | // create urho3d engine 56 | _engine = new Urho3D::Engine(gUrhoContext); 57 | _engine->Initialize(engineParameters); 58 | _engine->SetMaxFps(200); 59 | 60 | // register objects 61 | RegisterSparkLibrary(context_); 62 | context_->RegisterFactory(); 63 | 64 | // SystemUI subsytem need to be registered after engine initialization 65 | context_->RegisterSubsystem(new SystemUI(context_)); 66 | context_->GetSubsystem()->Start(); 67 | 68 | ui::GetIO().ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; 69 | ui::GetIO().BackendFlags |= ImGuiBackendFlags_HasMouseCursors; 70 | 71 | // create spark renderer 72 | SparkNodeRender* spkRenderer = new SparkNodeRender(); 73 | _curentSubRenderer = spkRenderer; 74 | 75 | /*SubscribeToEvent(E_MOUSEBUTTONDOWN, URHO3D_HANDLER(UrhoDevice, handleMouseButtonDown)); 76 | SubscribeToEvent(E_MOUSEBUTTONUP, URHO3D_HANDLER(UrhoDevice, handleMouseButtonUp)); 77 | SubscribeToEvent(E_MOUSEMOVE, URHO3D_HANDLER(UrhoDevice, handleMouseMove)); 78 | SubscribeToEvent(E_KEYDOWN, URHO3D_HANDLER(UrhoDevice, handleKeyDown));*/ 79 | } 80 | 81 | void UrhoDevice::runFrame() 82 | { 83 | _engine->RunFrame(); 84 | 85 | /*// begin frame 86 | Renderer::getInstance().beginFrame(); 87 | QtImGui::newFrame(); 88 | 89 | // call gplay frame that will invoke update and render methods. 90 | frame(); 91 | 92 | // end frame 93 | //ImGui::Render(); 94 | QtImGui::endFrame(); 95 | Renderer::getInstance().endFrame();*/ 96 | } 97 | 98 | 99 | void UrhoDevice::handleMouseButtonDown(StringHash eventType, VariantMap& eventData) 100 | { 101 | } 102 | 103 | void UrhoDevice::handleMouseButtonUp(StringHash eventType, VariantMap& eventData) 104 | { 105 | } 106 | 107 | void UrhoDevice::handleMouseMove(StringHash eventType, VariantMap& eventData) 108 | { 109 | } 110 | 111 | void UrhoDevice::handleKeyDown(StringHash eventType, VariantMap& eventData) 112 | { 113 | } 114 | 115 | void UrhoDevice::stop() 116 | { 117 | } 118 | 119 | void UrhoDevice::onResize(int width, int height) 120 | { 121 | // resize urho SDL window 122 | Graphics* graphics = GetSubsystem(); 123 | SDL_Window * win = (SDL_Window*)graphics->GetWindow(); 124 | SDL_SetWindowSize(win, width, height); 125 | 126 | // resize current renderer 127 | if (_curentSubRenderer) 128 | _curentSubRenderer->resize(width, height); 129 | } 130 | 131 | void UrhoDevice::setCurentParticleSystem(SPK::Ref sparkSystem) 132 | { 133 | SparkNodeRender* _spkRenderer = dynamic_cast(_curentSubRenderer); 134 | if(_spkRenderer) 135 | { 136 | _spkRenderer->setCurentParticleSystem(sparkSystem); 137 | } 138 | } 139 | 140 | void UrhoDevice::setScene(int index) 141 | { 142 | SparkNodeRender* _spkRenderer = dynamic_cast(_curentSubRenderer); 143 | if(_spkRenderer) 144 | _spkRenderer->setScene(index); 145 | } 146 | 147 | void UrhoDevice::showDebugShapes(bool enabled) 148 | { 149 | SparkNodeRender* _spkRenderer = dynamic_cast(_curentSubRenderer); 150 | if(_spkRenderer) 151 | _spkRenderer->showDebugShapes(enabled); 152 | } 153 | 154 | 155 | -------------------------------------------------------------------------------- /src/UrhoDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef URHODEVICE_H 2 | #define URHODEVICE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class UrhoDevice : public Urho3D::Object 10 | { 11 | URHO3D_OBJECT(UrhoDevice, Urho3D::Object) 12 | 13 | public: 14 | static UrhoDevice* getInstance(); 15 | static void createContext(); 16 | static void freeContext(); 17 | static Urho3D::Context* gUrhoContext; 18 | 19 | void createRenderWindow(void* hwnd); 20 | void runFrame(); 21 | void stop(); 22 | void setCurentParticleSystem(SPK::Ref sparkSystem); 23 | void onResize(int width, int height); 24 | void setScene(int index); 25 | void showDebugShapes(bool enabled); 26 | 27 | private: 28 | 29 | UrhoDevice(); 30 | ~UrhoDevice(); 31 | 32 | void handleMouseButtonDown(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData); 33 | void handleMouseButtonUp(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData); 34 | void handleMouseMove(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData); 35 | void handleKeyDown(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData); 36 | 37 | private: 38 | 39 | Urho3D::Engine* _engine; // Urho3D engine 40 | }; 41 | 42 | 43 | #endif // URHODEVICE_H 44 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "MainWindow.h" 2 | #include "UrhoDevice.h" 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | int main(int argc, char **argv) 9 | { 10 | UrhoDevice::createContext(); 11 | 12 | QApplication app(argc, argv); 13 | QCoreApplication::setOrganizationName("fredakilla"); 14 | QCoreApplication::setApplicationName("Spkgen"); 15 | QCoreApplication::setApplicationVersion(QT_VERSION_STR); 16 | 17 | qApp->setStyle(QStyleFactory::create("Fusion")); 18 | 19 | QPalette darkPalette; 20 | darkPalette.setColor(QPalette::Window, QColor(53,53,53)); 21 | darkPalette.setColor(QPalette::WindowText, Qt::white); 22 | darkPalette.setColor(QPalette::Base, QColor(25,25,25)); 23 | darkPalette.setColor(QPalette::AlternateBase, QColor(53,53,53)); 24 | darkPalette.setColor(QPalette::ToolTipBase, Qt::white); 25 | darkPalette.setColor(QPalette::ToolTipText, Qt::white); 26 | darkPalette.setColor(QPalette::Text, Qt::white); 27 | darkPalette.setColor(QPalette::Button, QColor(53,53,53)); 28 | darkPalette.setColor(QPalette::ButtonText, Qt::white); 29 | darkPalette.setColor(QPalette::BrightText, Qt::red); 30 | darkPalette.setColor(QPalette::Link, QColor(42, 130, 218)); 31 | darkPalette.setColor(QPalette::Highlight, QColor(42, 130, 218)); 32 | darkPalette.setColor(QPalette::HighlightedText, Qt::black); 33 | qApp->setPalette(darkPalette); 34 | 35 | MainWindow* mainWindow = new MainWindow(); 36 | mainWindow->showMaximized(); 37 | 38 | int ret = app.exec(); 39 | 40 | delete mainWindow; 41 | UrhoDevice::freeContext(); 42 | 43 | return ret; 44 | } 45 | -------------------------------------------------------------------------------- /src/node-editor/common/BaseNode.cpp: -------------------------------------------------------------------------------- 1 | #include "BaseNode.h" 2 | 3 | BaseNode::BaseNode() : _paramWidget(nullptr) 4 | { 5 | } 6 | 7 | BaseNode::~BaseNode() 8 | { 9 | } 10 | 11 | unsigned int BaseNode::nPorts(PortType portType) const 12 | { 13 | if(portType == PortType::In) 14 | { 15 | return _inputs.size(); 16 | } 17 | else if(portType == PortType::Out) 18 | { 19 | return _outputs.size(); 20 | } 21 | else 22 | { 23 | return 0; 24 | } 25 | } 26 | 27 | QString BaseNode::portCaption(PortType portType, PortIndex portIndex) const 28 | { 29 | if(portType == PortType::In) 30 | { 31 | Q_ASSERT((size_t)portIndex < _inputs.size()); 32 | return _inputs[portIndex]->name; 33 | } 34 | else if(portType == PortType::Out) 35 | { 36 | Q_ASSERT((size_t)portIndex < _outputs.size()); 37 | return _outputs[portIndex]->name; 38 | } 39 | else 40 | { 41 | return QString(""); 42 | } 43 | } 44 | 45 | 46 | NodeDataType BaseNode::dataType(PortType portType, PortIndex portIndex) const 47 | { 48 | if(portType == PortType::In) 49 | { 50 | return _inputs[portIndex]->dataType; 51 | } 52 | else if(portType == PortType::Out) 53 | { 54 | return _outputs[portIndex]->dataType; 55 | } 56 | else 57 | { 58 | return NODE_DATA_TYPE[EPT_NONE]; 59 | } 60 | } 61 | 62 | void BaseNode::setInData(std::shared_ptr nodeData, PortIndex portIndex) 63 | { 64 | _inputs[portIndex]->data = nodeData; 65 | process(); 66 | } 67 | 68 | unsigned int BaseNode::getParameterCount() 69 | { 70 | return (unsigned int)_parameters.size(); 71 | } 72 | 73 | Parameter* BaseNode::getParameter(unsigned int index) 74 | { 75 | if(index > getParameterCount()) 76 | return nullptr; 77 | 78 | return _parameters.at(index); 79 | } 80 | 81 | Parameter* BaseNode::getParameter(const QString name) 82 | { 83 | for (auto p : _parameters) 84 | { 85 | if(p->name == name) 86 | return p; 87 | } 88 | 89 | qWarning("Warning : Parameter '%s' does not exists in '%s' Node", 90 | name.toStdString().c_str(), 91 | this->Name().toStdString().c_str() 92 | ); 93 | 94 | return nullptr; 95 | } 96 | 97 | NodeValidationState BaseNode::validationState() const 98 | { 99 | // check if _paramWidget was created when node has paramaters. 100 | // if fatal error, you miss to call createParamWidgets() in the node constructor. 101 | if(_parameters.size() > 0 && _paramWidget == nullptr) 102 | { 103 | //qFatal("Fatal: _paramWidget was not created for node '%s'", Name().toStdString().c_str()); 104 | // or 105 | // force it here ?? (may be issues when serialize ?? to test...) 106 | //qWarning("Warning: _paramWidget was not created for node '%s'", Name().toStdString().c_str()); 107 | (const_cast(this))->createParamWidgets(); 108 | } 109 | 110 | return modelValidationState; 111 | } 112 | 113 | QString BaseNode::validationMessage() const 114 | { 115 | return modelValidationError; 116 | } 117 | -------------------------------------------------------------------------------- /src/node-editor/common/Color.cpp: -------------------------------------------------------------------------------- 1 | #include "Color.h" 2 | 3 | eColor::eColor() : r(0), g(0), b(0), a(255) 4 | { 5 | } 6 | 7 | eColor::eColor(eU8 nr, eU8 ng, eU8 nb, eU8 na) : r(nr), g(ng), b(nb), a(na) 8 | { 9 | } 10 | 11 | eColor::eColor(eColorConst cc) 12 | { 13 | static const eColor colors[] = 14 | { 15 | eColor(255, 0, 0), // red 16 | eColor( 0, 255, 0), // green 17 | eColor( 0, 0, 255), // blue 18 | eColor(215, 108, 0), // orange 19 | eColor(255, 255, 0), // yellow 20 | eColor(255, 0, 255), // purple 21 | eColor( 0, 255, 255), // cyan 22 | eColor(255, 0, 128), // pink 23 | eColor(255, 255, 255), // white 24 | eColor( 0, 0, 0), // black 25 | eColor(128, 128, 128), // gray 26 | eColor( 64, 64, 64), // dark gray 27 | eColor(204, 204, 204), // light gray 28 | }; 29 | 30 | *this = colors[cc]; 31 | } 32 | 33 | void eColor::set(eU8 nr, eU8 ng, eU8 nb) 34 | { 35 | r = nr; 36 | g = ng; 37 | b = nb; 38 | } 39 | 40 | void eColor::set(eU8 nr, eU8 ng, eU8 nb, eU8 na) 41 | { 42 | set(nr, ng, nb); 43 | a = na; 44 | } 45 | 46 | eU8 eColor::grayScale() const 47 | { 48 | return (r*11+g*16+b*5)/32; 49 | } 50 | 51 | void eColor::toGrayScale() 52 | { 53 | const eU8 gray = grayScale(); 54 | r = gray; 55 | g = gray; 56 | b = gray; 57 | } 58 | 59 | void eColor::scale (const eColor &c) 60 | { 61 | r = r*c.r/255; 62 | g = g*c.g/255; 63 | b = b*c.b/255; 64 | a = a*c.a/255; 65 | } 66 | 67 | eColor eColor::operator + (const eColor &c) const 68 | { 69 | return eColor(eMin((eInt)(r+c.r), 255), 70 | eMin((eInt)(g+c.g), 255), 71 | eMin((eInt)(b+c.b), 255), 72 | eMin((eInt)(a+c.a), 255)); 73 | } 74 | 75 | eColor eColor::operator - (const eColor &c) const 76 | { 77 | return eColor(eMax(0, (eInt)(r-c.r)), 78 | eMax(0, (eInt)(g-c.g)), 79 | eMax(0, (eInt)(b-c.b)), 80 | eMax(0, (eInt)(a-c.a))); 81 | } 82 | 83 | eColor eColor::operator * (eF32 s) const 84 | { 85 | eASSERT(s >= 0.0f); 86 | 87 | return eColor(eMin(eFtoL((eF32)r*s), 255), 88 | eMin(eFtoL((eF32)g*s), 255), 89 | eMin(eFtoL((eF32)b*s), 255), 90 | eMin(eFtoL((eF32)a*s), 255)); 91 | } 92 | 93 | eColor & eColor::operator += (const eColor &c) 94 | { 95 | *this = *this+c; 96 | return *this; 97 | } 98 | 99 | eColor & eColor::operator -= (const eColor &c) 100 | { 101 | *this = *this-c; 102 | return *this; 103 | } 104 | 105 | eColor & eColor::operator *= (eF32 s) 106 | { 107 | *this = *this*s; 108 | return *this; 109 | } 110 | 111 | void eColor::minComponents(const eColor &c) 112 | { 113 | r = eMin(r, c.r); 114 | g = eMin(g, c.g); 115 | b = eMin(b, c.b); 116 | a = eMin(a, c.a); 117 | } 118 | 119 | void eColor::maxComponents(const eColor &c) 120 | { 121 | r = eMax(r, c.r); 122 | g = eMax(g, c.g); 123 | b = eMax(b, c.b); 124 | a = eMax(a, c.a); 125 | } 126 | 127 | void eColor::average(const eColor &c) 128 | { 129 | r = (r+c.r)/2; 130 | g = (g+c.g)/2; 131 | b = (b+c.b)/2; 132 | a = (a+c.a)/2; 133 | } 134 | 135 | void eColor::difference(const eColor &c) 136 | { 137 | r = eAbs(r-c.r); 138 | g = eAbs(g-c.g); 139 | b = eAbs(b-c.b); 140 | a = eAbs(a-c.a); 141 | } 142 | 143 | // linear interpolation (0 <= t <= 1) 144 | eColor eColor::lerp(const eColor &to, eF32 t) const 145 | { 146 | eASSERT(t >= 0.0f && t <= 1.0f); 147 | 148 | return eColor(eFtoL(eLerp((eF32)r, (eF32)to.r, t)), 149 | eFtoL(eLerp((eF32)g, (eF32)to.g, t)), 150 | eFtoL(eLerp((eF32)b, (eF32)to.b, t)), 151 | eFtoL(eLerp((eF32)a, (eF32)to.a, t))); 152 | } 153 | 154 | eU32 eColor::toArgb() const // a MSB, b LSB 155 | { 156 | // swaps R und B channels 157 | eU32 argb = abgr&0xff00ff00; 158 | argb |= ((abgr&0x00ff0000)>>16); 159 | argb |= ((abgr&0x000000ff)<<16); 160 | return argb; 161 | } 162 | 163 | const eU8 & eColor::operator [] (eInt index) const 164 | { 165 | eASSERT(index < 4); 166 | return ((eU8 *)this)[index]; 167 | } 168 | 169 | eU8 & eColor::operator [] (eInt index) 170 | { 171 | eASSERT(index < 4); 172 | return ((eU8 *)this)[index]; 173 | } 174 | 175 | eBool eColor::operator == (const eColor &c) const 176 | { 177 | return (abgr == c.abgr); 178 | } 179 | 180 | eBool eColor::operator != (const eColor &c) const 181 | { 182 | return !(*this == c); 183 | } 184 | 185 | // converts from RGB to HSV color space. the hue 186 | // defines the color. its range is 0..359 if the 187 | // color is chromatic and -1 if the color is 188 | // achromatic. the saturation and value both vary 189 | // between 0 and 255. 190 | void eColor::toHsv(eInt &h, eInt &s, eInt &v) 191 | { 192 | // find maximum channel 193 | eInt max = r; 194 | eInt whatMax = 0; // r => 0, g => 1, b => 2 195 | 196 | if (g > max) 197 | { 198 | max = g; 199 | whatMax = 1; 200 | } 201 | 202 | if (b > max) 203 | { 204 | max = b; 205 | whatMax = 2; 206 | } 207 | 208 | // find minimum channel 209 | const eInt min = eMin(r, eMin(g, b)); 210 | const eInt delta = max-min; 211 | 212 | // calculate HSV values 213 | v = max; 214 | s = max ? (510*delta+max)/(2*max) : 0; 215 | 216 | if (s == 0) 217 | h = -1; // hue is undefined 218 | else 219 | { 220 | switch (whatMax) 221 | { 222 | case 0: // red is max component 223 | if (g >= b) 224 | h = (120*(g-b)+delta)/(2*delta); 225 | else 226 | h = (120*(g-b+delta)+delta)/(2*delta)+300; 227 | break; 228 | 229 | case 1: // green is max component 230 | if (b > r) 231 | h = 120+(120*(b-r)+delta)/(2*delta); 232 | else 233 | h = 60+(120*(b-r+delta)+delta)/(2*delta); 234 | break; 235 | 236 | case 2: // blue is max component 237 | if (r > g) 238 | h = 240+(120*(r-g)+delta)/(2*delta); 239 | else 240 | h = 180+(120*(r-g+delta)+delta)/(2*delta); 241 | break; 242 | } 243 | } 244 | } 245 | 246 | void eColor::fromHsv(eInt h, eInt s, eInt v) 247 | { 248 | if (h < -1 || (eU32)s > 255 || (eU32)v > 255) 249 | return; 250 | 251 | if (s == 0 || h == -1) 252 | set(v, v, v); // ignore achromatic case 253 | else 254 | { 255 | // much more complicated chromatic case 256 | if ((eU32)h >= 360) 257 | h %= 360; 258 | 259 | const eU32 f = h%60; 260 | h /= 60; 261 | const eU32 p = (eU32)(2*v*(255-s)+255)/510; 262 | 263 | if (h&1) 264 | { 265 | const eU32 q = (eU32)(2*v*(15300-s*f)+15300)/30600; 266 | 267 | switch (h) 268 | { 269 | case 1: 270 | set(q, v, p); 271 | break; 272 | 273 | case 3: 274 | set(p, q, v); 275 | break; 276 | 277 | case 5: 278 | set(v, p, q); 279 | break; 280 | } 281 | } 282 | else 283 | { 284 | const eU32 t = (eU32)(2*v*(15300-(s*(60-f)))+15300)/30600; 285 | 286 | switch (h) 287 | { 288 | case 0: 289 | set(v, t, p); 290 | break; 291 | 292 | case 2: 293 | set(p, v, t); 294 | break; 295 | 296 | case 4: 297 | set(t, p, v); 298 | break; 299 | } 300 | } 301 | } 302 | } 303 | -------------------------------------------------------------------------------- /src/node-editor/common/Color.h: -------------------------------------------------------------------------------- 1 | #ifndef COLOR_HPP 2 | #define COLOR_HPP 3 | 4 | #include "Types.h" 5 | 6 | enum eColorConst 7 | { 8 | eCOL_RED, 9 | eCOL_GREEN, 10 | eCOL_BLUE, 11 | eCOL_ORANGE, 12 | eCOL_YELLOW, 13 | eCOL_PURPLE, 14 | eCOL_CYAN, 15 | eCOL_PINK, 16 | eCOL_WHITE, 17 | eCOL_BLACK, 18 | eCOL_GRAY, 19 | eCOL_DARKGRAY, 20 | eCOL_LIGHTGRAY, 21 | }; 22 | 23 | // 8-bit per channel integer color 24 | class eColor 25 | { 26 | public: 27 | eColor(); 28 | eColor(eU8 nr, eU8 ng, eU8 nb, eU8 na=255); 29 | eColor(eColorConst cc); 30 | 31 | void set(eU8 nr, eU8 ng, eU8 nb); 32 | void set(eU8 nr, eU8 ng, eU8 nb, eU8 na); 33 | eU8 grayScale() const; 34 | void toGrayScale(); 35 | void scale (const eColor &c); 36 | void minComponents(const eColor &c); 37 | void maxComponents(const eColor &c); 38 | void average(const eColor &c); 39 | void difference(const eColor &c); 40 | eColor lerp(const eColor &to, eF32 t) const; 41 | eU32 toArgb() const; 42 | 43 | eColor operator + (const eColor &c) const; 44 | eColor operator - (const eColor &c) const; 45 | eColor operator * (eF32 s) const; 46 | eColor & operator += (const eColor &c); 47 | eColor & operator -= (const eColor &c); 48 | eColor & operator *= (eF32 s); 49 | eU8 & operator [] (eInt index); 50 | eBool operator == (const eColor &c) const; 51 | eBool operator != (const eColor &c) const; 52 | 53 | const eU8 & operator [] (eInt index) const; 54 | 55 | friend eColor operator * (eF32 s, const eColor &c) 56 | { 57 | return c*s; 58 | } 59 | 60 | public: 61 | // non-inlinable functions 62 | void toHsv(eInt &h, eInt &s, eInt &v); 63 | void fromHsv(eInt h, eInt s, eInt v); 64 | 65 | public: 66 | union 67 | { 68 | struct 69 | { 70 | eU8 r; // LSB 71 | eU8 g; 72 | eU8 b; 73 | eU8 a; // MSB 74 | }; 75 | 76 | eU32 abgr; 77 | }; 78 | }; 79 | 80 | #endif // COLOR_HPP 81 | -------------------------------------------------------------------------------- /src/node-editor/common/CommentGraphicsItem.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMENTGRAPHICSITEM_H 2 | #define COMMENTGRAPHICSITEM_H 3 | 4 | #include "Types.h" 5 | #include 6 | 7 | #define TYPE_ID_COMMENT 0xFFFF + 1701 8 | 9 | //----------------------------------------------------------------------------------------- 10 | //! eCommentItem 11 | //! A comment graphics item. 12 | //----------------------------------------------------------------------------------------- 13 | class eCommentItem : public QGraphicsTextItem 14 | { 15 | Q_OBJECT 16 | public: 17 | eCommentItem(QGraphicsItem *parent); 18 | 19 | enum { Type = TYPE_ID_COMMENT }; 20 | int type() const { return Type; } 21 | eInt _getTextLength() { return m_realText.length(); } 22 | bool isEdited() { return m_edited; } 23 | 24 | //void saveToXml(QDomElement &node) const; 25 | //void loadFromXml(const QDomElement &node); 26 | QJsonObject save() const; 27 | void restore(QJsonObject const& json); 28 | 29 | protected: 30 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 31 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me); 32 | void mousePressEvent(QGraphicsSceneMouseEvent *me); 33 | void mouseMoveEvent(QGraphicsSceneMouseEvent *me); 34 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *me); 35 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); 36 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); 37 | void hoverMoveEvent(QGraphicsSceneHoverEvent * me); 38 | void focusOutEvent(QFocusEvent *event); 39 | QPainterPath shape() const; 40 | QRectF boundingRect() const; 41 | 42 | private Q_SLOTS: 43 | void _onUpdateSize(const QSizeF newSize); 44 | 45 | private: 46 | void _formatOutput(); 47 | void _init(); 48 | 49 | private: 50 | static const eInt RESIZE_AREA = 10; // default resize area from bottom-right border (in pixels) 51 | QString m_realText; // store real text 52 | eInt m_mode; // text or html mode 53 | QColor m_colorBack; // background color 54 | QColor m_colorText; // text color 55 | eBool m_isResizing; // is resizing 56 | eBool m_edited; // is editing 57 | QPointF m_mouseDownPos; // mouse pos 58 | qreal m_width; // widget width 59 | qreal m_height; // widget height 60 | }; 61 | 62 | #endif // COMMENTGRAPHICSITEM_H 63 | -------------------------------------------------------------------------------- /src/node-editor/common/CustomFlowScene.h: -------------------------------------------------------------------------------- 1 | #ifndef CUSTOMFLOWSCENE_H 2 | #define CUSTOMFLOWSCENE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "CommentGraphicsItem.h" 9 | 10 | using QtNodes::Node; 11 | using QtNodes::FlowView; 12 | using QtNodes::FlowScene; 13 | using QtNodes::DataModelRegistry; 14 | 15 | class NodePath; 16 | class NodePath4; 17 | 18 | // empty graphic item used as parent container for comments items 19 | class QGraphicsItemLayer : public QGraphicsItem 20 | { 21 | public: 22 | virtual QRectF boundingRect() const override 23 | { 24 | return QRectF(0,0,0,0); 25 | } 26 | 27 | virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override 28 | { 29 | } 30 | }; 31 | 32 | 33 | 34 | class CustomFlowScene : public FlowScene 35 | { 36 | Q_OBJECT 37 | public: 38 | CustomFlowScene(std::shared_ptr registry, QObject * parent = Q_NULLPTR); 39 | CustomFlowScene(QObject * parent = Q_NULLPTR); 40 | ~CustomFlowScene(); 41 | 42 | void save(QJsonObject &json) const; 43 | void load(const QJsonObject &json); 44 | void clearComments(); 45 | 46 | QString getName() { return _name; } 47 | void setName(QString name) { _name = name; } 48 | 49 | Q_SIGNALS: 50 | void signalShowPathNode(NodePath*); 51 | void signalShowPath4Node(NodePath4*); 52 | 53 | public Q_SLOTS: 54 | void deleteSelectedComments(); 55 | 56 | private Q_SLOTS: 57 | void showNode(Node& node); 58 | void initNode(QtNodes::Node& node); 59 | 60 | protected: 61 | void keyPressEvent(QKeyEvent *event) override; 62 | void keyReleaseEvent(QKeyEvent *event) override; 63 | void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override; 64 | 65 | private: 66 | void _initialize(); 67 | eCommentItem* _addComment(const QPointF &pos); 68 | void _copyNode(); 69 | void _pasteNode(); 70 | void _cutNode(); 71 | 72 | private: 73 | QGraphicsItemLayer* _commentLayer; 74 | QPointF _mousePos; 75 | QList _commentList; 76 | QString _name; 77 | }; 78 | 79 | 80 | #endif // CUSTOMFLOWSCENE_H 81 | -------------------------------------------------------------------------------- /src/node-editor/common/CustomWidgets.h: -------------------------------------------------------------------------------- 1 | #ifndef PARAM_WIDGETS_HPP 2 | #define PARAM_WIDGETS_HPP 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "Parameter.h" 12 | #include "Trackedit.h" 13 | 14 | //------------------------------------------------------------------------------------------------------------------------------ 15 | // eParamTrackEdit2 16 | //------------------------------------------------------------------------------------------------------------------------------ 17 | class eParamTrackEdit : public eTrackEdit 18 | { 19 | Q_OBJECT 20 | public: 21 | eParamTrackEdit(eF32 &flt, Parameter ¶m, QWidget *parent=nullptr); 22 | eParamTrackEdit(eInt &intgr, Parameter ¶m, QWidget *parent=nullptr); 23 | eParamTrackEdit(eU8 &byte, Parameter ¶m, QWidget *parent=nullptr); 24 | 25 | void setIndicatorColor(const QColor &indCol); 26 | void setIndicatorEnabled(eBool indEnabled); 27 | 28 | virtual void paintEvent(QPaintEvent *pe); 29 | 30 | Q_SIGNALS: 31 | void onParameterChanged(); 32 | private Q_SLOTS: 33 | void _onValueChanged(); 34 | 35 | private: 36 | QString m_text; 37 | QColor m_indCol; 38 | bool m_indEnabled; 39 | }; 40 | 41 | 42 | //------------------------------------------------------------------------------------------------------------------------------ 43 | // push button 44 | //------------------------------------------------------------------------------------------------------------------------------ 45 | class eButton : public QPushButton 46 | { 47 | Q_OBJECT 48 | public: 49 | eButton(Parameter ¶m, QWidget *parent=nullptr); 50 | Q_SIGNALS: 51 | void onParameterChanged(const Parameter ¶m); 52 | private Q_SLOTS: 53 | void _onClicked(); 54 | private: 55 | Parameter& m_param; 56 | }; 57 | 58 | 59 | //------------------------------------------------------------------------------------------------------------------------------ 60 | // boolean button 61 | //------------------------------------------------------------------------------------------------------------------------------ 62 | class eBoolButton : public QToolButton 63 | { 64 | Q_OBJECT 65 | public: 66 | eBoolButton(Parameter ¶m, QWidget *parent=nullptr); 67 | Q_SIGNALS: 68 | void onParameterChanged(const Parameter ¶m); 69 | private Q_SLOTS: 70 | void _updateCaption(); 71 | void _onClicked(); 72 | private: 73 | Parameter& m_param; 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------------------------------------ 77 | // combo box 78 | //------------------------------------------------------------------------------------------------------------------------------ 79 | class eComboBox : public QComboBox 80 | { 81 | Q_OBJECT 82 | public: 83 | eComboBox(Parameter ¶m, QWidget *parent=nullptr); 84 | Q_SIGNALS: 85 | void onParameterChanged(const Parameter ¶m); 86 | private Q_SLOTS: 87 | void _updateSelection(); 88 | void _onActivated(int index); 89 | private: 90 | Parameter& m_param; 91 | }; 92 | 93 | //------------------------------------------------------------------------------------------------------------------------------ 94 | // flag button 95 | //------------------------------------------------------------------------------------------------------------------------------ 96 | class eFlagButton : public QToolButton 97 | { 98 | Q_OBJECT 99 | public: 100 | eFlagButton(Parameter ¶m, const QString &caption, eU32 flagIndex, QWidget *parent=nullptr); 101 | Q_SIGNALS: 102 | void onParameterChanged(const Parameter ¶m); 103 | private Q_SLOTS: 104 | void _updateDownState(); 105 | void _onClicked(); 106 | private: 107 | Parameter& m_param; 108 | eU32 m_flagIndex; 109 | }; 110 | 111 | //------------------------------------------------------------------------------------------------------------------------------ 112 | // text edit (multi-lines) 113 | //------------------------------------------------------------------------------------------------------------------------------ 114 | class eTextEdit : public QTextEdit 115 | { 116 | Q_OBJECT 117 | public: 118 | eTextEdit(Parameter ¶m, QWidget *parent=nullptr); 119 | Q_SIGNALS: 120 | void onParameterChanged(const Parameter ¶m); 121 | private Q_SLOTS: 122 | void _onTextChanged(); 123 | private: 124 | Parameter& m_param; 125 | }; 126 | 127 | //------------------------------------------------------------------------------------------------------------------------------ 128 | // line edit (single-line) 129 | //------------------------------------------------------------------------------------------------------------------------------ 130 | class eLineEdit : public QLineEdit 131 | { 132 | Q_OBJECT 133 | public: 134 | eLineEdit(Parameter ¶m, QWidget *parent=nullptr); 135 | Q_SIGNALS: 136 | void onParameterChanged(const Parameter ¶m); 137 | private Q_SLOTS: 138 | void _updateCaption(); 139 | void _onTextChanged(const QString &text); 140 | private: 141 | Parameter& m_param; 142 | }; 143 | 144 | 145 | //------------------------------------------------------------------------------------------------------------------------------ 146 | // file frame with line edit + button for open file dialog 147 | //------------------------------------------------------------------------------------------------------------------------------ 148 | class eFileFrame : public QWidget 149 | { 150 | Q_OBJECT 151 | public: 152 | 153 | enum Type 154 | { 155 | OPEN, 156 | SAVE 157 | }; 158 | 159 | eFileFrame(Parameter ¶m, Type type, QWidget *parent=nullptr); 160 | virtual ~eFileFrame(); 161 | Q_SIGNALS: 162 | void onParameterChanged(const Parameter ¶m); 163 | private Q_SLOTS: 164 | void _updateCaption(); 165 | void _onSelectLocally(); 166 | private: 167 | Parameter& m_param; 168 | eLineEdit* m_lineEdit; 169 | Type _type; 170 | 171 | }; 172 | 173 | 174 | //------------------------------------------------------------------------------------------------------------------------------ 175 | // color frame 176 | //------------------------------------------------------------------------------------------------------------------------------ 177 | class eColorFrame : public QWidget 178 | { 179 | Q_OBJECT 180 | public: 181 | eColorFrame(Parameter ¶m, QWidget *parent=nullptr); 182 | virtual ~eColorFrame(); 183 | private: 184 | virtual void timerEvent(QTimerEvent *te); 185 | Q_SIGNALS: 186 | void onParameterChanged(); 187 | private Q_SLOTS: 188 | void _onSelectLocally(); 189 | void _updateEditColors(); 190 | private: 191 | Parameter& m_param; 192 | eParamTrackEdit* m_edits[4]; 193 | }; 194 | 195 | 196 | #endif // PARAM_WIDGETS_HPP 197 | -------------------------------------------------------------------------------- /src/node-editor/common/Nodestyle.h: -------------------------------------------------------------------------------- 1 | #ifndef NODESTYLE_H 2 | #define NODESTYLE_H 3 | 4 | #include 5 | #include 6 | #include 7 | using QtNodes::FlowViewStyle; 8 | using QtNodes::NodeStyle; 9 | using QtNodes::ConnectionStyle; 10 | 11 | static void setNodeStyle() 12 | { 13 | FlowViewStyle::setStyle( 14 | R"( 15 | { 16 | "FlowViewStyle": { 17 | "BackgroundColor": [50, 50, 50], 18 | "FineGridColor": [70, 70, 70], 19 | "CoarseGridColor": [90, 90, 90] 20 | } 21 | } 22 | )"); 23 | 24 | NodeStyle::setNodeStyle( 25 | R"( 26 | { 27 | "NodeStyle": { 28 | "NormalBoundaryColor": "darkgray", 29 | "SelectedBoundaryColor": "deepskyblue", 30 | "GradientColor0": "mintcream", 31 | "GradientColor1": "mintcream", 32 | "GradientColor2": "mintcream", 33 | "GradientColor3": "mintcream", 34 | "ShadowColor": [200, 200, 200], 35 | "FontColor": [10, 10, 10], 36 | "FontColorFaded": [100, 100, 100], 37 | "ConnectionPointColor": "white", 38 | "PenWidth": 2.0, 39 | "HoveredPenWidth": 2.5, 40 | "ConnectionPointDiameter": 10.0, 41 | "Opacity": 1.0 42 | } 43 | } 44 | )"); 45 | 46 | ConnectionStyle::setConnectionStyle( 47 | R"( 48 | { 49 | "ConnectionStyle": { 50 | "ConstructionColor": "gray", 51 | "NormalColor": "black", 52 | "SelectedColor": "gray", 53 | "SelectedHaloColor": "deepskyblue", 54 | "HoveredColor": "deepskyblue", 55 | 56 | "LineWidth": 3.0, 57 | "ConstructionLineWidth": 2.0, 58 | "PointDiameter": 10.0, 59 | 60 | "UseDataDefinedColors": false 61 | } 62 | } 63 | )"); 64 | } 65 | 66 | #endif // NODESTYLE_H 67 | -------------------------------------------------------------------------------- /src/node-editor/common/ParamWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef PARAMWIDGET_H 2 | #define PARAMWIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class BaseNode; 9 | class Parameter; 10 | 11 | class ParamWidget : public QScrollArea 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | ParamWidget(BaseNode* node, QWidget* parent = nullptr); 17 | void save(QJsonObject& json); 18 | void restore(QJsonObject const &json); 19 | 20 | private: 21 | 22 | void createWidgets(); 23 | template void createParamTrackEditX(Parameter* p, QHBoxLayout* hbl); 24 | template void createParamTrackEditXY(Parameter* p, QHBoxLayout* hbl); 25 | template void createParamTrackEditXYZ(Parameter* p, QHBoxLayout* hbl); 26 | template void createParamTrackEditXYZW(Parameter* p, QHBoxLayout* hbl); 27 | void createParamLineEdit(Parameter* p, QHBoxLayout* hbl); 28 | void createParamBoolButton(Parameter* p, QHBoxLayout* hbl); 29 | void createParamEnum(Parameter* p, QHBoxLayout* hbl); 30 | void createParamFile(Parameter* p, QHBoxLayout* hbl); 31 | void createParamFileSave(Parameter* p, QHBoxLayout* hbl); 32 | void createParamFlags(Parameter* p, QHBoxLayout* hbl); 33 | void createParamRGBA(Parameter* p, QHBoxLayout* hbl); 34 | void createParamButton(Parameter* p, QHBoxLayout* hbl); 35 | 36 | QVBoxLayout* _layout; 37 | BaseNode* _node; 38 | }; 39 | 40 | #endif // PARAMWIDGET_H 41 | -------------------------------------------------------------------------------- /src/node-editor/common/Parameter.cpp: -------------------------------------------------------------------------------- 1 | #include "Parameter.h" 2 | 3 | 4 | enum eParamClass 5 | { 6 | ePC_NONE, 7 | ePC_FLOAT, 8 | ePC_INT, 9 | ePC_STRING, 10 | ePC_BOOL, 11 | ePC_UCHAR, 12 | ePC_COLOR, 13 | }; 14 | 15 | struct ParameterInfo 16 | { 17 | eU32 numComponents; 18 | eParamClass classs; // three 's' because 'class' is keyword 19 | } 20 | PARAM_INFOS[] = 21 | { 22 | { 0, ePC_NONE }, // EPT_NONE 23 | { 1, ePC_STRING }, // EPT_STRING 24 | { 1, ePC_BOOL }, // EPT_BOOL 25 | { 1, ePC_INT }, // EPT_FLAGS 26 | { 1, ePC_INT }, // EPT_ENUM 27 | { 1, ePC_FLOAT }, // EPT_FLOAT 28 | { 2, ePC_FLOAT }, // EPT_FXY 29 | { 3, ePC_FLOAT }, // EPT_FXYZ 30 | { 4, ePC_FLOAT }, // EPT_FXYZW 31 | { 1, ePC_INT }, // EPT_INT 32 | { 2, ePC_INT }, // EPT_IXY 33 | { 3, ePC_INT }, // EPT_IXYZ 34 | { 4, ePC_INT }, // EPT_IXYZW 35 | { 1, ePC_INT }, // EPT_FILE 36 | { 1, ePC_STRING }, // EPT_TEXT 37 | { 3, ePC_COLOR }, // EPT_RGB 38 | { 4, ePC_COLOR }, // EPT_RGBA 39 | }; 40 | 41 | 42 | Parameter::Parameter() 43 | { 44 | 45 | } 46 | 47 | Parameter::Parameter(ParamType type, QString name, float min, float max, BaseNode* node) : 48 | type(type) 49 | , name(name) 50 | , min(min) 51 | , max(max) 52 | , node(node) 53 | , isConnected(false) 54 | { 55 | 56 | } 57 | 58 | void Parameter::setDescription(const QString &descr) 59 | { 60 | Q_ASSERT(type == EPT_ENUM || type == EPT_FLAGS); 61 | Q_ASSERT(descr.length() > 0); 62 | m_descr = descr; 63 | } 64 | 65 | const eString & Parameter::getDescription() const 66 | { 67 | return m_descr; 68 | } 69 | 70 | ParamType Parameter::getType() 71 | { 72 | return type; 73 | } 74 | 75 | eF32 Parameter::getMin() const 76 | { 77 | return min; 78 | } 79 | 80 | eF32 Parameter::getMax() const 81 | { 82 | return max; 83 | } 84 | 85 | BaseNode * Parameter::getOwnerOp() const 86 | { 87 | return node; 88 | } 89 | 90 | void Parameter::setChanged(eBool reconnect) 91 | { 92 | //@@m_ownerOp->setChanged(reconnect); 93 | } 94 | 95 | const eParamValue & Parameter::getDefaultValue() const 96 | { 97 | return defVal; 98 | } 99 | 100 | eParamValue & Parameter::getBaseValue() 101 | { 102 | return baseValue; 103 | } 104 | 105 | const eParamValue & Parameter::getBaseValue() const 106 | { 107 | return baseValue; 108 | } 109 | 110 | 111 | bool Parameter::getValueAsBool() const 112 | { 113 | Q_ASSERT(type == EPT_BOOL); 114 | return baseValue.get(); 115 | } 116 | 117 | int Parameter::getValueAsEnum() const 118 | { 119 | Q_ASSERT(type == EPT_ENUM); 120 | return baseValue.get(); 121 | } 122 | 123 | unsigned char Parameter::getValueAsFlags() const 124 | { 125 | Q_ASSERT(type == EPT_FLAGS); 126 | return baseValue.get(); 127 | } 128 | 129 | QString Parameter::getValueAsString() const 130 | { 131 | Q_ASSERT(type == EPT_STRING || type == EPT_FILE || type == EPT_FILESAVE || type == EPT_BUTTON); 132 | return baseValue.get(); 133 | } 134 | 135 | eF32 Parameter::getValueAsFloat() const 136 | { 137 | Q_ASSERT(type == EPT_FLOAT); 138 | return baseValue.get(); 139 | } 140 | 141 | eFXY Parameter::getValueAsFXY() const 142 | { 143 | Q_ASSERT(type == EPT_FXY); 144 | return baseValue.get(); 145 | } 146 | 147 | eFXYZ Parameter::getValueAsFXYZ() const 148 | { 149 | Q_ASSERT(type == EPT_FXYZ); 150 | return baseValue.get(); 151 | } 152 | 153 | eFXYZW Parameter::getValueAsFXYZW() const 154 | { 155 | Q_ASSERT(type == EPT_FXYZW); 156 | return baseValue.get(); 157 | } 158 | 159 | eInt Parameter::getValueAsInt() const 160 | { 161 | Q_ASSERT(type == EPT_INT); 162 | return baseValue.get(); 163 | } 164 | 165 | eIXY Parameter::getValueAsIXY() const 166 | { 167 | Q_ASSERT(type == EPT_IXY); 168 | return baseValue.get(); 169 | } 170 | 171 | eIXYZ Parameter::getValueAsIXYZ() const 172 | { 173 | Q_ASSERT(type == EPT_IXYZ); 174 | return baseValue.get(); 175 | } 176 | 177 | eIXYZW Parameter::getValueAsIXYZW() const 178 | { 179 | Q_ASSERT(type == EPT_IXYZW); 180 | return baseValue.get(); 181 | } 182 | 183 | eColor Parameter::getValueAsColor() const 184 | { 185 | Q_ASSERT(type == EPT_RGB || type == EPT_RGBA); 186 | return baseValue.get(); 187 | } 188 | 189 | unsigned int Parameter::getComponentCount() 190 | { 191 | return PARAM_INFOS[type].numComponents; 192 | } 193 | -------------------------------------------------------------------------------- /src/node-editor/common/Parameter.h: -------------------------------------------------------------------------------- 1 | #ifndef PARAMETER_H 2 | #define PARAMETER_H 3 | 4 | #include "Types.h" 5 | #include "Variant.h" 6 | #include 7 | #include 8 | #include "Color.h" 9 | 10 | using QtNodes::NodeDataType; 11 | 12 | class BaseNode; 13 | 14 | enum ParamType 15 | { 16 | EPT_NONE = 0, 17 | EPT_STRING = 1, 18 | EPT_BOOL = 2, 19 | EPT_FLAGS = 3, 20 | EPT_ENUM = 4, 21 | EPT_FLOAT = 5, 22 | EPT_FXY = 6, 23 | EPT_FXYZ = 7, 24 | EPT_FXYZW = 8, 25 | EPT_INT = 9, 26 | EPT_IXY = 10, 27 | EPT_IXYZ = 11, 28 | EPT_IXYZW = 12, 29 | EPT_FILE = 13, 30 | EPT_TEXT = 14, 31 | EPT_RGB = 15, 32 | EPT_RGBA = 16, 33 | EPT_BUTTON = 17, 34 | EPT_FILESAVE = 18, 35 | }; 36 | /* 37 | static const NodeDataType PARAM_TYPE[] = 38 | { 39 | // data types 40 | { "none" , "none" }, // 0 41 | { "string" , "string" }, // 1 42 | { "bool" , "bool" }, // 2 43 | { "flags" , "flags" }, // 3 44 | { "enum" , "enum" }, // 4 45 | { "float" , "float" }, // 5 46 | { "fxy" , "fxy" }, // 6 47 | { "fxyz" , "fxyz" }, // 7 48 | { "fxyzw" , "fxyzw" }, // 8 49 | { "int" , "int" }, // 9 50 | { "ixy" , "ixy" }, // 10 51 | { "ixyz" , "ixyz" }, // 11 52 | { "ixyzw" , "ixyzw" }, // 12 53 | { "file" , "file" }, // 13 54 | { "text" , "text" }, // 14 55 | { "rgb" , "rgb" }, // 15 56 | { "rgba" , "rgba" }, // 16 57 | }; 58 | */ 59 | 60 | 61 | // possible variant type for parameters 62 | typedef nonstd::variant 63 | < eF32, 64 | eFXY, 65 | eFXYZ, 66 | eFXYZW, 67 | eInt, 68 | eIXY, 69 | eIXYZ, 70 | eIXYZW, 71 | QString, 72 | bool, 73 | unsigned char, 74 | eColor 75 | > eParamValue; 76 | 77 | 78 | class Parameter : public QObject 79 | { 80 | Q_OBJECT 81 | public: 82 | ParamType type; 83 | QString name; 84 | float min; 85 | float max; 86 | BaseNode* node; 87 | bool isConnected; 88 | eParamValue baseValue; 89 | const eParamValue defVal; 90 | eString m_descr; // used for enum and flags texts 91 | 92 | Parameter(); 93 | Parameter(ParamType type, QString name, float min, float max, BaseNode* node); 94 | 95 | unsigned int getComponentCount(); 96 | void setDescription(const QString &descr); 97 | const eString & getDescription() const; 98 | ParamType getType(); 99 | eF32 getMin() const; 100 | eF32 getMax() const; 101 | BaseNode * getOwnerOp() const; 102 | void setChanged(eBool reconnect = eFALSE); 103 | const eParamValue & getDefaultValue() const; 104 | eParamValue & getBaseValue(); 105 | const eParamValue & getBaseValue() const; 106 | 107 | bool getValueAsBool() const; 108 | int getValueAsEnum() const; 109 | unsigned char getValueAsFlags() const; 110 | QString getValueAsString() const; 111 | 112 | eF32 getValueAsFloat() const; 113 | eFXY getValueAsFXY() const; 114 | eFXYZ getValueAsFXYZ() const; 115 | eFXYZW getValueAsFXYZW() const; 116 | 117 | eInt getValueAsInt() const; 118 | eIXY getValueAsIXY() const; 119 | eIXYZ getValueAsIXYZ() const; 120 | eIXYZW getValueAsIXYZW() const; 121 | 122 | eColor getValueAsColor() const; 123 | 124 | Q_SIGNALS: 125 | void parameterUpdated(); 126 | }; 127 | 128 | #endif // PARAMETER_H 129 | -------------------------------------------------------------------------------- /src/node-editor/common/Path.cpp: -------------------------------------------------------------------------------- 1 | #include "Path.h" 2 | #include 3 | #include 4 | 5 | //------------------------------------------------------------------------------ 6 | // Path impl 7 | //------------------------------------------------------------------------------ 8 | 9 | Path::Path(PathType splineType, unsigned int keyCount) : 10 | _spline(nullptr), 11 | _loopMode(ELM_LAST) 12 | { 13 | ///switch(splineType) 14 | //{ 15 | //case EPT_CONSTANT: _spline = new Spline; break; 16 | //case EPT_LINEAR: _spline = new Spline; break; 17 | //case EPT_CUBIC: _spline = new Spline; break; 18 | //case EPT_AKIMA: _spline = new Spline; break; 19 | //case EPT_BESSEL: _spline = new Spline; break; 20 | //case EPT_PCHIP: _spline = new Spline; break; 21 | //case EPT_QUINTIC: _spline = new Spline; break; 22 | //default: assert(0); 23 | //} 24 | _spline = new Spline(splineType); 25 | 26 | //_times.resize(keyCount); 27 | //_values.resize(keyCount); 28 | } 29 | 30 | Path::~Path() 31 | { 32 | if(_spline) 33 | delete _spline; 34 | } 35 | 36 | void Path::addKey(double keyTime, double keyValue) 37 | { 38 | assert(keyTime >= 0.0); 39 | 40 | ///_insertKey(keyTime, keyValue); 41 | _times.push_back(keyTime); 42 | _values.push_back(keyValue); 43 | } 44 | 45 | void Path::_insertKey(double keyTime, double keyValue) 46 | { 47 | for (unsigned int i=0; i<_times.size(); i++) 48 | { 49 | if (_times[i] > keyTime) 50 | { 51 | _times.insert(_times.begin()+i, keyTime); 52 | _values.insert(_values.begin()+i, keyValue); 53 | return; 54 | } 55 | } 56 | 57 | // no key found => append 58 | _times.push_back(keyTime); 59 | _values.push_back(keyValue); 60 | } 61 | 62 | unsigned int Path::getKeyCount() const 63 | { 64 | return _times.size(); 65 | } 66 | 67 | const PathKey Path::getKeyByIndex(unsigned int index) const 68 | { 69 | assert(index < _times.size()); 70 | 71 | PathKey key; 72 | key.time = _times.at(index); 73 | key.value = _values.at(index); 74 | return key; 75 | } 76 | 77 | double Path::getStartTime() const 78 | { 79 | if (_times.size() == 0) 80 | return 0.0; 81 | 82 | return _times.front(); 83 | } 84 | 85 | double Path::getEndTime() const 86 | { 87 | if (_times.size() == 0) 88 | return 0.0f; 89 | 90 | return _times.back(); 91 | } 92 | 93 | void Path::clear() 94 | { 95 | _times.clear(); 96 | _values.clear(); 97 | } 98 | 99 | void Path::setAtIndex(unsigned index, double time, double value) 100 | { 101 | assert(index < _times.size()); 102 | _times[index] = time; 103 | _values[index] = value; 104 | } 105 | 106 | void Path::build() 107 | { 108 | _spline->clear(); 109 | _spline->build(_times.data(), _values.data(), _times.size()); 110 | } 111 | 112 | double Path::evaluate(double time) const 113 | { 114 | if (!_times.size()) 115 | return 0.0; 116 | 117 | const double minTime = _times.front(); 118 | const double maxTime = _times.back(); 119 | 120 | const double firstValue = _values.front(); 121 | const double lastValue = _values.back(); 122 | 123 | if (_loopMode == ELM_LOOP) 124 | time = fmodf(time - minTime, maxTime - minTime); 125 | 126 | if (time <= minTime || _times.size() == 1) // time before first key? 127 | return (_loopMode == ELM_ZERO ? 0.0 : firstValue); 128 | else if (time >= maxTime) // time after last key? 129 | return (_loopMode == ELM_ZERO ? 0.0 : lastValue); 130 | else 131 | return _spline->eval(time); 132 | } 133 | 134 | void Path::setLoopMode(PathLoopMode loopMode) 135 | { 136 | _loopMode = loopMode; 137 | } 138 | 139 | 140 | //------------------------------------------------------------------------------ 141 | // Path4 impl 142 | //------------------------------------------------------------------------------ 143 | 144 | Path4::Float4::Float4(float x, float y, float z, float w) : 145 | x(x), y(y), z(z), w(w) 146 | { 147 | } 148 | 149 | Path4::Path4(PathType splineType) 150 | { 151 | /*for (int i=0; i<4; i++) 152 | { 153 | _subPaths[i] 154 | }*/ 155 | } 156 | 157 | Path4::Float4 Path4::evaluate(double time) const 158 | { 159 | return Path4::Float4(_subPaths[0].evaluate(time), 160 | _subPaths[1].evaluate(time), 161 | _subPaths[2].evaluate(time), 162 | _subPaths[3].evaluate(time)); 163 | } 164 | 165 | const Path& Path4::getSubPath(unsigned int index) const 166 | { 167 | assert(index < 4); 168 | return _subPaths[index]; 169 | } 170 | 171 | Path& Path4::getSubPath(unsigned int index) 172 | { 173 | assert(index < 4); 174 | return _subPaths[index]; 175 | } 176 | -------------------------------------------------------------------------------- /src/node-editor/common/Path.h: -------------------------------------------------------------------------------- 1 | #ifndef PATH_H 2 | #define PATH_H 3 | 4 | #include 5 | #include 6 | #include "Curve.h" 7 | 8 | enum PathType 9 | { 10 | EPT_CONSTANT, 11 | EPT_LINEAR, 12 | EPT_CUBIC, 13 | EPT_AKIMA, 14 | EPT_BESSEL, 15 | EPT_PCHIP, 16 | EPT_QUINTIC, 17 | }; 18 | 19 | /* 20 | class Spline 21 | { 22 | public: 23 | 24 | Spline(PathType type) 25 | { 26 | Urho3D::InterpolationMode LOOKUP_INTERPOLATION_MODE[] = 27 | { 28 | Urho3D::LINEAR_CURVE, 29 | Urho3D::LINEAR_CURVE, 30 | Urho3D::BEZIER_CURVE, 31 | Urho3D::LINEAR_CURVE, 32 | Urho3D::CATMULL_ROM_CURVE, 33 | Urho3D::CATMULL_ROM_FULL_CURVE 34 | }; 35 | 36 | Urho3D::InterpolationMode mode = LOOKUP_INTERPOLATION_MODE[EPT_LINEAR]; 37 | _spline.SetInterpolationMode(Urho3D::LINEAR_CURVE); 38 | } 39 | 40 | double eval(double d) 41 | { 42 | return _spline.GetPoint(d).GetDouble(); 43 | } 44 | 45 | void clear() 46 | { 47 | _spline.Clear(); 48 | } 49 | 50 | void build(double* times, double* values, size_t count) 51 | { 52 | Urho3D::Vector knots; 53 | for (int i=0; i < count; ++i) 54 | knots.Push(values[i]); 55 | 56 | _spline.Clear(); 57 | _spline.SetKnots(knots); 58 | } 59 | 60 | private: 61 | Urho3D::Spline _spline; 62 | };*/ 63 | 64 | 65 | class Spline 66 | { 67 | public: 68 | 69 | Spline(PathType type) : 70 | _spline(nullptr), 71 | _type(EPT_LINEAR) 72 | { 73 | 74 | } 75 | 76 | ~Spline() 77 | { 78 | if(_spline) 79 | delete _spline; 80 | } 81 | 82 | double eval(double d) 83 | { 84 | assert(_spline); 85 | 86 | float dst; 87 | _spline->evaluate(d, &dst); 88 | return dst; 89 | } 90 | 91 | void clear() 92 | { 93 | } 94 | 95 | void build(double* times, double* values, size_t count) 96 | { 97 | if(_spline) 98 | delete _spline; 99 | _spline = new Curve(count, 1); 100 | 101 | for (size_t i=0; i < count; ++i) 102 | { 103 | float keyValues = values[i]; 104 | _spline->setPoint(i, times[i], &keyValues, Curve::InterpolationType::LINEAR); 105 | } 106 | } 107 | 108 | private: 109 | Curve* _spline; 110 | PathType _type; 111 | }; 112 | 113 | 114 | 115 | enum PathLoopMode 116 | { 117 | ELM_LOOP, 118 | ELM_ZERO, 119 | ELM_LAST, 120 | }; 121 | 122 | struct PathKey 123 | { 124 | double time; 125 | double value; 126 | }; 127 | 128 | class Path 129 | { 130 | public: 131 | Path(PathType splineType = EPT_LINEAR, unsigned int keyCount = 0); 132 | ~Path(); 133 | 134 | void build(); 135 | double evaluate(double time) const; 136 | void addKey(double keyTime, double keyValue); 137 | void setAtIndex(unsigned index, double time, double value); 138 | void setLoopMode(PathLoopMode loopMode); 139 | void clear(); 140 | 141 | unsigned int getKeyCount() const; 142 | const PathKey getKeyByIndex(unsigned int index) const; 143 | double getStartTime() const; 144 | double getEndTime() const; 145 | 146 | private: 147 | void _insertKey(double keyTime, double keyValue); 148 | 149 | private: 150 | std::vector _times; 151 | std::vector _values; 152 | Spline* _spline; 153 | PathLoopMode _loopMode; 154 | }; 155 | 156 | 157 | 158 | class Path4 159 | { 160 | public: 161 | struct Float4 162 | { 163 | double x; 164 | double y; 165 | double z; 166 | double w; 167 | 168 | Float4(float x, float y, float z, float w); 169 | }; 170 | 171 | Path4(PathType splineType = EPT_LINEAR); 172 | Float4 evaluate(double time) const; 173 | const Path &getSubPath(unsigned int index) const; 174 | Path& getSubPath(unsigned int index); 175 | 176 | private: 177 | Path _subPaths[4]; 178 | }; 179 | 180 | class PathSampler 181 | { 182 | 183 | }; 184 | 185 | class Path4Sampler 186 | { 187 | 188 | }; 189 | 190 | #endif // PATH_H 191 | -------------------------------------------------------------------------------- /src/node-editor/common/TrackEdit.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "Trackedit.h" 5 | 6 | eTrackEdit::eTrackEdit(eF32 &flt, eF32 min, eF32 max, QWidget *parent) : QLineEdit(parent), 7 | m_curFlt(flt), 8 | m_refFlt(&flt), 9 | m_refInt(nullptr), 10 | m_refByte(nullptr), 11 | m_ctrlDown(eFALSE), 12 | m_shiftDown(eFALSE), 13 | m_valChanged(eFALSE) 14 | { 15 | QDoubleValidator *dv = new QDoubleValidator(min, max, 3, this); 16 | dv->setNotation(QDoubleValidator::StandardNotation); 17 | dv->setLocale(QLocale::C); 18 | setValidator(dv); 19 | setText(QString::number(m_curFlt, 'f', FLOAT_PRECISION)); 20 | connect(this, SIGNAL(textEdited(const QString &)), this, SLOT(_onTextEdited(const QString &))); 21 | m_timerId = startTimer(100); 22 | } 23 | 24 | eTrackEdit::eTrackEdit(eInt &intgr, eInt min, eInt max, QWidget *parent) : QLineEdit(parent), 25 | m_curInt(intgr), 26 | m_refFlt(nullptr), 27 | m_refInt(&intgr), 28 | m_refByte(nullptr), 29 | m_ctrlDown(eFALSE), 30 | m_shiftDown(eFALSE), 31 | m_valChanged(eFALSE) 32 | { 33 | setValidator(new QIntValidator(min, max, this)); 34 | setText(eIntToStr(m_curInt)); 35 | connect(this, SIGNAL(textEdited(const QString &)), this, SLOT(_onTextEdited(const QString &))); 36 | m_timerId = startTimer(100); 37 | } 38 | 39 | eTrackEdit::eTrackEdit(eU8 &byte, eU8 min, eU8 max, QWidget *parent) : QLineEdit(parent), 40 | m_curByte(byte), 41 | m_refFlt(nullptr), 42 | m_refInt(nullptr), 43 | m_refByte(&byte), 44 | m_ctrlDown(eFALSE), 45 | m_shiftDown(eFALSE), 46 | m_valChanged(eFALSE) 47 | { 48 | setValidator(new QIntValidator(min, max, this)); 49 | setText(eIntToStr(m_curByte)); 50 | connect(this, SIGNAL(textEdited(const QString &)), this, SLOT(_onTextEdited(const QString &))); 51 | m_timerId = startTimer(100); 52 | } 53 | 54 | eTrackEdit::~eTrackEdit() 55 | { 56 | killTimer(m_timerId); 57 | } 58 | 59 | void eTrackEdit::wheelEvent(QWheelEvent *we) 60 | { 61 | if (hasFocus()) 62 | { 63 | _changeValue(eSign(we->delta())); 64 | we->accept(); 65 | } 66 | else 67 | QLineEdit::wheelEvent(we); 68 | } 69 | 70 | void eTrackEdit::keyPressEvent(QKeyEvent *ke) 71 | { 72 | QLineEdit::keyPressEvent(ke); 73 | 74 | if (ke->key() == Qt::Key_Control) 75 | m_ctrlDown = eTRUE; 76 | else if (ke->key() == Qt::Key_Shift) 77 | m_shiftDown = eTRUE; 78 | } 79 | 80 | void eTrackEdit::keyReleaseEvent(QKeyEvent *ke) 81 | { 82 | QLineEdit::keyReleaseEvent(ke); 83 | m_ctrlDown = eFALSE; 84 | m_shiftDown = eFALSE; 85 | } 86 | 87 | void eTrackEdit::mouseMoveEvent(QMouseEvent *me) 88 | { 89 | //@@eFUNCDELAY(25U); 90 | 91 | QLineEdit::mouseMoveEvent(me); 92 | 93 | if (me->buttons()&Qt::RightButton) 94 | { 95 | const QPoint diff = me->pos()-m_mouseDownPos; 96 | 97 | if (eAbs(diff.x()) > 1 && _changeValue(diff.x()/2)) 98 | { 99 | QCursor::setPos(mapToGlobal(m_mouseDownPos)); 100 | m_valChanged = eTRUE; 101 | } 102 | } 103 | } 104 | 105 | void eTrackEdit::mousePressEvent(QMouseEvent *me) 106 | { 107 | m_mouseDownPos = me->pos(); 108 | setContextMenuPolicy(Qt::PreventContextMenu); 109 | QLineEdit::mousePressEvent(me); 110 | } 111 | 112 | void eTrackEdit::mouseReleaseEvent(QMouseEvent *me) 113 | { 114 | QLineEdit::mouseReleaseEvent(me); 115 | 116 | if (m_valChanged) 117 | m_valChanged = eFALSE; 118 | else if (me->button() == Qt::RightButton) 119 | { 120 | QContextMenuEvent ce(QContextMenuEvent::Mouse, me->pos()); 121 | setContextMenuPolicy(Qt::DefaultContextMenu); 122 | contextMenuEvent(&ce); 123 | } 124 | } 125 | 126 | void eTrackEdit::timerEvent(QTimerEvent *te) 127 | { 128 | QLineEdit::timerEvent(te); 129 | 130 | if (m_refFlt && !eAreFloatsEqual(m_curFlt, *m_refFlt)) 131 | { 132 | m_curFlt = *m_refFlt; 133 | setText(QString::number(m_curFlt, 'f', FLOAT_PRECISION)); 134 | } 135 | else if (m_refInt && m_curInt != *m_refInt) 136 | { 137 | m_curInt = *m_refInt; 138 | setText(eIntToStr(m_curInt)); 139 | } 140 | else if (m_refByte && m_curByte != *m_refByte) 141 | { 142 | m_curByte = *m_refByte; 143 | setText(eIntToStr(m_curByte)); 144 | } 145 | } 146 | 147 | void eTrackEdit::focusInEvent(QFocusEvent *fe) 148 | { 149 | QLineEdit::focusInEvent(fe); 150 | setFocusPolicy(Qt::WheelFocus); 151 | } 152 | 153 | void eTrackEdit::focusOutEvent(QFocusEvent *fe) 154 | { 155 | QLineEdit::focusOutEvent(fe); 156 | setFocusPolicy(Qt::StrongFocus); 157 | } 158 | 159 | void eTrackEdit::_onTextEdited(const QString &text) 160 | { 161 | if (hasAcceptableInput()) 162 | { 163 | if (m_refFlt) 164 | { 165 | m_curFlt = text.toFloat(); 166 | *m_refFlt = m_curFlt; 167 | } 168 | else if (m_refInt) 169 | { 170 | m_curInt = text.toInt(); 171 | *m_refInt = m_curInt; 172 | } 173 | else if (m_refByte) 174 | { 175 | m_curByte = text.toInt(); 176 | *m_refByte = m_curByte; 177 | } 178 | 179 | Q_EMIT onValueChanged(); 180 | } 181 | } 182 | 183 | eBool eTrackEdit::_changeValue(eF32 factor) 184 | { 185 | if (m_ctrlDown) // [control] => change slow (0.1x) 186 | factor *= 0.1f; 187 | else if (m_shiftDown) // [shift] => change fast (10x) 188 | factor *= 10.0f; 189 | 190 | // calculate new parameter value 191 | QString newText; 192 | eInt newInt = 0; 193 | eF32 newFloat = 0.0f; 194 | 195 | if (m_refFlt) 196 | { 197 | newFloat = m_curFlt+0.01f*factor; 198 | newText.setNum(newFloat, 'f', FLOAT_PRECISION); 199 | } 200 | else 201 | { 202 | // value to small for change? 203 | if (eAbs(factor) < 1.0f) 204 | return eFALSE; 205 | 206 | newInt = (m_refInt ? m_curInt : m_curByte)+(eInt)factor; 207 | newText.setNum(newInt); 208 | } 209 | 210 | // validate format and range 211 | eInt pos; 212 | if (validator()->validate(newText, pos) == QValidator::Acceptable) 213 | { 214 | if (m_refFlt) 215 | { 216 | m_curFlt = newFloat; 217 | *m_refFlt = newFloat; 218 | } 219 | else if (m_refInt) 220 | { 221 | m_curInt = newInt; 222 | *m_refInt = newInt; 223 | } 224 | else if (m_refByte) 225 | { 226 | m_curByte = newInt; 227 | *m_refByte = newInt; 228 | } 229 | 230 | setText(newText); 231 | } 232 | 233 | Q_EMIT textEdited(text()); 234 | return eTRUE; 235 | } 236 | 237 | -------------------------------------------------------------------------------- /src/node-editor/common/Trackedit.h: -------------------------------------------------------------------------------- 1 | #ifndef TRACK_EDIT_HPP 2 | #define TRACK_EDIT_HPP 3 | #pragma once 4 | 5 | #include 6 | #include "Types.h" 7 | 8 | // basic track edit for floats, integer, and bytes 9 | class eTrackEdit : public QLineEdit 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | eTrackEdit(eF32 &flt, eF32 min, eF32 max, QWidget *parent); 15 | eTrackEdit(eInt &intgr, eInt min, eInt max, QWidget *parent); 16 | eTrackEdit(eU8 &byte, eU8 min, eU8 max, QWidget *parent); 17 | virtual ~eTrackEdit(); 18 | 19 | virtual void wheelEvent(QWheelEvent *we); 20 | virtual void keyPressEvent(QKeyEvent *ke); 21 | virtual void keyReleaseEvent(QKeyEvent *ke); 22 | virtual void mouseMoveEvent(QMouseEvent *me); 23 | virtual void mousePressEvent(QMouseEvent *me); 24 | virtual void mouseReleaseEvent(QMouseEvent *me); 25 | virtual void timerEvent(QTimerEvent *te); 26 | virtual void focusInEvent(QFocusEvent *fe); 27 | virtual void focusOutEvent(QFocusEvent *fe); 28 | 29 | Q_SIGNALS: 30 | void onValueChanged(); 31 | 32 | private Q_SLOTS: 33 | void _onTextEdited(const QString &text); 34 | 35 | private: 36 | eBool _changeValue(eF32 factor); 37 | 38 | public: 39 | static const eInt FLOAT_PRECISION = 2; 40 | 41 | private: 42 | eF32 m_curFlt; 43 | eInt m_curInt; 44 | eU8 m_curByte; 45 | eF32 * m_refFlt; 46 | eInt * m_refInt; 47 | eU8 * m_refByte; 48 | eBool m_ctrlDown; 49 | eBool m_shiftDown; 50 | eBool m_valChanged; 51 | QPoint m_mouseDownPos; 52 | eInt m_timerId; 53 | }; 54 | 55 | #endif // TRACK_EDIT_HPP 56 | -------------------------------------------------------------------------------- /src/node-editor/common/Types.cpp: -------------------------------------------------------------------------------- 1 | #include "Types.h" 2 | #include 3 | 4 | eF32 eAbs(eF32 x) 5 | { 6 | return fabsf(x); 7 | } 8 | 9 | eU32 eAbs(eInt x) 10 | { 11 | return ((x^(x>>31))-(x>>31)); 12 | } 13 | 14 | eChar * eIntToStr(eInt val) 15 | { 16 | // remember if integer is negative and 17 | // if it is, make it positive 18 | const eBool negative = (val < 0); 19 | 20 | if (negative) 21 | val = -val; 22 | 23 | // 12 spaces are enough for 32-bit decimal 24 | // (10 digits + 1 null terminator byte + 25 | // eventually a sign character) 26 | static eChar str[12]; 27 | 28 | eChar *cp = str+sizeof(str)-1; 29 | *cp = '\0'; 30 | 31 | do 32 | { 33 | *(--cp) = val%10+'0'; 34 | val /= 10; 35 | } 36 | while (val > 0); 37 | 38 | // prepend negative sign character 39 | if (negative) 40 | *(--cp) = '-'; 41 | 42 | return cp; 43 | } 44 | 45 | eU32 eSignBit(eF32 x) 46 | { 47 | return (eU32 &)x&0x80000000; 48 | } 49 | 50 | eF32 eSign(eF32 x) 51 | { 52 | // test exponent and mantissa bits: is input zero? 53 | if (((eInt &)x&0x7fffffff) == 0) 54 | return 0.0f; 55 | 56 | // mask sign bit in x, set it in r if necessary 57 | eF32 r = 1.0f; 58 | (eInt &)r |= eSignBit(x); 59 | return r; 60 | } 61 | 62 | eInt eSign(eInt x) 63 | { 64 | return (x != 0)|(x>>(sizeof(eInt)*8-1)); 65 | } 66 | 67 | eBool eIsFloatZero(eF32 x) 68 | { 69 | return (eAbs(x) < eALMOST_ZERO); 70 | } 71 | 72 | eBool eAreFloatsEqual(eF32 x, eF32 y) 73 | { 74 | return eIsFloatZero(x-y); 75 | } 76 | 77 | eBool eMemEqual(eConstPtr mem0, eConstPtr mem1, size_t count) 78 | { 79 | return !memcmp(mem0, mem1, count); 80 | } 81 | 82 | // faster float to long conversion than c-lib's 83 | // default version. must be called explicitly. 84 | #include 85 | eInt eFtoL(eF32 x) 86 | { 87 | return _mm_cvt_ss2si(_mm_load_ss(&x)); 88 | //return (eInt)(x+0.001) / 1L; 89 | //return (eInt)x; 90 | } 91 | -------------------------------------------------------------------------------- /src/node-editor/common/Types.h: -------------------------------------------------------------------------------- 1 | #ifndef TYPES_H 2 | #define TYPES_H 3 | 4 | #include 5 | 6 | typedef unsigned char eU8; 7 | typedef signed char eS8; 8 | typedef unsigned short eU16; 9 | typedef short eS16; 10 | typedef unsigned int eU32; 11 | typedef int eS32; 12 | typedef float eF32; 13 | typedef double eF64; 14 | typedef int eInt; 15 | typedef char eChar; 16 | typedef signed char eBool; 17 | typedef void * ePtr; 18 | typedef const void * eConstPtr; 19 | typedef eU32 eID; 20 | 21 | #define eU32_MAX (0xffffffffU) 22 | #define eS32_MIN (-2147483647-1) 23 | #define eS32_MAX (2147483647) 24 | #define eU16_MAX (0xffffU) 25 | #define eS16_MIN (-32768) 26 | #define eS16_MAX (32767) 27 | #define eU8_MAX (0xffU) 28 | #define eS8_MIN (-128) 29 | #define eS8_MAX (127) 30 | #define eF32_MAX (3.402823466e+38F) 31 | #define eF32_MIN (-eF32_MAX) 32 | #define eF32_INF (1e30f) 33 | #define eTRUE (eBool)(!0) 34 | #define eFALSE 0 35 | #define eNOID 0 36 | 37 | #define eSQRT2 1.41421356237f 38 | #define ePI 3.1415926535897932384626433832795f 39 | #define eTWOPI (ePI*2.0f) 40 | #define eHALFPI (ePI*0.5f) 41 | #define eSQRPI (ePI*ePI) 42 | #define eINVHALFPI (1.0f/eHALFPI) 43 | #define eEXPONE 2.718281828459f 44 | #define eALMOST_ZERO 0.00001f 45 | #define eMAX_RAND 2147483647 46 | #define eMAX_NAME_LEN 64 47 | #define eMAX_PATH_LEN 256 48 | #define e360 360.0f 49 | 50 | 51 | #define eASSERT(X) assert(X) 52 | 53 | 54 | // fake type during code integration; to delete after 55 | typedef void* eIOperator; 56 | #include 57 | #include 58 | typedef QString eString; 59 | 60 | 61 | eF32 eAbs(eF32 x); 62 | eU32 eAbs(eInt x); 63 | eInt eFtoL(eF32 x); 64 | eChar* eIntToStr(eInt val); 65 | eU32 eSignBit(eF32 x); 66 | eF32 eSign(eF32 x); 67 | eInt eSign(eInt x); 68 | eBool eAreFloatsEqual(eF32 x, eF32 y); 69 | eBool eIsFloatZero(eF32 x); 70 | eBool eMemEqual(eConstPtr mem0,eConstPtr mem1, size_t count); 71 | 72 | 73 | 74 | template T eMin(const T &a, const T &b) 75 | { 76 | return (a < b) ? a : b; 77 | } 78 | 79 | template T eMax(const T &a, const T &b) 80 | { 81 | return (a > b) ? a : b; 82 | } 83 | 84 | template T eClamp(const T &min, const T &x, const T &max) 85 | { 86 | if (x < min) 87 | return min; 88 | else if (x > max) 89 | return max; 90 | else 91 | return x; 92 | } 93 | 94 | template inline T zLerp(const T &a, const T &b, T t) 95 | { 96 | return (1-t)*a + t*b; 97 | } 98 | 99 | template T eLerp(const T &a, const T &b, eF32 t) 100 | { 101 | return a+(b-a)*t; 102 | } 103 | 104 | template void eSetBit(T &t, eU32 index) 105 | { 106 | eASSERT(index < sizeof(T)*8); 107 | t |= (1< void eSetBit(T &t, eU32 index, eBool set) 111 | { 112 | eASSERT(set == 0 || set == 1); 113 | 114 | eASSERT(index void eClearBit(T &t, eU32 index) 119 | { 120 | eASSERT(index < sizeof(T)*8); 121 | t &= ~(1< eBool eGetBit(T t, eU32 index) 125 | { 126 | eASSERT(index < sizeof(T)*8); 127 | return ((t&(1< void eToggleBit(T &t, eU32 index) 131 | { 132 | eASSERT(index < sizeof(T)*8); 133 | t ^= (1< 142 | class eXY 143 | { 144 | public: 145 | struct 146 | { 147 | T x; 148 | T y; 149 | }; 150 | 151 | eXY() {} 152 | eXY(T x, T y) : x(x), y(y) {} 153 | }; 154 | 155 | 156 | template 157 | class eXYZ 158 | { 159 | public: 160 | struct 161 | { 162 | T x; 163 | T y; 164 | T z; 165 | }; 166 | 167 | eXYZ() {} 168 | eXYZ(T x, T y, T z) : x(x), y(y), z(z) {} 169 | }; 170 | 171 | 172 | template 173 | class eXYZW 174 | { 175 | public: 176 | struct 177 | { 178 | T x; 179 | T y; 180 | T z; 181 | T w; 182 | }; 183 | 184 | eXYZW() {} 185 | eXYZW(T x, T y, T z, T w) : x(x), y(y), z(z), w(w) {} 186 | }; 187 | 188 | typedef eXY eFXY; 189 | typedef eXYZ eFXYZ; 190 | typedef eXYZW eFXYZW; 191 | typedef eXY eIXY; 192 | typedef eXYZ eIXYZ; 193 | typedef eXYZW eIXYZW; 194 | 195 | 196 | #endif // TYPES_H 197 | -------------------------------------------------------------------------------- /src/node-editor/spark-nodes/SparkNodeRender.h: -------------------------------------------------------------------------------- 1 | #ifndef SPKRENDERER_H 2 | #define SPKRENDERER_H 3 | 4 | #include "../../urho/BaseRenderer.h" 5 | #include 6 | 7 | #include 8 | 9 | class SparkNodeRender : public BaseRenderer3D 10 | { 11 | public: 12 | SparkNodeRender(); 13 | void setCurentParticleSystem(SPK::Ref sparkSystem); 14 | 15 | private: 16 | void handleUpdate(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData); 17 | 18 | Urho3D::SharedPtr _sparkNode; 19 | }; 20 | 21 | #endif // SPKRENDERER_H 22 | -------------------------------------------------------------------------------- /src/node-editor/spark-nodes/SparkNodesRegistry.cpp: -------------------------------------------------------------------------------- 1 | #include "spark-nodes.h" 2 | 3 | std::shared_ptr registerSparkNodesDataModels() 4 | { 5 | auto ret = std::make_shared(); 6 | 7 | ret->registerModel("test"); 8 | 9 | ret->registerModel("zones"); 10 | ret->registerModel("zones"); 11 | ret->registerModel("zones"); 12 | ret->registerModel("zones"); 13 | ret->registerModel("zones"); 14 | ret->registerModel("zones"); 15 | 16 | ret->registerModel("system"); 17 | ret->registerModel("system"); 18 | ret->registerModel("system"); 19 | ret->registerModel("renderer"); 20 | 21 | ret->registerModel("emitters"); 22 | ret->registerModel("emitters"); 23 | ret->registerModel("emitters"); 24 | ret->registerModel("emitters"); 25 | ret->registerModel("emitters"); 26 | ret->registerModel("emitters"); 27 | 28 | ret->registerModel("modifiers"); 29 | ret->registerModel("modifiers"); 30 | ret->registerModel("modifiers"); 31 | ret->registerModel("modifiers"); 32 | ret->registerModel("modifiers"); 33 | ret->registerModel("modifiers"); 34 | ret->registerModel("modifiers"); 35 | ret->registerModel("modifiers"); 36 | ret->registerModel("modifiers"); 37 | ret->registerModel("modifiers"); 38 | ret->registerModel("modifiers"); 39 | ret->registerModel("modifiers"); 40 | 41 | ret->registerModel("interpolators"); 42 | ret->registerModel("interpolators"); 43 | 44 | ret->registerModel("interpolators"); 45 | ret->registerModel("interpolators"); 46 | ret->registerModel("interpolators"); 47 | ret->registerModel("interpolators"); 48 | ret->registerModel("interpolators"); 49 | 50 | ret->registerModel("interpolators"); 51 | ret->registerModel("interpolators"); 52 | ret->registerModel("interpolators"); 53 | ret->registerModel("interpolators"); 54 | ret->registerModel("interpolators"); 55 | ret->registerModel("interpolators"); 56 | 57 | return ret; 58 | } 59 | -------------------------------------------------------------------------------- /src/node-editor/spark-nodes/SparkNodesRegistry.h: -------------------------------------------------------------------------------- 1 | #ifndef SPARKNODESREGISTRY_H 2 | #define SPARKNODESREGISTRY_H 3 | 4 | #include 5 | using QtNodes::DataModelRegistry; 6 | 7 | std::shared_ptr registerSparkNodesDataModels(); 8 | 9 | 10 | #endif // SPARKNODESREGISTRY_H 11 | -------------------------------------------------------------------------------- /src/node-editor/spark-nodes/SpkEmitters.h: -------------------------------------------------------------------------------- 1 | #ifndef SPKEMITTERS_H 2 | #define SPKEMITTERS_H 3 | 4 | #include "../common/BaseNode.h" 5 | 6 | //------------------------------------------------------------------------------------------------------------------------------ 7 | // base spark emitter class 8 | //------------------------------------------------------------------------------------------------------------------------------ 9 | class NodeSparkEmitterBase : public NodeSparkBaseNode 10 | { 11 | protected: 12 | void createBaseEmitterParams(eString name, bool shared = false); 13 | void setBaseEmitterParams(SPK::Ref emitter); 14 | void setResult(SPK::Ref emitter); 15 | 16 | std::vector> _emitters; 17 | }; 18 | 19 | //------------------------------------------------------------------------------------------------------------------------------ 20 | // emitters list node 21 | //------------------------------------------------------------------------------------------------------------------------------ 22 | class NodeSparkEmitterList : public BaseNode 23 | { 24 | private: 25 | std::vector> _emitters; 26 | const QString Name() const override { return QString("Emitters"); } 27 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_emitters); } 28 | void process() override; 29 | public: 30 | NodeSparkEmitterList(); 31 | }; 32 | 33 | //------------------------------------------------------------------------------------------------------------------------------ 34 | // static emitter node 35 | //------------------------------------------------------------------------------------------------------------------------------ 36 | class NodeSparkEmitterStatic : public NodeSparkEmitterBase 37 | { 38 | private: 39 | const QString Name() const override { return QString("StaticEmitter"); } 40 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_emitters); } 41 | void process() override; 42 | public: 43 | NodeSparkEmitterStatic(); 44 | }; 45 | 46 | //------------------------------------------------------------------------------------------------------------------------------ 47 | // spheric emitter node 48 | //------------------------------------------------------------------------------------------------------------------------------ 49 | class NodeSparkEmitterSpheric : public NodeSparkEmitterBase 50 | { 51 | private: 52 | const QString Name() const override { return QString("SphericEmitter"); } 53 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_emitters); } 54 | void process() override; 55 | public: 56 | NodeSparkEmitterSpheric(); 57 | }; 58 | 59 | 60 | //------------------------------------------------------------------------------------------------------------------------------ 61 | // random emitter node 62 | //------------------------------------------------------------------------------------------------------------------------------ 63 | class NodeSparkEmitterRandom : public NodeSparkEmitterBase 64 | { 65 | private: 66 | const QString Name() const override { return QString("RandomEmitter"); } 67 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_emitters); } 68 | void process() override; 69 | public: 70 | NodeSparkEmitterRandom(); 71 | }; 72 | 73 | 74 | //------------------------------------------------------------------------------------------------------------------------------ 75 | // straight emitter node 76 | //------------------------------------------------------------------------------------------------------------------------------ 77 | class NodeSparkEmitterStraight : public NodeSparkEmitterBase 78 | { 79 | private: 80 | const QString Name() const override { return QString("StraightEmitter"); } 81 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_emitters); } 82 | void process() override; 83 | public: 84 | NodeSparkEmitterStraight(); 85 | }; 86 | 87 | 88 | //------------------------------------------------------------------------------------------------------------------------------ 89 | // normal emitter node 90 | //------------------------------------------------------------------------------------------------------------------------------ 91 | class NodeSparkEmitterNormal : public NodeSparkEmitterBase 92 | { 93 | private: 94 | const QString Name() const override { return QString("NormalEmitter"); } 95 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_emitters); } 96 | void process() override; 97 | public: 98 | NodeSparkEmitterNormal(); 99 | }; 100 | 101 | 102 | #endif // SPKEMITTERS_H 103 | -------------------------------------------------------------------------------- /src/node-editor/spark-nodes/SpkModifiers.h: -------------------------------------------------------------------------------- 1 | #ifndef SPKMODIFIERS_H 2 | #define SPKMODIFIERS_H 3 | 4 | #include "../common/BaseNode.h" 5 | 6 | //------------------------------------------------------------------------------------------------------------------------------ 7 | // base spark modifier class 8 | //------------------------------------------------------------------------------------------------------------------------------ 9 | class NodeSparkModifierBase : public NodeSparkBaseNode 10 | { 11 | protected: 12 | void createBaseModifierParams(eString name, bool shared = false); 13 | void setBaseModifierParams(SPK::Ref modifier); 14 | void setResult(SPK::Ref modifier); 15 | 16 | std::vector> _modifiers; 17 | }; 18 | 19 | //------------------------------------------------------------------------------------------------------------------------------ 20 | // modifiers list node 21 | //------------------------------------------------------------------------------------------------------------------------------ 22 | class NodeSparkModifierList : public BaseNode 23 | { 24 | private: 25 | std::vector> _modifiers; 26 | const QString Name() const override { return QString("Modifiers"); } 27 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_modifiers); } 28 | void process() override; 29 | public: 30 | NodeSparkModifierList(); 31 | }; 32 | 33 | 34 | //------------------------------------------------------------------------------------------------------------------------------ 35 | // gravity modifier node 36 | //------------------------------------------------------------------------------------------------------------------------------ 37 | class NodeSparkModifierGravity : public NodeSparkModifierBase 38 | { 39 | private: 40 | const QString Name() const override { return QString("Gravity"); } 41 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_modifiers); } 42 | void process() override; 43 | public: 44 | NodeSparkModifierGravity(); 45 | }; 46 | 47 | 48 | //------------------------------------------------------------------------------------------------------------------------------ 49 | // friction modifier node 50 | //------------------------------------------------------------------------------------------------------------------------------ 51 | class NodeSparkModifierFriction : public NodeSparkModifierBase 52 | { 53 | private: 54 | const QString Name() const override { return QString("Friction"); } 55 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_modifiers); } 56 | void process() override; 57 | public: 58 | NodeSparkModifierFriction(); 59 | }; 60 | 61 | 62 | //------------------------------------------------------------------------------------------------------------------------------ 63 | // collider modifier node 64 | //------------------------------------------------------------------------------------------------------------------------------ 65 | class NodeSparkModifierCollider : public NodeSparkModifierBase 66 | { 67 | private: 68 | const QString Name() const override { return QString("Collider"); } 69 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_modifiers); } 70 | void process() override; 71 | public: 72 | NodeSparkModifierCollider(); 73 | }; 74 | 75 | 76 | //------------------------------------------------------------------------------------------------------------------------------ 77 | // destroyer modifier node 78 | //------------------------------------------------------------------------------------------------------------------------------ 79 | class NodeSparkModifierDestroyer : public NodeSparkModifierBase 80 | { 81 | private: 82 | const QString Name() const override { return QString("Destroyer"); } 83 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_modifiers); } 84 | void process() override; 85 | public: 86 | NodeSparkModifierDestroyer(); 87 | }; 88 | 89 | 90 | //------------------------------------------------------------------------------------------------------------------------------ 91 | // obstacle modifier node 92 | //------------------------------------------------------------------------------------------------------------------------------ 93 | class NodeSparkModifierObstacle : public NodeSparkModifierBase 94 | { 95 | private: 96 | const QString Name() const override { return QString("Obstacle"); } 97 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_modifiers); } 98 | void process() override; 99 | public: 100 | NodeSparkModifierObstacle(); 101 | }; 102 | 103 | 104 | //------------------------------------------------------------------------------------------------------------------------------ 105 | // pointmass modifier node 106 | //------------------------------------------------------------------------------------------------------------------------------ 107 | class NodeSparkModifierPointMass : public NodeSparkModifierBase 108 | { 109 | private: 110 | const QString Name() const override { return QString("PointMass"); } 111 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_modifiers); } 112 | void process() override; 113 | public: 114 | NodeSparkModifierPointMass(); 115 | }; 116 | 117 | 118 | //------------------------------------------------------------------------------------------------------------------------------ 119 | // random force modifier node 120 | //------------------------------------------------------------------------------------------------------------------------------ 121 | class NodeSparkModifierRandomForce : public NodeSparkModifierBase 122 | { 123 | private: 124 | const QString Name() const override { return QString("RandomForce"); } 125 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_modifiers); } 126 | void process() override; 127 | public: 128 | NodeSparkModifierRandomForce(); 129 | }; 130 | 131 | 132 | //------------------------------------------------------------------------------------------------------------------------------ 133 | // rotator modifier node 134 | //------------------------------------------------------------------------------------------------------------------------------ 135 | class NodeSparkModifierRotator : public NodeSparkModifierBase 136 | { 137 | private: 138 | const QString Name() const override { return QString("Rotator"); } 139 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_modifiers); } 140 | void process() override; 141 | public: 142 | NodeSparkModifierRotator(); 143 | }; 144 | 145 | 146 | //------------------------------------------------------------------------------------------------------------------------------ 147 | // vortex modifier node 148 | //------------------------------------------------------------------------------------------------------------------------------ 149 | class NodeSparkModifierVortex : public NodeSparkModifierBase 150 | { 151 | private: 152 | const QString Name() const override { return QString("Vortex"); } 153 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_modifiers); } 154 | void process() override; 155 | public: 156 | NodeSparkModifierVortex(); 157 | }; 158 | 159 | 160 | //------------------------------------------------------------------------------------------------------------------------------ 161 | // emitterAttacher modifier node 162 | //------------------------------------------------------------------------------------------------------------------------------ 163 | class NodeSparkModifierEmitterAttacher : public NodeSparkModifierBase 164 | { 165 | private: 166 | const QString Name() const override { return QString("EmitterAttacher"); } 167 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_modifiers); } 168 | void process() override; 169 | public: 170 | NodeSparkModifierEmitterAttacher(); 171 | }; 172 | 173 | 174 | //------------------------------------------------------------------------------------------------------------------------------ 175 | // linearForce modifier node 176 | //------------------------------------------------------------------------------------------------------------------------------ 177 | class NodeSparkModifierLinearForce : public NodeSparkModifierBase 178 | { 179 | private: 180 | const QString Name() const override { return QString("LinearForce"); } 181 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_modifiers); } 182 | void process() override; 183 | public: 184 | NodeSparkModifierLinearForce(); 185 | }; 186 | #endif // SPKMODIFIERS_H 187 | -------------------------------------------------------------------------------- /src/node-editor/spark-nodes/SpkSystem.h: -------------------------------------------------------------------------------- 1 | #ifndef SPKSYSTEMNODE_H 2 | #define SPKSYSTEMNODE_H 3 | 4 | #include "../common/BaseNode.h" 5 | 6 | //------------------------------------------------------------------------------------------------------------------------------ 7 | // group list 8 | //------------------------------------------------------------------------------------------------------------------------------ 9 | class NodeSparkGroupList : public BaseNode 10 | { 11 | private: 12 | std::vector> _groups; 13 | const QString Name() const override { return QString("Groups"); } 14 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_groups); } 15 | void process() override; 16 | public: 17 | NodeSparkGroupList(); 18 | }; 19 | 20 | //------------------------------------------------------------------------------------------------------------------------------ 21 | // group 22 | //------------------------------------------------------------------------------------------------------------------------------ 23 | class NodeSparkGroup : public NodeSparkBaseNode 24 | { 25 | private: 26 | std::vector> _groups; 27 | const QString Name() const override { return QString("Group"); } 28 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_groups); } 29 | void process() override; 30 | public: 31 | NodeSparkGroup(); 32 | }; 33 | 34 | //------------------------------------------------------------------------------------------------------------------------------ 35 | // system 36 | //------------------------------------------------------------------------------------------------------------------------------ 37 | class NodeSparkSystem : public BaseNode 38 | { 39 | private: 40 | SPK::Ref _system; 41 | const QString Name() const override { return QString("System"); } 42 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_system); } 43 | void process() override; 44 | void onParameterChanged(); 45 | public: 46 | NodeSparkSystem(); 47 | SPK::Ref getResult() { return _system; } 48 | 49 | private Q_SLOTS: 50 | void onExportButtonClick(); 51 | }; 52 | 53 | //------------------------------------------------------------------------------------------------------------------------------ 54 | // quad renderer 55 | //------------------------------------------------------------------------------------------------------------------------------ 56 | class NodeSparkQuadRenderer : public NodeSparkBaseNode 57 | { 58 | private: 59 | SPK::Ref _renderer; 60 | const QString Name() const override { return QString("QuadRenderer"); } 61 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_renderer); } 62 | void process() override; 63 | public: 64 | NodeSparkQuadRenderer(); 65 | }; 66 | 67 | //------------------------------------------------------------------------------------------------------------------------------ 68 | // test node 69 | //------------------------------------------------------------------------------------------------------------------------------ 70 | class NodeSparkTest : public NodeSparkBaseNode 71 | { 72 | private: 73 | SPK::Ref _renderer; 74 | const QString Name() const override { return QString("Test"); } 75 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_renderer); } 76 | void process() override; 77 | public: 78 | NodeSparkTest(); 79 | 80 | private Q_SLOTS: 81 | void onTestButtonClick(); 82 | }; 83 | 84 | #endif // SPKSYSTEMNODE_H 85 | -------------------------------------------------------------------------------- /src/node-editor/spark-nodes/SpkUtils.cpp: -------------------------------------------------------------------------------- 1 | #include "SpkUtils.h" 2 | 3 | 4 | SPK::Vector3D ToSpkVector3D(const eFXYZ& v) 5 | { 6 | return SPK::Vector3D(v.x, v.y, v.z); 7 | } 8 | 9 | Urho3D::Vector3 ToUrhoVector3(const SPK::Vector3D& v) 10 | { 11 | return Urho3D::Vector3(v.x, v.y, v.z); 12 | } 13 | 14 | SPK::Color ToSpkColor(const eColor& c) 15 | { 16 | return SPK::Color(c.r, c.g, c.b, c.a); 17 | } 18 | -------------------------------------------------------------------------------- /src/node-editor/spark-nodes/SpkUtils.h: -------------------------------------------------------------------------------- 1 | #ifndef SPKUTILS_H 2 | #define SPKUTILS_H 3 | 4 | #include 5 | #include 6 | #include "../../node-editor/common/Types.h" 7 | #include "../../node-editor/common/Color.h" 8 | 9 | //---------------------------------------------------------------------------------------------- 10 | // Conversion functions for spark 11 | //---------------------------------------------------------------------------------------------- 12 | 13 | SPK::Vector3D ToSpkVector3D(const eFXYZ& v); 14 | Urho3D::Vector3 ToUrhoVector3(const SPK::Vector3D& v); 15 | SPK::Color ToSpkColor(const eColor& c); 16 | 17 | #endif // SPKUTILS_H 18 | -------------------------------------------------------------------------------- /src/node-editor/spark-nodes/SpkZones.cpp: -------------------------------------------------------------------------------- 1 | #include "SpkZones.h" 2 | 3 | //-------------------------------------------------------------------------------------------- 4 | // base spark zone 5 | //-------------------------------------------------------------------------------------------- 6 | 7 | void NodeSparkZoneBase::createBaseZoneParams(eString name, bool shared) 8 | { 9 | // create base SPKObject parameters 10 | createBaseObjectParams(name,shared); 11 | 12 | // create base Zone parameters 13 | PARAM_FXYZ("Position", eF32_MIN, eF32_MAX, 0.0f, 0.0f, 0.0f); 14 | } 15 | 16 | void NodeSparkZoneBase::setBaseZoneParams(SPK::Ref zone) 17 | { 18 | if(zone) 19 | { 20 | // get parameters 21 | SPK::Vector3D position = ToSpkVector3D(getParameter("Position")->getValueAsFXYZ()); 22 | 23 | // set zone parameters 24 | zone->setPosition(position); 25 | 26 | // set base SPKObject parameters 27 | setBaseObjectParams(zone); 28 | } 29 | } 30 | 31 | void NodeSparkZoneBase::setResult(SPK::Ref zone) 32 | { 33 | _zone.reset(); 34 | _zone = zone; 35 | } 36 | 37 | 38 | //------------------------------------------------------------------------------------------------------------------------------ 39 | // zone point node 40 | //------------------------------------------------------------------------------------------------------------------------------ 41 | 42 | NodeSparkZonePoint::NodeSparkZonePoint() 43 | { 44 | OUT_PORT(ENC_ZONE, "zone"); 45 | 46 | createBaseZoneParams("PointZone"); 47 | } 48 | 49 | void NodeSparkZonePoint::process() 50 | { 51 | SPK::Ref zonePoint = SPK::Point::create(); 52 | setBaseZoneParams(zonePoint); 53 | setResult(zonePoint); 54 | } 55 | 56 | 57 | //------------------------------------------------------------------------------------------------------------------------------ 58 | // plane zone node 59 | //------------------------------------------------------------------------------------------------------------------------------ 60 | 61 | NodeSparkZonePlane::NodeSparkZonePlane() 62 | { 63 | OUT_PORT(ENC_ZONE, "zone"); 64 | 65 | createBaseZoneParams("PlaneZone"); 66 | PARAM_FXYZ("Normal", eF32_MIN, eF32_MAX, 0.0f, 1.0f, 0.0f); 67 | } 68 | 69 | void NodeSparkZonePlane::process() 70 | { 71 | SPK::Vector3D normal = ToSpkVector3D(getParameter("Normal")->getValueAsFXYZ()); 72 | 73 | SPK::Ref zonePlane = SPK::Plane::create(); 74 | zonePlane->setNormal(normal); 75 | setBaseZoneParams(zonePlane); 76 | setResult(zonePlane); 77 | } 78 | 79 | 80 | //------------------------------------------------------------------------------------------------------------------------------ 81 | // sphere zone node 82 | //------------------------------------------------------------------------------------------------------------------------------ 83 | 84 | NodeSparkZoneSphere::NodeSparkZoneSphere() 85 | { 86 | OUT_PORT(ENC_ZONE, "zone"); 87 | 88 | createBaseZoneParams("SphereZone"); 89 | PARAM_FLOAT("Radius", 0.0f, eF32_MAX, 1.0f); 90 | } 91 | 92 | void NodeSparkZoneSphere::process() 93 | { 94 | float radius = getParameter("Radius")->getValueAsFloat(); 95 | 96 | SPK::Ref zoneSphere = SPK::Sphere::create(); 97 | zoneSphere->setRadius(radius); 98 | setBaseZoneParams(zoneSphere); 99 | setResult(zoneSphere); 100 | } 101 | 102 | 103 | //------------------------------------------------------------------------------------------------------------------------------ 104 | // box zone node 105 | //------------------------------------------------------------------------------------------------------------------------------ 106 | 107 | NodeSparkZoneBox::NodeSparkZoneBox() 108 | { 109 | OUT_PORT(ENC_ZONE, "zone"); 110 | 111 | createBaseZoneParams("BoxZone"); 112 | PARAM_FXYZ("Dimensions", eF32_MIN, eF32_MAX, 1.0f, 1.0f, 1.0f); 113 | PARAM_FXYZ("Front", eF32_MIN, eF32_MAX, 0.0f, 0.0f, 1.0f); 114 | PARAM_FXYZ("Up", eF32_MIN, eF32_MAX, 0.0f, 1.0f, 0.0f); 115 | } 116 | 117 | void NodeSparkZoneBox::process() 118 | { 119 | SPK::Vector3D dimensions = ToSpkVector3D(getParameter("Dimensions")->getValueAsFXYZ()); 120 | SPK::Vector3D front = ToSpkVector3D(getParameter("Front")->getValueAsFXYZ()); 121 | SPK::Vector3D up = ToSpkVector3D(getParameter("Up")->getValueAsFXYZ()); 122 | 123 | SPK::Ref zoneBox = SPK::Box::create(); 124 | zoneBox->setDimensions(dimensions); 125 | zoneBox->setAxis(front, up); 126 | setBaseZoneParams(zoneBox); 127 | setResult(zoneBox); 128 | } 129 | 130 | 131 | //------------------------------------------------------------------------------------------------------------------------------ 132 | // cylinder zone node 133 | //------------------------------------------------------------------------------------------------------------------------------ 134 | 135 | NodeSparkZoneCylinder::NodeSparkZoneCylinder() 136 | { 137 | OUT_PORT(ENC_ZONE, "zone"); 138 | 139 | createBaseZoneParams("CylinderZone"); 140 | PARAM_FLOAT("Height", 0.0f, eF32_MAX, 1.0f); 141 | PARAM_FLOAT("Radius", 0.0f, eF32_MAX, 1.0f); 142 | PARAM_FXYZ("Axis", eF32_MIN, eF32_MAX, 0.0f, 1.0f, 0.0f); 143 | } 144 | 145 | void NodeSparkZoneCylinder::process() 146 | { 147 | float height = getParameter("Height")->getValueAsFloat(); 148 | float radius = getParameter("Radius")->getValueAsFloat(); 149 | SPK::Vector3D axis = ToSpkVector3D(getParameter("Axis")->getValueAsFXYZ()); 150 | 151 | SPK::Ref zoneCylinder = SPK::Cylinder::create(); 152 | zoneCylinder->setDimensions(height, radius); 153 | zoneCylinder->setAxis(axis); 154 | setBaseZoneParams(zoneCylinder); 155 | setResult(zoneCylinder); 156 | } 157 | 158 | 159 | //------------------------------------------------------------------------------------------------------------------------------ 160 | // ring zone node 161 | //------------------------------------------------------------------------------------------------------------------------------ 162 | 163 | NodeSparkZoneRing::NodeSparkZoneRing() 164 | { 165 | OUT_PORT(ENC_ZONE, "zone"); 166 | 167 | createBaseZoneParams("RingZone"); 168 | PARAM_FXY("Radius", 0.0f, eF32_MAX, 0.0f, 1.0f); 169 | PARAM_FXYZ("Normal", eF32_MIN, eF32_MAX, 0.0f, 1.0f, 0.0f); 170 | } 171 | 172 | void NodeSparkZoneRing::process() 173 | { 174 | eFXY radius = getParameter("Radius")->getValueAsFXY(); 175 | SPK::Vector3D normal = ToSpkVector3D(getParameter("Normal")->getValueAsFXYZ()); 176 | 177 | SPK::Ref zoneRing = SPK::Ring::create(); 178 | zoneRing->setNormal(normal); 179 | zoneRing->setRadius(radius.x, radius.y); 180 | setBaseZoneParams(zoneRing); 181 | setResult(zoneRing); 182 | } 183 | -------------------------------------------------------------------------------- /src/node-editor/spark-nodes/SpkZones.h: -------------------------------------------------------------------------------- 1 | #ifndef ZONENODE_H 2 | #define ZONENODE_H 3 | 4 | #include "../common/BaseNode.h" 5 | 6 | //------------------------------------------------------------------------------------------------------------------------------ 7 | // base spark zone class 8 | //------------------------------------------------------------------------------------------------------------------------------ 9 | class NodeSparkZoneBase : public NodeSparkBaseNode 10 | { 11 | protected: 12 | void createBaseZoneParams(eString name, bool shared = false); 13 | void setBaseZoneParams(SPK::Ref zone); 14 | void setResult(SPK::Ref zone); 15 | 16 | SPK::Ref _zone; 17 | }; 18 | 19 | 20 | //------------------------------------------------------------------------------------------------------------------------------ 21 | // point zone node 22 | //------------------------------------------------------------------------------------------------------------------------------ 23 | class NodeSparkZonePoint : public NodeSparkZoneBase 24 | { 25 | private: 26 | const QString Name() const override { return QString("PointZone"); } 27 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_zone); } 28 | void process() override; 29 | public: 30 | NodeSparkZonePoint(); 31 | }; 32 | 33 | //------------------------------------------------------------------------------------------------------------------------------ 34 | // plane zone node 35 | //------------------------------------------------------------------------------------------------------------------------------ 36 | class NodeSparkZonePlane : public NodeSparkZoneBase 37 | { 38 | private: 39 | const QString Name() const override { return QString("PlaneZone"); } 40 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_zone); } 41 | void process() override; 42 | public: 43 | NodeSparkZonePlane(); 44 | }; 45 | 46 | 47 | //------------------------------------------------------------------------------------------------------------------------------ 48 | // sphere zone node 49 | //------------------------------------------------------------------------------------------------------------------------------ 50 | class NodeSparkZoneSphere : public NodeSparkZoneBase 51 | { 52 | private: 53 | const QString Name() const override { return QString("SphereZone"); } 54 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_zone); } 55 | void process() override; 56 | public: 57 | NodeSparkZoneSphere(); 58 | }; 59 | 60 | 61 | //------------------------------------------------------------------------------------------------------------------------------ 62 | // box zone node 63 | //------------------------------------------------------------------------------------------------------------------------------ 64 | class NodeSparkZoneBox : public NodeSparkZoneBase 65 | { 66 | private: 67 | const QString Name() const override { return QString("BoxZone"); } 68 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_zone); } 69 | void process() override; 70 | public: 71 | NodeSparkZoneBox(); 72 | }; 73 | 74 | //------------------------------------------------------------------------------------------------------------------------------ 75 | // cylinder zone node 76 | //------------------------------------------------------------------------------------------------------------------------------ 77 | class NodeSparkZoneCylinder : public NodeSparkZoneBase 78 | { 79 | private: 80 | const QString Name() const override { return QString("CylinderZone"); } 81 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_zone); } 82 | void process() override; 83 | public: 84 | NodeSparkZoneCylinder(); 85 | }; 86 | 87 | //------------------------------------------------------------------------------------------------------------------------------ 88 | // ring zone node 89 | //------------------------------------------------------------------------------------------------------------------------------ 90 | class NodeSparkZoneRing : public NodeSparkZoneBase 91 | { 92 | private: 93 | const QString Name() const override { return QString("RingZone"); } 94 | std::shared_ptr outData(PortIndex) override { return std::make_shared(_zone); } 95 | void process() override; 96 | public: 97 | NodeSparkZoneRing(); 98 | }; 99 | 100 | #endif // ZONENODE_H 101 | -------------------------------------------------------------------------------- /src/node-editor/spark-nodes/spark-nodes.h: -------------------------------------------------------------------------------- 1 | #ifndef SPARKNODES_H 2 | #define SPARKNODES_H 3 | 4 | #include "SpkZones.h" 5 | #include "SpkSystem.h" 6 | #include "SpkEmitters.h" 7 | #include "SpkModifiers.h" 8 | #include "SpkInterpolators.h" 9 | #include "SparkNodesRegistry.h" 10 | 11 | 12 | #endif // SPARKNODES_H 13 | -------------------------------------------------------------------------------- /src/urho/BaseRenderer.cpp: -------------------------------------------------------------------------------- 1 | #include "BaseRenderer.h" 2 | #include "../UrhoDevice.h" 3 | 4 | #include 5 | 6 | 7 | /// Custom logic component for moving the animated model and rotating at area edges. 8 | class Mover : public LogicComponent 9 | { 10 | URHO3D_OBJECT(Mover, LogicComponent); 11 | 12 | public: 13 | explicit Mover(Context* context); 14 | void SetParameters(float moveSpeed, float rotationSpeed, const BoundingBox& bounds); 15 | void Update(float timeStep) override; 16 | float GetMoveSpeed() const { return moveSpeed_; } 17 | float GetRotationSpeed() const { return rotationSpeed_; } 18 | const BoundingBox& GetBounds() const { return bounds_; } 19 | 20 | private: 21 | float moveSpeed_; 22 | float rotationSpeed_; 23 | BoundingBox bounds_; 24 | }; 25 | 26 | 27 | Mover::Mover(Context* context) : 28 | LogicComponent(context), 29 | moveSpeed_(0.0f), 30 | rotationSpeed_(0.0f) 31 | { 32 | // Only the scene update event is needed: unsubscribe from the rest for optimization 33 | SetUpdateEventMask(USE_UPDATE); 34 | } 35 | 36 | void Mover::SetParameters(float moveSpeed, float rotationSpeed, const BoundingBox& bounds) 37 | { 38 | moveSpeed_ = moveSpeed; 39 | rotationSpeed_ = rotationSpeed; 40 | bounds_ = bounds; 41 | } 42 | 43 | void Mover::Update(float timeStep) 44 | { 45 | node_->Translate(Vector3::FORWARD * moveSpeed_ * timeStep); 46 | 47 | // If in risk of going outside the plane, rotate the model right 48 | Vector3 pos = node_->GetPosition(); 49 | if (pos.x_ < bounds_.min_.x_ || pos.x_ > bounds_.max_.x_ || pos.z_ < bounds_.min_.z_ || pos.z_ > bounds_.max_.z_) 50 | node_->Yaw(rotationSpeed_ * timeStep); 51 | 52 | // Get the model's first (only) animation state and advance its time. Note the convenience accessor to other components 53 | // in the same scene node 54 | auto* model = node_->GetComponent(true); 55 | if (model->GetNumAnimationStates()) 56 | { 57 | AnimationState* state = model->GetAnimationStates()[0]; 58 | state->AddTime(timeStep); 59 | } 60 | } 61 | 62 | 63 | 64 | /** 65 | * Renderer to preview spark effects in a 3D scene 66 | */ 67 | BaseRenderer3D::BaseRenderer3D() : 68 | Urho3D::Object(UrhoDevice::gUrhoContext) 69 | , _showDebugShapes(true) 70 | { 71 | context_->RegisterFactory(); 72 | 73 | // create scene 74 | _scene = new Scene(UrhoDevice::gUrhoContext); 75 | _scene->CreateComponent(); 76 | 77 | // create 3d grid 78 | _grid.CreateGrid(_scene); 79 | 80 | // create scene 1 81 | createScene1(); 82 | 83 | // create camera 84 | Node* nodeCamera = _scene->CreateChild("Camera"); 85 | nodeCamera->SetPosition(Vector3(0,1,-5)); 86 | _cameraController = nodeCamera->CreateComponent(); 87 | Camera* camera = nodeCamera->CreateComponent(); 88 | camera->SetNearClip(0.1f); 89 | camera->SetFarClip(1000.f); 90 | 91 | // create viewport 92 | Renderer* renderer = GetSubsystem(); 93 | _viewport = new Viewport(context_, _scene, camera); 94 | renderer->SetViewport(0, _viewport); 95 | 96 | // create debug renderer (for debug shapes) 97 | _debugRenderer = new DebugRenderer(context_); 98 | _scene->AddComponent(_debugRenderer, 0, LOCAL); 99 | 100 | // show grid scene by default 101 | setScene(0); 102 | } 103 | 104 | void BaseRenderer3D::createScene1() 105 | { 106 | ResourceCache* cache = GetSubsystem(); 107 | 108 | // Root scene node 109 | _rootNodeScene1 = _scene->CreateChild("_rootNodeScene1"); 110 | 111 | // Create scene node & StaticModel component for showing a static plane 112 | Node* planeNode = _rootNodeScene1->CreateChild("Plane"); 113 | planeNode->SetScale(Vector3(100.0f, 1.0f, 100.0f)); 114 | auto* planeObject = planeNode->CreateComponent(); 115 | planeObject->SetModel(cache->GetResource("Models/Plane.mdl")); 116 | planeObject->SetMaterial(cache->GetResource("Materials/StoneTiled.xml")); 117 | 118 | // Create a Zone component for ambient lighting & fog control 119 | Node* zoneNode = _rootNodeScene1->CreateChild("Zone"); 120 | auto* zone = zoneNode->CreateComponent(); 121 | zone->SetBoundingBox(BoundingBox(-1000.0f, 1000.0f)); 122 | zone->SetAmbientColor(Color(0.7f, 0.7f, 0.7f)); 123 | zone->SetFogColor(Color(0.5f, 0.6f, 0.85f)); 124 | zone->SetFogStart(100.0f); 125 | zone->SetFogEnd(300.0f); 126 | 127 | // Create a directional light to the world. Enable cascaded shadows on it 128 | Node* lightNode = _rootNodeScene1->CreateChild("DirectionalLight"); 129 | lightNode->SetDirection(Vector3(0.6f, -1.0f, 0.8f)); 130 | auto* light = lightNode->CreateComponent(); 131 | light->SetLightType(LIGHT_DIRECTIONAL); 132 | light->SetCastShadows(true); 133 | light->SetColor(Color(0.5f, 0.5f, 0.5f)); 134 | light->SetShadowBias(BiasParameters(0.00025f, 0.5f)); 135 | light->SetShadowCascade(CascadeParameters(10.0f, 50.0f, 200.0f, 0.0f, 0.8f)); 136 | 137 | // Create animated models 138 | const unsigned NUM_MODELS = 30; 139 | const float MODEL_MOVE_SPEED = 2.0f; 140 | const float MODEL_ROTATE_SPEED = 100.0f; 141 | const BoundingBox bounds(Vector3(-20.0f, 0.0f, -20.0f), Vector3(20.0f, 0.0f, 20.0f)); 142 | 143 | for (unsigned i = 0; i < NUM_MODELS; ++i) 144 | { 145 | Node* modelNode = _rootNodeScene1->CreateChild("Jill"); 146 | modelNode->SetPosition(Vector3(Random(40.0f) - 20.0f, 0.0f, Random(40.0f) - 20.0f)); 147 | modelNode->SetRotation(Quaternion(0.0f, Random(360.0f), 0.0f)); 148 | 149 | auto* modelObject = modelNode->CreateComponent(); 150 | modelObject->SetModel(cache->GetResource("Models/Kachujin/Kachujin.mdl")); 151 | modelObject->SetMaterial(cache->GetResource("Models/Kachujin/Materials/Kachujin.xml")); 152 | modelObject->SetCastShadows(true); 153 | 154 | auto* walkAnimation = cache->GetResource("Models/Kachujin/Kachujin_Walk.ani"); 155 | 156 | AnimationState* state = modelObject->AddAnimationState(walkAnimation); 157 | if (state) 158 | { 159 | // Enable full blending weight and looping 160 | state->SetWeight(1.0f); 161 | state->SetLooped(true); 162 | state->SetTime(Random(walkAnimation->GetLength())); 163 | } 164 | 165 | auto* mover = modelNode->CreateComponent(); 166 | mover->SetParameters(MODEL_MOVE_SPEED, MODEL_ROTATE_SPEED, bounds); 167 | } 168 | 169 | // create some static models 170 | const unsigned NUM_OBJECTS = 200; 171 | for (unsigned i = 0; i < NUM_OBJECTS; ++i) 172 | { 173 | Node* mushroomNode = _rootNodeScene1->CreateChild("Mushroom"); 174 | mushroomNode->SetPosition(Vector3(Random(90.0f) - 45.0f, 0.0f, Random(90.0f) - 45.0f)); 175 | mushroomNode->SetRotation(Quaternion(0.0f, Random(360.0f), 0.0f)); 176 | mushroomNode->SetScale(1.0f); 177 | auto* mushroomObject = mushroomNode->CreateComponent(); 178 | mushroomObject->SetModel(cache->GetResource("Models/Mushroom.mdl")); 179 | mushroomObject->SetMaterial(cache->GetResource("Materials/Mushroom.xml")); 180 | } 181 | } 182 | 183 | void BaseRenderer3D::resize(int width, int height) 184 | { 185 | if(_viewport) 186 | _viewport->SetRect(IntRect(0, 0, width, height)); 187 | } 188 | 189 | void BaseRenderer3D::setScene(int index) 190 | { 191 | switch (index) 192 | { 193 | case 0: 194 | _grid.ShowGrid(_scene); 195 | _rootNodeScene1->SetDeepEnabled(false); 196 | break; 197 | 198 | case 1: 199 | _grid.HideGrid(); 200 | _rootNodeScene1->SetDeepEnabled(true); 201 | break; 202 | } 203 | } 204 | 205 | void BaseRenderer3D::showDebugShapes(bool enabled) 206 | { 207 | _showDebugShapes = enabled; 208 | } 209 | 210 | -------------------------------------------------------------------------------- /src/urho/BaseRenderer.h: -------------------------------------------------------------------------------- 1 | #ifndef BASEPRENDERER_H 2 | #define BASEPRENDERER_H 3 | 4 | #include "GridGeometry.h" 5 | #include "CameraController.h" 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | /** 12 | * Interface class for sub-renderers 13 | * A subrenderer manage it's own scene. 14 | */ 15 | class ISubRenderer 16 | { 17 | public: 18 | virtual ~ISubRenderer() {} 19 | virtual void resize(int width, int height) = 0; 20 | }; 21 | 22 | 23 | 24 | /** 25 | * Base subrenderer for 3D view that have 26 | * a scene, a controler camera and 3d grid. 27 | */ 28 | class BaseRenderer3D : public ISubRenderer, public Urho3D::Object 29 | { 30 | URHO3D_OBJECT(BaseRenderer3D, Urho3D::Object) 31 | 32 | public: 33 | BaseRenderer3D(); 34 | void resize(int width, int height) override; 35 | void setScene(int index); 36 | void showDebugShapes(bool enabled); 37 | 38 | protected: 39 | Urho3D::SharedPtr _scene; 40 | Urho3D::SharedPtr _debugRenderer; 41 | Urho3D::SharedPtr _viewport; 42 | CameraController* _cameraController; 43 | GridGeometry _grid; 44 | bool _showDebugShapes; 45 | 46 | private: 47 | void createScene1(); 48 | Urho3D::Node* _rootNodeScene1; 49 | }; 50 | 51 | 52 | #endif // BASEPRENDERER_H 53 | -------------------------------------------------------------------------------- /src/urho/CameraController.cpp: -------------------------------------------------------------------------------- 1 | #include "CameraController.h" 2 | #include "../UrhoDevice.h" 3 | 4 | #include 5 | 6 | using namespace Urho3D; 7 | 8 | CameraController::CameraController(Context* context) : 9 | LogicComponent(context), 10 | _yaw(0.0f), 11 | _pitch(0.0f), 12 | _isMoving(false), 13 | _mode(Orbit), 14 | _zDistance(5.0f), 15 | _target(Vector3::ZERO) 16 | 17 | { 18 | SetUpdateEventMask(USE_UPDATE); 19 | 20 | SubscribeToEvent(E_MOUSEMOVE, URHO3D_HANDLER(CameraController, MouseMoveEvent)); 21 | SubscribeToEvent(E_MOUSEBUTTONDOWN, URHO3D_HANDLER(CameraController, MouseButtonPressed)); 22 | SubscribeToEvent(E_MOUSEBUTTONUP, URHO3D_HANDLER(CameraController, MouseButtonReleased)); 23 | SubscribeToEvent(E_MOUSEWHEEL, URHO3D_HANDLER(CameraController, MouseWheelEvent)); 24 | } 25 | 26 | void CameraController::setMode(CameraMode mode) 27 | { 28 | _mode = mode; 29 | } 30 | 31 | void CameraController::setTarget(Urho3D::Vector3 target) 32 | { 33 | _target = target; 34 | } 35 | 36 | void CameraController::Update(float timeStep) 37 | { 38 | if (_isMoving) 39 | { 40 | Input* input = GetSubsystem(); 41 | 42 | // Movement speed as world units per second 43 | const float moveSpeed = 20.0f * timeStep; 44 | 45 | if (_mode == CameraMode::FirstPerson) 46 | { 47 | // Read WASD keys and move the camera scene node to the corresponding direction if they are pressed 48 | // Use the Translate() function (default local space) to move relative to the node's orientation. 49 | if (input->GetKeyDown(KEY_W)) 50 | node_->Translate(Vector3::FORWARD * moveSpeed); 51 | if (input->GetKeyDown(KEY_S)) 52 | node_->Translate(Vector3::BACK * moveSpeed); 53 | if (input->GetKeyDown(KEY_A)) 54 | node_->Translate(Vector3::LEFT * moveSpeed); 55 | if (input->GetKeyDown(KEY_D)) 56 | node_->Translate(Vector3::RIGHT * moveSpeed); 57 | 58 | // move camera 59 | node_->SetRotation(Quaternion(_pitch, _yaw, 0.0f)); 60 | } 61 | else if(_mode == CameraMode::Orbit) 62 | { 63 | if (input->GetKeyDown(KEY_W)) 64 | _zDistance -= moveSpeed; 65 | if (input->GetKeyDown(KEY_S)) 66 | _zDistance += moveSpeed; 67 | 68 | if(_zDistance < 0.0f) 69 | _zDistance = 0.0f; 70 | 71 | Vector3 targetPosition = _target; 72 | Quaternion q = Quaternion(_pitch, _yaw, 0.0f); 73 | Vector3 cameraOffset(0.0f, 0.0f, _zDistance); 74 | Vector3 cameraPosition = targetPosition - (q * cameraOffset); 75 | node_->SetPosition(cameraPosition); // Set new camera position and lookat values 76 | node_->LookAt(targetPosition); 77 | } 78 | } 79 | } 80 | 81 | void CameraController::MouseButtonPressed(StringHash eventType, VariantMap& eventData) 82 | { 83 | using namespace MouseButtonDown; 84 | int button = eventData[P_BUTTON].GetInt(); 85 | 86 | if(button == MOUSEB_RIGHT) 87 | { 88 | _isMoving = true; 89 | _mode = CameraMode::Orbit; 90 | } 91 | else if(button == MOUSEB_MIDDLE) 92 | { 93 | _isMoving = true; 94 | _mode = CameraMode::FirstPerson; 95 | } 96 | } 97 | 98 | void CameraController::MouseButtonReleased(StringHash eventType, VariantMap& eventData) 99 | { 100 | _isMoving = false; 101 | } 102 | 103 | void CameraController::MouseMoveEvent(StringHash eventType, VariantMap& eventData) 104 | { 105 | using namespace MouseMove; 106 | int px = eventData[P_X].GetInt(); 107 | int py = eventData[P_Y].GetInt(); 108 | int dx = eventData[P_DX].GetInt(); 109 | int dy = eventData[P_DY].GetInt(); 110 | int buttons = eventData[P_BUTTONS].GetInt(); 111 | int qualifiers = eventData[P_QUALIFIERS].GetInt(); 112 | 113 | if(_isMoving) 114 | { 115 | // Mouse sensitivity as degrees per pixel 116 | const float MOUSE_SENSITIVITY = 0.5f; 117 | 118 | // Use this frame's mouse motion to adjust camera node yaw and pitch. 119 | // Clamp the pitch between -90 and 90 degrees 120 | IntVector2 mouseMove(dx, dy); 121 | 122 | _yaw -= MOUSE_SENSITIVITY * mouseMove.x_; 123 | _pitch -= MOUSE_SENSITIVITY * mouseMove.y_; 124 | _pitch = Clamp(_pitch, -90.0f, 90.0f); 125 | } 126 | } 127 | 128 | void CameraController::MouseWheelEvent(StringHash eventType, VariantMap& eventData) 129 | { 130 | using namespace MouseWheel; 131 | int wheel = eventData[P_WHEEL].GetInt(); 132 | _zDistance += wheel; 133 | } 134 | -------------------------------------------------------------------------------- /src/urho/CameraController.h: -------------------------------------------------------------------------------- 1 | #ifndef CAMERACONTROLLER_H 2 | #define CAMERACONTROLLER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class CameraController : public Urho3D::LogicComponent 10 | { 11 | URHO3D_OBJECT(CameraController, Urho3D::LogicComponent) 12 | 13 | public: 14 | 15 | enum CameraMode 16 | { 17 | FirstPerson, 18 | Orbit 19 | }; 20 | 21 | //! Constructor 22 | CameraController(Urho3D::Context* context); 23 | //! Set camera mode (fps or orbit) 24 | void setMode(CameraMode mode); 25 | //! set look at target (only orbit mode) 26 | void setTarget(Urho3D::Vector3 target); 27 | 28 | private: 29 | 30 | void Update(float timeStep) override; 31 | void MouseButtonPressed(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData); 32 | void MouseButtonReleased(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData); 33 | void MouseMoveEvent(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData); 34 | void MouseWheelEvent(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData); 35 | 36 | float _yaw; 37 | float _pitch; 38 | bool _isMoving; 39 | CameraMode _mode; 40 | float _zDistance; 41 | Urho3D::Vector3 _target; 42 | }; 43 | 44 | #endif // CAMERACONTROLLER_H 45 | -------------------------------------------------------------------------------- /src/urho/GridGeometry.cpp: -------------------------------------------------------------------------------- 1 | #include "GridGeometry.h" 2 | #include "../UrhoDevice.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using namespace Urho3D; 10 | 11 | GridGeometry::GridGeometry() : 12 | _gridgeometry(nullptr), 13 | _gridNode(nullptr) 14 | { 15 | _gridColor = Color(0.5f, 0.5f, 0.5f); 16 | _gridSubdivisionColor = Color(0.2f, 0.2f, 0.2f); 17 | _gridXColor = Color(1.0f, 0.1f, 0.1f); 18 | _gridYColor = Color(0.1f, 1.0f, 0.1f); 19 | _gridZColor = Color(0.1f, 0.5f, 1.0f); 20 | _showGrid = true; 21 | _grid2DMode = false; 22 | } 23 | 24 | void GridGeometry::HideGrid() 25 | { 26 | if (_gridgeometry != NULL) 27 | _gridNode->SetEnabled(false); 28 | _showGrid = false; 29 | } 30 | 31 | void GridGeometry::ShowGrid(Scene* scene) 32 | { 33 | if (_gridgeometry != NULL) 34 | { 35 | _gridNode->SetEnabled(true); 36 | _showGrid = true; 37 | 38 | if (scene && scene->GetComponent() != NULL) 39 | scene->GetComponent()->AddManualDrawable(_gridgeometry); 40 | } 41 | } 42 | 43 | void GridGeometry::CreateGrid(Scene* scene) 44 | { 45 | ResourceCache* cache = UrhoDevice::getInstance()->GetSubsystem(); 46 | if (!_gridNode) 47 | { 48 | _gridNode = new Node(UrhoDevice::gUrhoContext); 49 | _gridgeometry = _gridNode->CreateComponent(); 50 | _gridgeometry->SetNumGeometries(1); 51 | _gridgeometry->SetMaterial(cache->GetResource("Materials/VColUnlit.xml")); 52 | _gridgeometry->SetViewMask(0x80000000); // Editor raycasts use viewmask 0x7fffffff 53 | _gridgeometry->SetOccludee(false); 54 | 55 | if (scene->GetComponent() != NULL) 56 | scene->GetComponent()->AddManualDrawable(_gridgeometry); 57 | } 58 | UpdateGrid(); 59 | } 60 | 61 | void GridGeometry::UpdateGrid(bool updateGridGeometry) 62 | { 63 | _gridNode->SetScale(Vector3(8.0f, 8.0f, 8.0f)); 64 | 65 | if (!updateGridGeometry) 66 | return; 67 | 68 | unsigned int size = (unsigned int)(floor(8.0f / 2.0f) * 2.0f); 69 | float halfSizeScaled = size / 2.0f; 70 | float scale = 1.0f; 71 | unsigned int subdivisionSize = (unsigned int)(pow(2.0f, 3.0f)); 72 | 73 | if (subdivisionSize > 0) 74 | { 75 | size *= subdivisionSize; 76 | scale /= subdivisionSize; 77 | } 78 | 79 | unsigned int halfSize = size / 2; 80 | 81 | _gridgeometry->BeginGeometry(0, LINE_LIST); 82 | float lineOffset = -halfSizeScaled; 83 | for (unsigned int i = 0; i <= size; ++i) 84 | { 85 | bool lineCenter = i == halfSize; 86 | bool lineSubdiv = !Equals(float(i% subdivisionSize), 0.0f); 87 | 88 | if (!_grid2DMode) 89 | { 90 | _gridgeometry->DefineVertex(Vector3(lineOffset, 0.0, halfSizeScaled)); 91 | _gridgeometry->DefineColor(lineCenter ? _gridZColor : (lineSubdiv ? _gridSubdivisionColor : _gridColor)); 92 | _gridgeometry->DefineVertex(Vector3(lineOffset, 0.0, -halfSizeScaled)); 93 | _gridgeometry->DefineColor(lineCenter ? _gridZColor : (lineSubdiv ? _gridSubdivisionColor : _gridColor)); 94 | 95 | _gridgeometry->DefineVertex(Vector3(-halfSizeScaled, 0.0, lineOffset)); 96 | _gridgeometry->DefineColor(lineCenter ? _gridXColor : (lineSubdiv ? _gridSubdivisionColor : _gridColor)); 97 | _gridgeometry->DefineVertex(Vector3(halfSizeScaled, 0.0, lineOffset)); 98 | _gridgeometry->DefineColor(lineCenter ? _gridXColor : (lineSubdiv ? _gridSubdivisionColor : _gridColor)); 99 | } 100 | else 101 | { 102 | _gridgeometry->DefineVertex(Vector3(lineOffset, halfSizeScaled, 0.0)); 103 | _gridgeometry->DefineColor(lineCenter ? _gridYColor : (lineSubdiv ? _gridSubdivisionColor : _gridColor)); 104 | _gridgeometry->DefineVertex(Vector3(lineOffset, -halfSizeScaled, 0.0)); 105 | _gridgeometry->DefineColor(lineCenter ? _gridYColor : (lineSubdiv ? _gridSubdivisionColor : _gridColor)); 106 | 107 | _gridgeometry->DefineVertex(Vector3(-halfSizeScaled, lineOffset, 0.0)); 108 | _gridgeometry->DefineColor(lineCenter ? _gridXColor : (lineSubdiv ? _gridSubdivisionColor : _gridColor)); 109 | _gridgeometry->DefineVertex(Vector3(halfSizeScaled, lineOffset, 0.0)); 110 | _gridgeometry->DefineColor(lineCenter ? _gridXColor : (lineSubdiv ? _gridSubdivisionColor : _gridColor)); 111 | } 112 | 113 | lineOffset += scale; 114 | } 115 | _gridgeometry->Commit(); 116 | } 117 | -------------------------------------------------------------------------------- /src/urho/GridGeometry.h: -------------------------------------------------------------------------------- 1 | #ifndef GRIDGEOMETRY_H 2 | #define GRIDGEOMETRY_H 3 | 4 | #include 5 | #include 6 | 7 | 8 | class GridGeometry 9 | { 10 | public: 11 | GridGeometry(); 12 | void HideGrid(); 13 | void ShowGrid(Urho3D::Scene *scene); 14 | void CreateGrid(Urho3D::Scene *scene); 15 | void UpdateGrid(bool updateGridGeometry = true); 16 | 17 | private: 18 | Urho3D::SharedPtr _gridNode; 19 | Urho3D::SharedPtr _gridgeometry; 20 | bool _showGrid; 21 | bool _grid2DMode; 22 | Urho3D::Color _gridColor; 23 | Urho3D::Color _gridSubdivisionColor; 24 | Urho3D::Color _gridXColor; 25 | Urho3D::Color _gridYColor; 26 | Urho3D::Color _gridZColor; 27 | }; 28 | 29 | #endif // GRIDGEOMETRY_H 30 | --------------------------------------------------------------------------------