commit e74a3762b8fd14dffd17544c410ffa31e8d0dca6 Author: wehub-resource-sync Date: Mon Jul 13 12:24:51 2026 +0800 chore: import upstream snapshot with attribution diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c77edf3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,16 @@ +# Rust files are text files with Unix-style newlines. +*.rs text eol=lf +# Other text files have Unix-style newlines. +*.shader text eol=lf +*.toml text eol=lf +*.md text eol=lf +*.html text eol=lf +*.js text eol=lf +*.css text eol=lf +*.glsl text eol=lf +LICENSE text eol=lf +# Image files are binary +*.png binary +*.jpg binary +*.ttf binary +*.bin binary \ No newline at end of file diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..7968e77 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +custom: https://fyrox.rs/sponsor.html diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..2bedf7a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,23 @@ +--- +name: Bug report +about: Report a bug you encountered +title: '' +assignees: '' + +--- + +## Description +A clear and concise description of what the bug is. + +## To Reproduce +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +## Expected behavior +A clear and concise description of what you expected to happen. + +## Screenshots +If applicable, add screenshots to help explain your problem. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..4884fef --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,13 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +assignees: '' + +--- + +## Problem this feature should fix +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +## Expected solution +A clear and concise description of what you want to happen. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..b743c91 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,23 @@ +## Description + +Write here. + +## Related Issue(s) + +Fixes #(issue number) + +## Review Guidance + +Write here. + +## Screenshots/GIFs + +Write here. + +## Checklist + +- [ ] My code follows the project's code style guidelines +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have updated the documentation accordingly +- [ ] My changes don't generate new warnings or errors +- [ ] No unsafe code introduced (or if introduced, thoroughly justified and documented) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c721c50 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,201 @@ +name: CI + +on: + push: + pull_request: + workflow_dispatch: + # This allows running it on any branch manually: + # https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow + +env: + CARGO_TERM_COLOR: always + # Deny warns here as a catch-all and because some commands (e.g. cargo build) don't accept `--deny warnings` + # but also deny them on all individual cargo invocations where available because: + # 1) Some commands might not support rustflags (e.g. clippy didn't at first, cargo doc uses a different var, ...) + # 2) People might copy paste the commands into CI where this flag is missing without noticing. + RUSTFLAGS: --deny warnings + +jobs: + tests: + name: Tests CI + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + rust: [ stable ] + # For reference: https://github.com/actions/virtual-environments#available-environments + os: [ ubuntu-latest, windows-latest, macos-latest ] + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + # Caching must be after toolchain selection + - uses: Swatinem/rust-cache@v2 + + - name: Install linux deps + if: ${{ matrix.os == 'ubuntu-latest' }} + # Note that for running your Fyrox game on CI, you might need additinal deps like libxkbcommon-x11 and OpenGL + # and you might need to run it using xvfb-run even in headless mode. + run: | + sudo apt-get update # Run update first or install might start failing eventually. + sudo apt-get install --no-install-recommends -y libasound2-dev libudev-dev pkg-config xorg-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libdbus-1-dev + + - run: rustc --version && cargo --version + + - name: Build and test + env: + RUSTFLAGS: -C prefer-dynamic=yes + run: | + cargo build --verbose --workspace --all-targets --all-features --profile github-ci + cargo test --verbose --workspace --all-features --profile github-ci + + wasm: + name: Wasm CI + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + rust: [ stable ] + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + targets: wasm32-unknown-unknown + # Caching must be after toolchain selection + - uses: Swatinem/rust-cache@v2 + + - run: rustc --version && cargo --version + - name: Build + # Build only fyrox package here, because there's fyrox-dylib package which cannot be compiled on wasm. + run: | + cargo build --verbose --target=wasm32-unknown-unknown --package fyrox + + format: + name: Rustfmt CI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # Use rust-toolchain because GHA tends to still have an old version for a few days after a new Rust release. + - uses: dtolnay/rust-toolchain@stable + + - run: rustup component add rustfmt + - run: cargo fmt --version + - run: cargo fmt -- --check + + clippy: + name: Clippy CI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # Use rust-toolchain because GHA tends to still have an old version for a few days after a new Rust release. + - uses: dtolnay/rust-toolchain@stable + # Caching must be after toolchain selection + - uses: Swatinem/rust-cache@v2 + + - name: Install linux deps + run: | + sudo apt-get update # Run update first or install might start failing eventually. + sudo apt-get install --no-install-recommends -y libasound2-dev libudev-dev pkg-config xorg-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libdbus-1-dev + + - run: rustup component add clippy + - run: cargo clippy --version + # Using --all-targets to also check tests and examples. + # Note that technically --all-features doesn't check all code when something is *disabled* by a feature. + - run: cargo clippy --workspace --all-targets --all-features -- --deny warnings + + docs: + name: Documentation CI + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + # Caching must be after toolchain selection + - uses: Swatinem/rust-cache@v2 + + - run: rustc --version && cargo --version + - name: Build Docs + run: cargo doc --all-features + env: + RUSTDOCFLAGS: --deny warnings + + template_pc: + name: Project Template (PC) + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Install Tools + run: | + cargo install fyrox-template --path=template --force + - name: Generate and Build Projects + run: | + cd ../ + fyrox-template init --name test_project --style=3d + cd test_project + fyrox-template upgrade --version=latest --local + cargo build --package editor + + template_android: + name: Project Template (Android) + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - uses: actions/setup-java@v4 + with: + java-version: "17" + distribution: "temurin" + - uses: android-actions/setup-android@v3 + with: + cmdline-tools-version: 10406996 + - run: sdkmanager tools "platforms;android-30" + - uses: nttld/setup-ndk@v1 + with: + ndk-version: r26 + - name: Install Tools + run: | + cargo install fyrox-template --path=template --force + cargo install cargo-apk + rustup target add armv7-linux-androideabi + - name: Generate and Build Projects + run: | + cd ../ + fyrox-template init --name test_project --style=3d + cd test_project + fyrox-template upgrade --version=latest --local + cargo-apk apk build --package executor-android --target armv7-linux-androideabi + + template_wasm: + name: Project Template (WASM) + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Install Tools + run: | + cargo install fyrox-template --path=template --force + cargo install wasm-pack + rustup target add wasm32-unknown-unknown + - name: Generate and Build Projects + run: | + cd ../ + fyrox-template init --name test_project --style=3d + cd test_project + fyrox-template upgrade --version=latest --local + cd executor-wasm + wasm-pack build --target=web + project_manager: + name: Project Manager + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Build Project Manager + run: | + cargo build --package fyrox-project-manager \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a36b33d --- /dev/null +++ b/.gitignore @@ -0,0 +1,114 @@ +/target +**/*.rs.bk +/cloc +*.lock +*.log +/*.png +/examples/data/lightmaps +/save.bin +/examples/data/lightmap_scene.rgs +/fyrox-resource/test.txt +/fyrox-core-derive/test_output +/fyrox-impl/test_output +/fyrox-impl/test_restore_integrity +history.bin +settings.ron +/template-core/*.version + +# Nix/NixOS +.direnv/ +.envrc +!flake.lock + +# from https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + + +# from https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore: +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +# Resource Metadata +*.meta +*.registry +.DS_Store diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..0e40fe8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ + +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/.idea/copyright/MIT.xml b/.idea/copyright/MIT.xml new file mode 100644 index 0000000..cb146d5 --- /dev/null +++ b/.idea/copyright/MIT.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..8674cbc --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..45a9456 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..eb5f152 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/rg3d-core.iml b/.idea/rg3d-core.iml new file mode 100644 index 0000000..b0c9311 --- /dev/null +++ b/.idea/rg3d-core.iml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..e9d2b0a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,794 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Debug integration test 'it'", + "cargo": { + "args": [ + "test", + "--no-run", + "--test=it", + "--package=fyrox-core-derive" + ], + "filter": { + "name": "it", + "kind": "test" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_core'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-core" + ], + "filter": { + "name": "fyrox_core", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_math'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-math" + ], + "filter": { + "name": "fyrox_math", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_sound'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-sound" + ], + "filter": { + "name": "fyrox_sound", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug example 'hrtf'", + "cargo": { + "args": [ + "build", + "--example=hrtf", + "--package=fyrox-sound" + ], + "filter": { + "name": "hrtf", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in example 'hrtf'", + "cargo": { + "args": [ + "test", + "--no-run", + "--example=hrtf", + "--package=fyrox-sound" + ], + "filter": { + "name": "hrtf", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug example 'listener'", + "cargo": { + "args": [ + "build", + "--example=listener", + "--package=fyrox-sound" + ], + "filter": { + "name": "listener", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in example 'listener'", + "cargo": { + "args": [ + "test", + "--no-run", + "--example=listener", + "--package=fyrox-sound" + ], + "filter": { + "name": "listener", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug example 'play_sound'", + "cargo": { + "args": [ + "build", + "--example=play_sound", + "--package=fyrox-sound" + ], + "filter": { + "name": "play_sound", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in example 'play_sound'", + "cargo": { + "args": [ + "test", + "--no-run", + "--example=play_sound", + "--package=fyrox-sound" + ], + "filter": { + "name": "play_sound", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug example 'play_spatial_sound'", + "cargo": { + "args": [ + "build", + "--example=play_spatial_sound", + "--package=fyrox-sound" + ], + "filter": { + "name": "play_spatial_sound", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in example 'play_spatial_sound'", + "cargo": { + "args": [ + "test", + "--no-run", + "--example=play_spatial_sound", + "--package=fyrox-sound" + ], + "filter": { + "name": "play_spatial_sound", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug example 'raw_samples'", + "cargo": { + "args": [ + "build", + "--example=raw_samples", + "--package=fyrox-sound" + ], + "filter": { + "name": "raw_samples", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in example 'raw_samples'", + "cargo": { + "args": [ + "test", + "--no-run", + "--example=raw_samples", + "--package=fyrox-sound" + ], + "filter": { + "name": "raw_samples", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug example 'raw_streaming'", + "cargo": { + "args": [ + "build", + "--example=raw_streaming", + "--package=fyrox-sound" + ], + "filter": { + "name": "raw_streaming", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in example 'raw_streaming'", + "cargo": { + "args": [ + "test", + "--no-run", + "--example=raw_streaming", + "--package=fyrox-sound" + ], + "filter": { + "name": "raw_streaming", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug example 'reverb'", + "cargo": { + "args": [ + "build", + "--example=reverb", + "--package=fyrox-sound" + ], + "filter": { + "name": "reverb", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in example 'reverb'", + "cargo": { + "args": [ + "test", + "--no-run", + "--example=reverb", + "--package=fyrox-sound" + ], + "filter": { + "name": "reverb", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug example 'streaming'", + "cargo": { + "args": [ + "build", + "--example=streaming", + "--package=fyrox-sound" + ], + "filter": { + "name": "streaming", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in example 'streaming'", + "cargo": { + "args": [ + "test", + "--no-run", + "--example=streaming", + "--package=fyrox-sound" + ], + "filter": { + "name": "streaming", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug example 'write_wav'", + "cargo": { + "args": [ + "build", + "--example=write_wav", + "--package=fyrox-sound" + ], + "filter": { + "name": "write_wav", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in example 'write_wav'", + "cargo": { + "args": [ + "test", + "--no-run", + "--example=write_wav", + "--package=fyrox-sound" + ], + "filter": { + "name": "write_wav", + "kind": "example" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_resource'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-resource" + ], + "filter": { + "name": "fyrox_resource", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_ui'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-ui" + ], + "filter": { + "name": "fyrox_ui", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_animation'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-animation" + ], + "filter": { + "name": "fyrox_animation", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_graph'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-graph" + ], + "filter": { + "name": "fyrox_graph", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_texture'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-texture" + ], + "filter": { + "name": "fyrox_texture", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_scripts'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-scripts" + ], + "filter": { + "name": "fyrox_scripts", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox" + ], + "filter": { + "name": "fyrox", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_dylib'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-dylib" + ], + "filter": { + "name": "fyrox_dylib", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_impl'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-impl" + ], + "filter": { + "name": "fyrox_impl", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_autotile'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-autotile" + ], + "filter": { + "name": "fyrox_autotile", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_graphics'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-graphics" + ], + "filter": { + "name": "fyrox_graphics", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyroxed_base'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyroxed_base" + ], + "filter": { + "name": "fyroxed_base", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_build_tools'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-build-tools" + ], + "filter": { + "name": "fyrox_build_tools", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug executable 'fyroxed'", + "cargo": { + "args": [ + "build", + "--bin=fyroxed", + "--package=fyroxed" + ], + "filter": { + "name": "fyroxed", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in executable 'fyroxed'", + "cargo": { + "args": [ + "test", + "--no-run", + "--bin=fyroxed", + "--package=fyroxed" + ], + "filter": { + "name": "fyroxed", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'fyrox_template_core'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=fyrox-template-core" + ], + "filter": { + "name": "fyrox_template_core", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug executable 'fyrox-template'", + "cargo": { + "args": [ + "build", + "--bin=fyrox-template", + "--package=fyrox-template" + ], + "filter": { + "name": "fyrox-template", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in executable 'fyrox-template'", + "cargo": { + "args": [ + "test", + "--no-run", + "--bin=fyrox-template", + "--package=fyrox-template" + ], + "filter": { + "name": "fyrox-template", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug executable 'fyrox-project-manager'", + "cargo": { + "args": [ + "build", + "--bin=fyrox-project-manager", + "--package=fyrox-project-manager" + ], + "filter": { + "name": "fyrox-project-manager", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in executable 'fyrox-project-manager'", + "cargo": { + "args": [ + "test", + "--no-run", + "--bin=fyrox-project-manager", + "--package=fyrox-project-manager" + ], + "filter": { + "name": "fyrox-project-manager", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6cebf03 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,19 @@ +{ + "rust-analyzer.diagnostics.disabled": [ + "mismatched-arg-count" + ], + "editor.codeActionsOnSave": { + "source.fixAll": "explicit", + "source.organizeImports": "explicit" + }, + "files.trimTrailingWhitespace": true, + "files.trimFinalNewlines": true, + "[markdown]": { + "editor.formatOnSave": true, + "files.insertFinalNewline": true, + }, + "[rust]": { + "editor.formatOnSave": true, + "files.insertFinalNewline": true, + } +} diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md new file mode 100644 index 0000000..c4a65dd --- /dev/null +++ b/ARCHITECTURE.md @@ -0,0 +1,331 @@ +# Architecture + +** WORK IN PROGRESS ** + +This document describes high-level architecture and basic concepts of Fyrox. It should help you to understand +basics of the engine's architecture and find a right place for your modifications. + +## Overview + +Fyrox is a monolithic game engine with very few replaceable parts. This means that Fyrox itself has relatively +strong coupling between modules. However, some of its parts can be used as standalone crates - core, UI and +sound are independent of the engine. Internal coupling is one-way in most of the places, this means that, for +instance, a renderer **is** dependent on a scene, but scene does **not** know anything about the renderer. +This fact makes changes in the engine very easy even for beginners. + +Fyrox consists of the four crates - fyrox-core, fyrox-sound, fyrox-ui, and Fyrox itself. fyrox-core, fyrox-sound and +fyrox-ui are **standalone** crates and can be used separately, the only place where these three are meet is the +Fyrox. Previously each crate had a separate repository, but then I decided to put everything in single repository +because it was too much of a pain to build any project that uses the engine. + +Another important fact is that Fyrox **does not** use ECS, instead it uses generational arenas (pools in Fyrox's +terminology) for efficient memory management (fast allocation/deallocation, CPU cache efficiency). This means +that you are working with good old structures which are placed in contiguous memory block (pool). Once an +object was placed in a pool, you get a handle to the object which can be used to access (borrow) the object +when you need. Such approach allows you to make any relations between the objects - handle is just a pair of +numbers, it won't cause issues with borrow checker. For more info check +[pool.rs](https://github.com/FyroxEngine/Fyrox/blob/master/fyrox-core/src/pool.rs). + +### Core + +Core contains some of very common algorithms and data structures that are used across other parts of the engine. +It contains linear algebra, accelerating structures, color-space functions, etc. In other words it contains +"building blocks" that are very widely used across other parts of the engine. + +### Renderer + +Fyrox uses a combination of deferred + forward renderers. The deferred renderer is used to render opaque objects, +when the forward renderer is used to render transparent objects. The renderer provides lots of very common +graphical effects. The renderer is suitable for most of the needs, however it is not flexible enough yet and +there is no way of using custom shaders yet. + +### User Interface + +Fyrox uses custom user interface library. It is node-based, has very powerful layout system, uses messages +to communicate between widgets, supports styling. The library has 30+ widgets (including docking manager, +windows, file browsers, etc). Please keep in mind that the library does not render anything, instead it +just prepares a set of drawing commands which can be used with any kind of renderer - a software (GDI for +instance) or a hardware (OpenGL, DirectX, Vulkan, Metal, etc.). + +### Sound + +Fyrox uses software sound engine [fyrox-sound](https://github.com/FyroxEngine/Fyrox/tree/master/fyrox-sound). +The sound engine provides support for binaural sound rendering using HRTF, which gives excellent sound +spatialization. + +## Code Map + +Code map should help you find a right place for your modifications. This is the most boring part of the +document, here is the table of contents for your comfort: + +- [fyrox-core](#fyrox-core) + - [math](#mathmodrs) +- [fyrox-ui](#fyrox-ui) + - [widgets](#borderrs) +- [fyrox-sound](#fyrox-sound) + - [buffer](#buffermodrs) + - [decoder](#decodermodrs) + - [device](#devicemodrs) +- [Fyrox](#fyrox) + +### fyrox-core + +As it was already said up above, fyrox-core is just a set of useful algorithms. If you want to add a thing +that will be used in dependent crates then you're in the right place. Here is the very brief description +of each module. + +#### math/mod.rs + +The module contains some intersection check algorithms, vector projection methods (tri-planar mapping for +example), generic rectangle struct, and other stuff that cannot be easily classified. + +#### math/aabb.rs + +The module contains Axis-Aligned Bounding Box (AABB) structure. It is used as a bounding volume to accelerate +spatial checks (like ray casting, coarse intersection checks, etc). + +#### math/frustum.rs + +The module contains Frustum structure. Its purpose (in the project) is to perform visibility checks - for +example camera is using frustum culling to determine which objects must be rendered on screen. + +#### math/plane.rs + +The module contains Plane structure that basically represents just plane equation. Planes are used for +intersection tests. + +#### math/ray.rs + +The module contains Ray structure which is used for intersection tests. For example the engine uses rays +in lightmapper to do ray tracing to calculate shadows. + +#### math/triangulator.rs + +The module contains a set of triangulation algorithms for polygon triangulation. There are two algorithms: +simple one is for quadrilaterals, and generic one is the ear-clipping algorithm. The stuff from the module is +used to triangulate polygons in 3d models to make them suitable to render on GPU. + +#### color.rs + +The module contains structure and methods to work with colors in HSV and RGB color spaces, and to convert +colors HSV <-> RGB. + +#### color_gradient.rs + +The module contains simple linear color gradient with multiple points. It is widely used in particle systems +to change color of particles over time. For example a spark starts from white color and becomes more red over +time and finally becomes black. + +#### lib.rs + +The module contains BiDirHashMap and very few other algorithms. + +#### numeric_range.rs + +The module contains fool-proof numeric range - there is no way to create a range with incorrect bounds - bounds +will be determined at the sampling moment. + +#### octree.rs + +The module contains Octree acceleration structure which is used to accelerate ray casting, point-probing, +box intersection tests and so on. + +#### pool.rs + +The module contains the heart of the engine: pool is one of the most commonly used structure in the engine. +Its purpose is to provide a storage for objects of a type in a contiguous block of memory. Any object +can be accessed later by a handle. Handles are some sort of indices, but with additional information that +is used to check if handle is valid. + +#### profiles.rs + +The module contains a simple intrusive profiler. It uses special macro (scope_profile!()) to time a scope. + +#### rectpack.rs + +The module contains rectangle packing algorithm (most commonly known as "bin-packing problem"). It is used +to create texture atlases. + +#### visitor.rs + +The module contains node-based serializer/deserializer (visitor). Everything in the engine serialized by +this serializer. It supports serialization of basic types, many std types (including +Rc/Arc) and user-defined types. + +### fyrox-ui + +fyrox-ui is a standalone, graphics API-agnostic, node-based, general-purpose user interface library. + +#### lib.rs + +The module contains UserInterface structure and Control trait. + +#### border.rs + +The module contains Border widget which is basically just a rectangle with variable width of borders, and +an ability to be a container for child widgets. + +#### brush.rs + +The module contains Brush structure which describes a way of drawing graphics primitives. + +#### button.rs + +The module contains Button widget and its builder. + +#### canvas.rs + +The module contains Canvas widget and its builder. Canvas is a simple container for child widgets, +it allows setting position of children widgets directly. + +#### check_box.rs + +The module contains CheckBox widget and its builder. CheckBox is a three-state (checked, unchecked, +undefined) switch. + +#### color.rs + +The module contains widgets to work with colors and their builders. There are separate widgets to change +hue, saturation, brightness and compound color selector widget. + +#### decorator.rs + +The module contains Decorator widget and its builder. Decorator is a simple container for child widgets, +it has built-in behaviour for most common actions: it changes appearance when mouse enters or leaves bounds, +when user clicks on it, etc. + +#### dock.rs + +The module contains DockingManager and Tile widgets and their builders. Docking manager is able to combine +multiple Window widgets in its tiles, each tile can be resized, docked or undocked. This is the must-have +widget for any kind of editor. + +#### draw.rs + +The module is responsible for "drawing". It is in quotes, because it does not actually draw anything, it just +emits drawing commands in a queue for later interpretation. + +#### dropdown_list.rs + +The module contains DropdownList widget and its builder. DropdownList is a small field that shows selected +item and a "popup" that contains list of items. + +#### expander.rs + +The module contains Expander widget and its builder. Expander is a collapsable container for child widgets +with a field that describes a content. + +#### file_browser.rs + +The module contains a set of widgets that displays file system. FileBrowser widget is a simple file system +tree, FileSelector is a window with FileBrowser and few buttons. + +#### formatted_text.rs + +The module is responsible for text formatting and "rendering". The latter is in quotes, because the library +just uses glyph info from a font to layout each glyph in a line of text with word wrapping and other +useful features (like text size calculation, etc). + +#### grid.rs + +The module contains Grid widget and its builder. Grid is a powerful layout widget, it allows arranging child +widgets in a series of rows and columns. + +#### image.rs + +The module contains Image widget and its builder. Image is a simple rectangle with a texture. + +#### list_view.rs + +The module contains ListView widget and its builder. ListView is a container for items which arranged +as a stack. ListView supports item selection. + +#### menu.rs + +The module contains menu widgets. Menu here means a classic menu which is a strip with root items and a +set of child sub-menus. + +#### message.rs + +The module contains all supported messages for every widget in the library. + +#### messagebox.rs + +#### node.rs + +#### numeric.rs + +#### popup.rs + +#### progress_bar.rs + +#### scroll_bar.rs + +#### scroll_panel.rs + +#### scroll_viewer.rs + +#### stack_panel.rs + +#### tab_control.rs + +#### text.rs + +#### tree.rs + +#### ttf.rs + +#### utils.rs + +#### vec.rs + +#### vector_image.rs + +#### widget.rs + +#### window.rs + +#### wrap_panel.rs + +### fyrox-sound + +fyrox-sound is a standalone sound engine with multiple renderers and high-quality sound. The sound engine +provides support for binaural sound rendering using HRTF, which gives excellent sound spatialization. + +#### buffer/mod.rs + +#### buffer/generic.rs + +#### buffer/streaming.rs + +#### decoder/mod.rs + +#### decoder/vorbis.rs + +#### decoder/wav.rs + +#### device/mod.rs + +#### device/alsa.rs + +#### device/coreaudio.rs + +#### device/dsound.rs + +#### device/dummy.rs + +### Fyrox + +The engine itself. It has: a renderer, resource manager, animations, scenes, and various utilities like +lightmapper, uv-mapper, navigation mesh, logger, pathfinder. + +#### animation/mod.rs +#### animation/machine/mod.rs +#### animation/machine/blend_nodes.rs +#### engine/mod.rs +#### engine/error.rs +#### engine/resource_manager.rs +#### renderer/mod.rs +#### renderer/framework/mod.rs +#### renderer/framework/framebuffer.rs +#### renderer/framework/geometry_buffer.rs \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b80dad7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3068 @@ +# 1.0.1 + +- Fixed unaligned read in the renderer on WebAssembly, that in some cases led to black screen on startup (#906). + +# 1.0.0 + +First stable release. + +## Fixed + +- Reduced vram consumption by replacing rgba16f with rgb10a2 textures +- Fixed crash when switching scenes after selecting an audio bus +- Fixed incorrect shape editing for cuboid shapes +- Fixed debug rendering in 2d +- Do not offset a collider when changing its size via shape editing +- Fixed position reset when moving multiple objects at once +- Fixed crash when attempting to bring a destroyed widget into view +- Fixed terrain multilayer rendering +- Fixed prefab hot reloading +- Fixed heightfield collider not working (fix for rapier3d regression) +- Fixed view jumping when selecting large tree view items in world viewer +- Fixed incorrect id for default animation tracks data container +- Fixed crash when undoing asset instantiation +- Fixed root field name +- Fixed inability to delete text in text box in some cases +- Fixed camera preview being cutoff from the bottom +- Fixed inability to copy built-in resources without a data source +- Fixed height for search bar in property selector +- Correctly leave preview mode when closing absm editor +- Correctly leave preview mode when closing animation editor +- Fixed asset selector style +- Fixed text trimming in check box +- Fixed warning from material field +- Fixed tab control style +- Fixed layout for bit field +- Fixed text alignment for infinite constraints +- Fixed incorrect descender calculation in case of infinite constraints +- Fixed checkbox style +- Fixed crash when loading a prefab with hierarchy modified in the base +- Fixed infinite message loop in quat property editor +- Fixed absm editor not working properly for game scenes +- Fix naming for inspector actions +- Fix naming some more +- Fixed `already borrowed` panic +- Fixed absm buttons +- Fixed bitfield style +- Fixed curve editor coordinate space +- Fixed incorrect behavior of `open recent scene` +- Fixed incorrect project name for `export-cli` +- Fixed incorrect resource path fetching in material field editor +- Fixed style for `add` and `remove` buttons for collections +- Include `core` module in `fyrox` docs +- Fix for macos fast scroll when pixel delta is received (#898) +- Style fixes for material editor +- Fixed resource registry not loading in time on wasm +- Prevent crash when moving a scene node + +## Added + +- CLI for project export +- Ability to trim text with ellipsis +- Input box widget +- Tooltip with track property name +- `UserInterface::try_send_response` helper +- Ability to disable background curves in the animation editor +- Ability to disable background curves for curve editor widget +- Add built-in light style resource +- Add exit confimation dialog for project manager +- Added `donate` button for project manager +- Added colors for scene item icons +- Added missing code for surface data resource saving +- Added more methods for `ImageButtonBuilder` +- Added shadow for the text in the asset item +- `BehaviorResult` alias + test fixes +- `Color::hex` +- `ImageButtonBuilder` helper + replaced `make_button_xxx` +- `PluginContext::load_scene_or_ui` + fixed project template +- `dispatch_behavior_variants` macro +- `locate` button for material field +- `locate` button for surface field +- `make_image_toggle_with_tooltip` helper +- Corner radius for text box +- Property editor for triangle buffer +- Property editor for vertex buffer +- Ability to add keys for any numeric properties in the animation editor +- Ability to add keys for selected nodes in the animation editor +- Ability to minimize all editor panels +- Ability to search for a loader for specific resource data type + +## Changed + +- Increased kernel size of pcs filtered shadows (makes shadows much smoother) +- Watch only registry root for changes +- Absm editor improvements +- Migrate to rapier 0.32 +- Do not echo sync-only messages +- Improved validation for rigid bodies +- Increase ambient lighting for asset preview +- Update libloading dep +- Do not try to use hole mask if `holes enabled` flag is off +- Print info messages in automated tests only if `visual_debug == true` +- Prevent message spam when executing editor tests +- Do not reset camera state when doing any changes on it +- Wrap asset title by word, not by letter +- Improved log filtering in the editor +- Improved numericupdown widget style +- Improved style for docking anchor +- Improved surface data editor style +- Improved visual style for signals in animation editor +- Improvements for animation editor +- Improvements for audio preview panel +- Moved build targets list to editor settings +- Moved project build tools to `fyrox-build-tools` crate +- Refactor window dragging logic to use local coordinates and clamp size/position (#899) +- Refactored animation renaming + adding new animation +- Refactored export cli to be a part of the game workspace +- Refactored log filtering +- Refactored scene loading to use plugin tasks +- Print current version in the project manager window's title +- Print warning message if backtrace capture is enabled +- Disable info logging by default in project manager +- Disable layer-related buttons when no layer is selected +- Disable word wrap for node type +- Adjust "open docs" button style +- Adjust byte gap +- Adjust default height map size for terrains to prevent warning message +- Automatically enter preview mode when selecting a camera +- Automatically zoom in on the new animation +- Accept `NumpadEnter` on `Button` widget +- Use bitmap image for check box instead of vector +- Use correct resource for `locate` button in material field editor +- Use correct resource for `locate` button in surface field editor +- Use default style for new ui +- Use image for `locate` button in resource field editor +- Use toggle buttons for preview and loop options in animation editor +- Use ui style when drawing keyboard focused widget bounds +- Show animation player name in the window title +- Show currently selected absm name +- Send message box messages back +- Save triangle buffer as a binary blob +- Unify naming for built-in assets +- Editor style improvements +- The plugin initialization was moved to event queue and only when the registry is fully loaded +- Always show display name of the property if the doc is empty +- Build target for project export options +- Configurable constraint for dropdown list +- Convert project name to standard format +- Correctly handle dyn types on hot reloading +- Correctly mark property editors when loading a dynamic editor plugin +- Deactivate "add key" button if nothing is selected +- Default ui for project manager +- Defaults + docs for project exporter cli +- Diagnostic messages when adding keys +- Do not create a default user interface +- Do not rebuild formatted text when visual transform changed +- Draw keys on background curves +- Helper methods for `HotKey` +- Keep message flags when responding to changes in ScrollBar widget +- Keep track of an assembly from which a dyn type originates from +- Make keyboard shortcut text for menu item less bright +- More efficient render data copying +- More visual improvements for animation editor +- Offload vertex transform to gpu when drawing widgets +- Prevent highlighting rectangle of a focused widget to draw outside +- Prevent redundant memory allocations during widgets drawing +- Rename default name of the scene root to `SceneRoot` from `__ROOT__` +- Reorganized log and command stack panel buttons +- Save log filter state to the editor settings +- Shuffle icon for uuid property editor +- Simplified trait bounds for `load_ui` +- Split animation editor toolbar in a top and bottom parts +- Support `FrameworkError` in `GameError` +- Unified scene/ui loading + refactored async script/plugin tasks + +## Removed + +- Remove `Mobility` because it does nothing +- Removed context menu from texture field, replace with buttons +- Removed redundant tree traversal in widgets drawing +- Removed unused import +- Removed useless message when saving settings + +# 1.0.0-rc.2 + +Second release-candidate version. + +## Fixed + +- Fixed combining lightmaps with emissive channel +- Fixed incorrect light mapping for shared materials +- Fixed incorrect filtering of material when generating a lightmap +- Fixed path filtering in case of empty filter +- Fixed editor hanging when closing a scene tab when more 3+ scenes open +- Fixed incorrect position syncing when modifying z coordinate of 2d body +- Fixed infinite recursion in trait bounds for Visit and Reflect procmacro +- Fixed infinite message loop in node selector +- Fixed crash in node selector when untyped handle was replaced with typed +- Fixed dyn type constructors container type passed on deserialization +- Fixed project template generator +- Fixed crash when trying to rebind a property prefab's animation +- Fixed `Bring into view` functionality for log panel +- Fixed enabled state for menu items of asset item +- Fixed folder deletion from asset browser +- Fixed crash when attempting to delete ui scene root +- Fixed incorrect "no items" visibility condition + fixed `Make Folder` +- Fixed incorrect tree root handling when processing fs events +- Fixed file system watcher for file browser widget +- Fixed crash in fs tree creation +- Fixed incorrect nan handling in numeric up down widget +- Fixed infinite message loop in numeric up down +- Fixed incorrect hdr adaptation +- Fixed hdr auto exposure +- Fixed defaults for automatic exposure for hdr +- Fixed incorrect frame luminance calculation for hdr +- Fixed luminance calculation glsl function +- Fixed misleading docs +- Fixed gltf loading +- Fixed panic from `TileCollider` load failure +- Deduplicate fs events to prevent duplication of fs tree items +- Correctly filter out editor nodes when generating a lightmap +- Update vertex buffer if its layout has changed +- Clip keyboard focus rectangle by widget's clip bounds + +## Added + +- `DynType` for user-defined serializable structures with full editor support +- Error handling for scripts and plugins with optional backtrace capture +- UI rendering optimization based on widget invalidation +- BBCode support +- Font fallbacks +- Experimental shader code editor +- Added ability to keep the editor active on every frame +- Added ability to disable bloom + configurable bloom threshold +- Automated testing mode for the editor +- Added hdr settings +- Added named scopes for renderer to improve debugging +- Added background for the editor content +- Added user data for `Graph` +- Added property editor for `TextureKind` +- Added `This folder is empty` message for file browser +- Added helper methods to graph to borrow nodes and do ray casting +- `impl Display` and `impl Error` for various engine errors +- `UserInterface::send_to` + `UserInterface::send_many_to` + `UserInterface::send_many_to_if` + + `UserInterface::send_sync_many` methods +- `UiMessage::is_for` + `UiMessage::data_for` + `UiMessage::for_widget` + `UiMessage::data_from` + + `UiMessage::comes_from` methods +- UI message delivery mode +- Helper methods for scene nodes: `set_position`, `set_position_xyz`, `set_rotation`, `set_rotation_angles`, + `set_rotation_x`, `set_rotation_y`, `set_rotation_z`, `set_scale`, `set_scale_xyz`, `set_uniform_scale` +- Add [useful instructions](https://github.com/FyroxEngine/Fyrox/blob/master/CONTRIBUTING.md#contributing-code) for + contributors +- Configurable exposure for editor's camera +- `impl Default for DrawingContext` +- Visual invalidation flag for widgets +- Headless mode for the editor +- Autotesting for the editor +- Resource io improvements +- Folder filter preset for file browser +- Path filtering in file selector +- Add `All Supported` filter option for file selector +- Ability to deselect currently selected path in file browser +- Standard `ok` + `cancel` styles for button background decorator +- Icons for editor's menu items +- Padding for text box and formatted text +- Overall style improvements +- Placeholder for textbox + searchbar widgets +- Add preview for shaders +- `control_trait_proxy_impls` macro + boilerplate code removal +- `BuildContext::add` method +- Ability to check if a path is a built-in resource path +- Property editor for `TexturePixelKind` +- Property editors for vec +- Type uuid provider impl for matrix 2/3/4 +- Property editors for shader entities +- Better error handling for `Pool`, `Graph` +- `NetStream::pop_message` method +- Arbitrary error support for visitor +- User data for `Graph` and `UserInterface` based on `DynType` +- Ability to edit ui scene settings +- `to_base`/`to_variant` methods for handle type conversion +- Better error handling in `Ragdoll::iterate_recursive` +- `HandlesArrayExtension` trait +- `to_base` for `Vec` where T: ObjectOrVariant +- Property editor for `Style` +- `Rectangle::apply_animation`/`Sprite::apply_animation` helper method for easier applying of sprite sheet animation +- Shortcuts for setting specific part of the linear velocity of rigid body +- `PluginContext::load_ui` helper method +- Ability to fetch scene nodes by uuid +- `Pool::next_free_handle` method +- `Plugin::on_game_error` - ability to handle game errors and disable standard logging +- Ability to add scene nodes at desired handles +- `Shader::find_texture_resource` + `Self::find_property_group_resource` +- Ability to check if shader has a texture/property group resource +- `impl Display for VertexAttribute` +- Ability to explicitly specify location of the second tex coord attribute +- Ability to clear lightmap +- Ability to specify environment lighting brightness + +## Changed + +- UI messages refactoring - removed message constructors and replaced with direct enum variant + creation. +- Migrated to typed handles +- Fill in the default path to lightmap texture as registry root +- Improved surface data viewer to show vertex layout +- Report non-supported nodes when generating a light map +- Make `instance_id_map` immutable in the editor +- Use `tinyaudio` version 2 +- Refactored `TabControl` to use only uuids for tabs +- Removed lazy_static dependency +- Keep the nodes at their handles when saving a scene in the editor +- Use task pool instead of spawning a thread manually when loading a scene +- Refactor `Style` to use plain sorted vector +- Shortcuts for `ScrollViewerMessage` + `ListViewMessage` +- Allow fetching base type instances from compound objects +- Support typed handles in multiborrow context +- Allow comparison of base and derived handles +- Return result in behavior trees +- Shared property editors container +- Plugin docs improvements +- Improved `copy` functionality for log entries +- Show/hide apply+revert buttons in inspector correctly +- Wrap shader source code into newtype wrapper +- Make shader entities inspectable +- Keep asset preview enabled when inspecting built-in assets +- Show asset preview for built-in assets +- Show the content of built-in assets in inspector when selected +- Limit dropdown container min width instead of width +- Show registry root when clearing the search bar in the asset browser +- Ability to set text box's padding via respective message +- Do not allow deleting the root registry folder +- Refresh asset browser if a folder was added/removed +- Do not register unsupported paths in `ResourceManager::find` +- Check if a resource can be loaded before registering it +- Use `WrapPanel` in the animation editor for better toolbar layout +- Improved menu item with icons + helper for `MenuItemContent` +- Handle `Rescan` message correctly +- Check if a file already exist when selecting a file in file selector +- Use `ok` + `cancel` button style for file selector widget +- Take filter into account when checking if a folder is empty +- Disable ability to delete path root item +- Refactored path filter to support fixed set of file types +- Ability to show context menu by a click on file browser +- Ability to specify filter for path field editor +- Make path text non-editable +- Hide home/desktop dir buttons if a root is set for file browser widget +- Improved file selector to have configurable list of file types +- Moved FileSelectorField widget to its own module +- Moved mode out of file browser to file selector widget +- Focus selected path on project import in the project manager +- Refactored file selector + file browser some more +- Use resource registry folder for asset browser and file browser +- Do not generate redundant fs tree items if a root is set +- Refactored file browser tree building + added tests +- Refactored path setting + removed duplicated code +- Refactored path filter +- Simplified dir content fetching +- Replaced `OpenModal/OpenAt/OpenAndAlign` window messages with `Open` +- Register missing property editors +- Force save an empty resource registry and create a folder for it +- Post `Popup::Close` only if the dropdown's popup is open +- Send `modified` flag message as sync in inheritable prop editor +- `Widget::local_to_screen` +- Keep updating all UIs even if there's no graphics context +- Disable shadow casting for scene gizmo +- Ability to run the editor with graphics debugging turned on +- `GraphicsServer::begin_scope` +- Ability to specify debug groups for graphics commands +- Use default exposure for editor camera +- Introducing the null scene +- Color space conversion glsl functions +- Return the number of processed message from ui message queue polling +- Improving how selection changes are handled +- Improving UX of TextBox +- Putting space in FormattedText for tabs. +- Allow indexing `UserInterface` with derived widget handles +- Moved `perform_layout` flag to `MessageData` trait method +- Use gltf emission strength parameter correctly +- Register gltf standard shader +- Wake up rigid bodies when changing linear/angular velocity +- Made uv + normals optional when loading gltf +- Merge pull request #858 from b-guild/resource +- Ability to disable writing to stdout for `Log` +- Correctly kill child processes when starting a new export run +- Updated MSRV +- Ability to disable optimizations when exporting the project +- Show full project path in the project manager to reduce confusion +- Use home dir as default location for new projects +- Adjusted styles for "delete project" message box in the project manager + +## Removed + +- Removed backward compatibility for assets +- Removed `AbstractSceneGraph` + `BaseSceneGraph`, merged in `SceneGraph` +- Removed unused root dir title +- Removed fs events handling from public file browser message +- Removed optimization for `dev` profile +- Removed hardcoded values for lightmap generation + +# 1.0.0-rc.1 + +First release-candidate version. + +## Fixed + +- Fixed performance issues when deleting an object in the editor +- Use ambient occlusion from material info in ambient lighting shader +- Fixed skybox editing in scene settings +- Fix build window (handle stderr and stdout in different threads) +- Fixed ssao rendering +- Exit build mode after successful build +- Prevent loss of piped data due to BufReader dropping +- Fixed cube texture to use only one size parameter instead width+height +- Fixed layout of resource property editor +- Fixed reflection probe rendering with fxaa enabled +- Add details to FieldTypeDoesNotMatch error to improve warnings +- Check if a property can be cloned/pasted in the inspector +- Fixed box selection in the editor +- Improved selection order in the editor +- Context menu handling for various inspectors +- Fixed smart placement for move interaction mode +- Fixed grid blending issues +- Fail-safe shader/material handling when rendering +- Fixed incorrect sampler params +- Prevent clamping for infinite available size in UI +- Fixed axes colors for grid shader +- Adjust grid cell size to match grid snapping options +- Support all three major plane orientations (oXZ,oXY,oYZ) in grid shader +- Improved selection in the editor +- Fixed incorrect viewport handling for camera render targets +- Do not crash if render data couldn't be created, return an error instead +- Filter out editor-specific scene nodes when using camera preview +- Remove render data for destroyed cameras +- Use separate render target for camera preview in the editor +- Added missing tab labels for 'Settings' and 'Navmesh' panels +- Added missing interaction modes shortcuts for terrain and navmesh +- Fixed terrain holes incorrect command name +- Making relative paths for loading and saving scenes +- Remove redundant BrushMacro method remove_cell +- Highlight allowed types better in the node selector +- Use typed_ref/mut methods in graph indexing impl +- Show/hide camera preview image +- Fixed interaction mode order in the toolbar to follow indices: 1..6 +- Fixed distance sorting for meshes +- Collect only supported resources + ignore resources from excluded dirs +- Fixed render order to be back-to-front for correct blending +- Improved gizmo and exposed scale in editor settings +- Prevented the camera frustum in debug draw from being scaled +- Improved camera focus distance to be less close to the object +- Correcting make_relative_path and scene saving logic. +- Allowing make_relative_path to accept non-existing files +- Improving error reporting for missing InspectorEnvironment +- Fixed scene gizmo lighting +- Fixed crash when an invalid asset is drag-dropped onto a surface field +- Fixed crash when an empty string is used in the asset browser search +- Fixed crash when CSM near and far values are superimposed +- Fixed documentation for VisitError::NotSupportedFormat +- Made "Show in explorer" work on other OS's +- More concise naming for Reflect methods +- Handle UI scaling in Screen Widget +- Fixed potential crash in the editor +- Improved performance of dynamic drawing methods +- Fixed resource registration +- Fixed deadlock when loading a resource +- Preserve global transform when reparenting scene nodes +- Fixed misleading docs +- Fixing minimization for windows. +- Fixed distance sorting +- Reset editor camera rotation when in 2d mode +- Fixed matrix2 deserialization +- Fixing cut-off text in tooltips +- Protecting against resource deadlock +- Hold mutex locks as short as possible to prevent deadlocks +- Use blocking resource registry updating where possible +- Correcting terrain hole mask bug +- Fixed asset item context menu not showing on rmb click +- Do not try to reload unsupported resources. +- Moving plugin and script handling to before node handling, to fix teleportation glitch +- Print error message instead of silently writing an error to the resource +- Use trait upcasting and remove `as_any` for `ResourceData` +- Fixed usages of ResourceKind +- Fixed asset preview generation +- Fixed built-in resource handles deserialization +- Ability to create metadata files +- Proper headless mode +- Hide asset preview if there's no actual preview data for it +- Fixed gltf shader +- Fixed incorrect syncing of modified flag in property editor +- Prevent annoying message spam when import options is missing for asset +- Fixed ambient lighting in case of non-skybox lighting +- Render overlay icons only in the scene preview +- Hide "revert" button for inheritable properties when no parent object +- Improved performance of visual transform calculation in ui +- Improved ui performance +- Fixed blending issues when batching multiple rectangles +- Fixed fitting for asset preview +- Fixed visual glitch for scaling, rotation, movement gizmos +- Fixed update loop state in the editor +- Fixed deletion of gl vao/gpu programs/textures +- Fixed incorrect caching/binding of gl framebuffer +- Handle invalid aabb/division by zero when doing camera fitting +- Fixed menu item content alignment + `make_menu_splitter` helper +- Reset visual state of a selected option in the dropdown list on select +- Fixed asset preview update when a resource changes +- Significantly reduced annoying visual lag when generating asset previews +- Correctly detach content of control panels of various entities +- Fixed text alignment in various places in the editor +- Fixed asset preview +- Do not stop deserialization on invalid resource refs +- Fixed inability to add animation track for a node +- Better lighting for asset preview +- Fixed torus faces orientation +- Fixed deferred preview generation for assets in asset selector +- Fixed `Option::None` serialization +- Fixed camera picking issues +- Do not change resource uuid when moving it in the editor +- Log window improvements + fixes +- Fixed crash when trying to select text in the text box via double click +- Fixed resource movement in the asset browser +- Fixed incorrect position of dragndrop preview when dpi scaling is used +- Update asset preview if the asset changes +- Properly handle added/removed resources to/from the resource registry +- Use correct material in `MaterialFieldEditor` +- Fixed crash in case of invalid material resource used in ui renderer +- Fixed request of built-in resources in the resource manager +- Fixed incorrect color space in standard forward pass of standard shaders +- Fixed black screen bug when saving a scene with active camera preview +- Prevent deadlock when trying to get a debug name for gpu texture +- Fixed incorrect ambient lighting calculation +- Reduced memory usage when generating asset previews +- Clamp anisotropy in `[1.0; 16.0]` range to prevent video driver errors +- Fixed `uuid_provider` macro +- Correcting InheritableVariable::visit and physics integration parameters dt +- Fixed selection button being clipped on material property editor +- Fixed gimbal lock in GLTF animations +- Prevent crash on empty uniform blocks +- Update the material editor when hot-reloading a shader +- Fixed crash on material hot-reloading when a property was removed + +## Added + +- Added image-based lighting (IBL) +- Name for gpu buffers +- Named gpu textures +- Ability to specify mip level for frame buffer attachments +- `GraphicsServer::create_cube_render_target` +- Added runs to FormattedText +- `Texture::new_cube_render_target` +- Environment mapping +- Reflection probe node +- `fyrox_widgetData` built-in property group +- Ability to specify custom shaders for widgets +- Documentation and helper methods for colliders +- Implementing Debug and Display for BitMask. +- Brdf lut generator +- Ability to copy/paste values in the editor setting's inspector +- `UserInterface::has_descendant_or_equal` +- `Inspector::handle_context_menu_simple` +- `GpuShader` entity +- `Reflect::try_clone_box` +- Ability to copy/paste values in inspector +- Added `is_significant` method for editor commands +- Show grid in 2d mode in the editor +- Docking manager for asset browser +- Echo popup messages +- `Copy Value` + `Paste Value` options in context menu of `Inspector` +- Collect property paths in the inspector widget +- `UserInterface::send_messages` to send multiple messages at once +- Implemented `BorrowAs` trait for widget handles +- Enhanced tile set editing, copying pages +- Debug impl for NodeHandleMap +- Movable scene tabs +- `GraphicsServer::generate_mipmap` +- `RendererResources` with pre-loaded resources +- Ability to specify the face of the cube map in frame buffer attachment +- Environment cube map prefilter shader +- Blanket impl for ScriptMessagePayload replaced with derive macro +- Print allowed type name in the node selector + do type checking +- Ability to set derived handle types in the handle editor +- Dynamically typed script messages +- Added a setting to modify editor camera's mouse sensitivity +- `Reflect::fields_info_mut` + optimizations +- More methods for handles accessed via reflection +- Improvements to autotiling +- Multithreaded wave function collapse +- Adding empty tiles to tile map brush +- Render target for cameras +- Thread sleep in headless executor +- `ResourceLoader::convert` impl for native scenes +- Added `ResourceIo::copy_file` method +- Added visitor version number +- Added option to use %MANIFEST_DIR% to open IDE in project manager +- Add render mask to Base node +- Docs improvements for serialization +- Universal `Visitor::load_from_memory` with format autodetection +- Tests for `move_resource` +- Integration tests for fyrox-resource +- Adding support for kinematic physics +- `RG16F` texture format +- Allow user to change editor icon and customize window title +- Tooltip for material resources in the material editor +- Ability to fetch memory usage by the graphics server +- Ability to disable asset convertion when exporting a project +- Convert ui scenes to binary format when exporting a project +- Print warning messages in the log when setting terrain height map +- Resource registry `ResourceManager::register` + `ResourceManager::uuid_to_path` methods +- Introducing multi-window docking tiles +- Resource registry +- `ResourceIo::write_file` + rename `FileLoadError->FileError` +- `ResourceLoadersContainer::is_supported_resource` +- Show selected path in the main window of the asset browser +- Uuids for resources +- Ascii reader and writer for visitor +- Added `#[inline]` attributes for ui drawing methods +- Configurable fadeout margin for particle systems +- Fyrox-graphics documentation +- Ability to disable picking restriction for popup widget +- Ability to create gpu program from shaders +- Ability to reset widget's visual state via respective message +- Ability to reset editor layout +- Cell property editor +- Placeholder icon for resources without preview generator +- Added placeholder icon for asset items whose preview is being generated +- Loading scenes list window when loading scenes in the editor +- Async loading for game and ui scenes in the editor +- Ability to specify special title for root item in the filebrowser widget +- Ability to paste properties in resource inspector +- Ability to inspect and edit supported assets in inspector +- Footer attachment point for inspector plugin +- `AssetSelection` + inspect asset import options in standard Inspector +- Helper methods for selection downcasting +- Ability to move a folder with resource in the resource manager +- Configurable depth for `walk_directory` method +- Asset rename dialog improvements +- Ability to rename assets in the asset browser +- Add small margin for asset preview +- Skybox api improvements +- Added folder icon for file browser +- Ability to select environment light source for scenes +- `Brush` helper methods +- Better navigation in the asset browser +- Ability to enable or disable debug names for GPU objects +- Added confirmation dialog for asset deletion +- Use checkerboard background for asset preview tooltips +- Improved texture property editor +- Increased size of material preview +- Preview for surface data editor +- Preview for material property editor +- Magnified asset preview for resource property editor +- Show asset preview in resource field editor +- Texture property editor improvements +- `AssetSelectorWindowBuilder::build_for_type_and_open` +- Ability to disable size sync of `Image` widget with its texture +- Helper function `make_pick_button` +- Generate preview for items in asset selector +- Asset selector +- Helper methods for `ResourceState` +- Direct immutable access to underlying container for ResourceRegistry +- `ResourceManager::can_resource_be_moved` +- Highlight asset item when it accepts drop +- Check for drop content in the file browser to show correct cursor icon +- Custom `accepts_drop` for `AssetItem` that checks if drop is possible +- Allow to define custom drop response method on ui widgets +- Improved visual style of `AssetItem` +- Ability to move a folder when dropping it to some other folder +- Ability to move a resource by dropping it to a folder asset item +- Ability to move a resource by path without loading it +- `impl Display for FileError` +- `ResourceRegistry::remove_metadata` +- `ResourceIo::delete_file+delete_file_sync` +- `UntypedResource::type_uuid_non_blocking` +- Ability to specify pre and post visit method calls for visitor codegen +- Ability to try get resource manager state lock for the given time period +- Style api improvements +- Ability to re-bind styled properties of widgets in the editor +- Joint motors +- Show graphics server memory usage in the editor's rendering statistics +- Simplified interaction with keyboard and mouse. +- Added flake.nix for generated projects +- Simplified way of getting input state +- Ability to flip sprite/rectangle nodes +- Show id of materials/surfaces in the editor +- Added TypeUuidProvider impl for VectorN types +- Property editors for Run + RunSet +- Property editor for `char` + editors for mask char in formatted text +- Named constants for mouse buttons + helper methods for mouse input +- Ability to set runs via respective message +- Added srgba8/srgb8 texture formats +- Added pure color texture +- Added non-euler-angles-based rotation track + +## Changed + +- Preventing deadlocks by replacing `lock` with `safe_lock` +- Automatically destroy dead senders in resource event broadcasters +- Renamed pool method typed_ref to try_get +- Configurable render mode for ui +- UI rendering api improvements +- do not alter already loaded resource state when reloading it +- Use scene skybox if there's no specific environment map +- Do not prevent building without the opened scene +- Remove dependency on status code 101 (which is cargo specific, while built-tool has tool-agnostic design) +- Detached renderer from scene's `Camera` +- Moved sky box to scene from camera +- Enable seamless cube map filtering by default +- Include breadcrumb into VisitError:RegionDoesNotExist +- Moved all shaders into a centralized storage +- Moved opengl-specific code to `fyrox-graphics-gl` +- Build tool now streams both stdout and stderr +- Increased window size and inspector name column width in settings +- Smart selection of corner arc subdivision when drawing borders +- Recalculate clip bounds only for changed widgets +- Allow engine user control default editor settings +- Use `MaterialResource` in widgets instead of `UntypedResource` +- Refactored ui renderer to use materials +- Documented keyboard focus +- Separate brush for highlighting widgets with keyboard focus +- Prevent selection of asset items while holding alt +- Moved material/shaders to `fyrox-material` crate +- Use separate struct for args for `InspectorContext::from_object` func +- Include all nodes that produces render data in camera picking in editor +- Convert assets to their most efficient version when exporting a project +- Reducing dependencies of fyrox-autotile +- Use sampler+texture pair instead of old-fashioned combined texture +- Migrate to latest winit/glutin/rapier +- Disable texture lod bias for wasm builds +- Moved `set_panic_hook` to engine initialization for wasm builds +- Disable picking restriction for menus and context menus +- Change layout of command stack panel +- Save ui scenes in ascii mode by default +- Normalize paths before passing them to `ResourceManager::request` +- Close a menu by clicking on the menu item. +- Improved docs of `Resource::data_ref` +- Split `FieldInfo` into two parts `FieldInfo` + `FieldMetadata` +- Moving control panels to inspector head +- Merged `DerivedEntityListProvider` trait into `Reflect` trait +- Refactored node handle property editor to accept typed handles +- Register property editors for scene/ui node handles +- Refactored `NodeHandlePropertyEditorDefinition` to accept generic type +- Use typed handles in 2d joints +- Less bright icons for scene nodes +- Do not recreate render target for asset preview if preview is collapsed +- Explicitly disabled unsupported render passes in standard widget shader +- Reduced contrast of the text/images in the default dark theme +- Do not save `NEED_SYNC` flag when serializing an inheriable variable +- Correcting how ScriptPropertyEditorDefinition accesses environment +- Refactor resource manager to use hash map for resources +- Use stable ids when serializing rc/arc +- Isolated visitor's reader and writer into separate entities +- Reversing generate_free_handles to match spawn +- Refactored resource system to use uuids instead of path where possible +- Track vertex/fragment shader line location +- Tidy up menus in the editor +- Vector flattened structure for serialization +- Close dropdown lists on selection +- Open context menus on rmb-up event instead of rmb-down +- Beautifying bitfield widget +- Adding adjustable warning messages to autotile failures +- Select asset item by rmb click +- Expose instance id in the inspector +- Use doc comment for property description +- Expose more properties in the inspector +- Unhide node's global transform in the inspector +- Keep the editor active until it loads all the queued scenes +- Use special root title for project's root folder in the asset browser +- Override title for the root item in the asset browser +- Only show folders that in the registry in the asset browser's dir viewer +- Show only content from the resource registry in the asset browser +- Use command-based approach when editing resources in the inspector +- Use respective command to change selection in the asset browser +- Save the resource data on change in the inspector +- Hide asset previewer for assets without a preview +- Moved asset preview to the inspector +- Moved selection-specific code to selection itself +- Show pretty type name in resource creator +- Search in resource registry when searching in the asset browser +- Better validation for file name when doing move +- Do not allow to delete built-in resources +- Improved FormattedText +- Use flat gray color background for asset previews +- Green color for `add resource` button +- Disable `duplicate` and `dependencies` context menu items for folders +- Use calculated local instead of screen position when setting new desired position after toggling of a view +- Bring selected item into view in the list view when arrow navigating +- Use texture property editor for texture bindings in material editor +- Use helper methods in resource property editor +- Increased margin on `Stop` button in build window +- Improved validation when moving a resource +- Check if a resource can be moved when moving an asset in asset browser +- Moved tooltip from asset item to its text field +- Make paths os-independent and canonical when moving a resource +- Do not allow to create a resource outside of the data folder +- Allow to use build tool with executable that doesn't expect "--" as passthrough marker +- Build tools: delegate stderr to Log +- Removed redundant empty impls of InteractionMode trait +- Share fbx materials as much as possible +- Store a style handle in the widget +- Pass ui handle in `Plugin::on_ui_message` + +## Removed + +- Removed resource duplicates +- Removed invalid assertions +- Removed redundant `ResourceLoaderAsAny` trait +- Removed wasm-unsupported `set_border_color` of gpu texture +- Removed `get_image+read_pixels` methods from gpu texture +- Removed impls for `field/field_mut` +- Removed redundant codegen for field/field_mut methods +- Removed `Relfect::fields/fields_mut` methods +- Removed `owner_type_id` field from `FieldInfo` +- Removed redundant `type_name` field from `FieldInfo` +- Removed `Downcast` trait, replaced with `define_as_any_trait` macro + +# 0.36.1 + +Minor release with fixes for some annoying bugs. + +## Fixed + +- Fixed frustum culling issues for meshes. +- Correctly mark inheritable properties as modified when animating them. +- Show selected item in the asset browser when clearing selection text. +- Fixed incorrect width of the node removal dialog. +- Fixed physics desynchronization issue. +- Fixed docking manager layout saving and loading. +- Improved project name validation (in both `fyrox-template` and the project manager). +- Fixed example shader in the documentation. +- Added names for floating panels in the editor—fixes incorrect layout after loading. + +# 0.36 + +This version unifies versions of sub-crates - now all sub-crates have the same version. This makes it easier to migrate +to future versions. + +## Added + +- Tile maps. +- UI styling support. +- Project manager to manage multiple Fyrox projects at once. +- Dropdown list docs. +- Implemented PartialEq for sprite sheet animation entities. +- Property editor for SurfaceDataResource. +- Surface data viewer for surface resource. +- `BaseSceneGraph::remove_nodes`. +- Ability to add/remove interaction modes dynamically. +- Shape editing for colliders. +- Shader for sprite-based gizmos (allows to draw sprite-based gizmos on top of everything else). +- `math::get_arbitrary_line_perpendicular`. +- Added ability to specify font-+its size for value indicator in `ScrollBar`. +- Ability to specify font size when building a button. +- Added ability to specify font and font size when creating window title. +- Added surface resource loader. +- Built-in surfaces. +- Added a configurable throttle frame interval for `Executor`. +- Added sanity check for brush operations to protect the editor from being overloaded by huge brushes. +- Messages for `Grid` widget - ability to change rows/columns/draw border/border thickness. +- `Material::texture` helper method. +- `Color::repeat_opaque` method. +- `DrawingContext::push_grid` method. +- `save + save_back` methods for resource. +- Added "refresh" button for asset browser. +- `ResourceDataRef::as_loaded_ref/mut` methods. +- Ability to open assets using double click. +- Multi-selection support for `ListVIew` widget. +- `impl PartialEq for Ray`. +- Add an ability to rotate the editor camera using scene gizmo. +- `impl From<&String> for ImmutableString`. +- Improved material api - `Material::set_property` is now much less verbose. +- Better support for fbx materials from 3DS max. +- Validation for 2d colliders. +- Added folders into asset browser. +- Ability to cut holes in terrain. +- Experimental occlusion culling for light sources. +- `read_pixels_of_type` to get typed pixels instead of raw bytes. +- Added `R32UI` texture format. +- `get_image` for gpu texture. +- Pixel buffer for async framebuffer reads. +- Include cache sizes in rendering statistics (helps in catching uncontrollable GPU memory usage growth). +- Ability to duplicate resources in asset browser. +- Added visible distance for particle systems. + - Automatically excludes distant particle systems from rendering to improve performance. + - Can be tweaked on a per-system basis. +- Ability to enable/disable scissor test from custom shaders. +- Ability to specify depth func in custom shaders. +- Added uniform buffers. +- Added `UniformBufferCache` for easier handling of multiple UBOs. +- Added bind groups + mandatory texture binding via render resources. +- Ability to fetch graphics server capabilities. +- Experimental `UniformMemoryAllocator`. +- Frustum culling for light sources. +- Support a saving/restoring the maximized flag of the editor's window. +- Ability to save all opened scenes at once + hotkeys. +- `AxisAlignedBoundingBox::project` method. +- `post_update` callback for `Plugin`. +- Editor plugins container - adds some useful methods for plugin search. +- More dockable windows. +- Ability to copy/paste selection in the curve editor widget. +- Added a configurable limit for message log to prevent excessive bloat. +- Configurable coordinate system for particle systems - allows selecting a coordinate system for generated particles— + local or world. +- Lighting support for particle systems. +- `ModelResource::instantiate_and_attach` method. +- Ability to add keys on multiple curves at once. +- Hotkey for `zoom to fit` for curve editor widget. +- Useful macros for early return statements. While let-else exists, it still takes more lines of code than it should. + these macros are much more compact and easier to read. +- `BaseControl::self_size` method. +- Editor ui statistics plugin. Allows tracking the total amount of widget used by the editor, which is useful to find if + there are "dangling" widgets. +- `DockingManagerLayoutDescriptor::has_window` method. +- Print the total number of drawing commands of ui for the current frame. +- `remove_on_close` flag for `Window` widget. +- Ability to apply custom sorting for children widgets of a widget. +- Ability to sort menu items. +- Track processed ui messages in the editor - helps to find message queue overload. +- `has_component` helper methods. +- `StyleResource` resource type. +- Configurable routing strategy for ui messages. +- Helper methods for easier setting window icon. +- Add a `Zed` editor option into editor settings. +- Added configurable delay for tooltips. + - Prevents tooltips from popping up instantly on mouse hover, instead there's a configurable (0.55 s by default) + delay. + - Removes annoying tooltip popping when moving mouse. +- Added more texture settings - base level, max level, min lod, max lod, lod bias. +- Added home/desktop directories shortcut buttons for file browser widget. +- Ability to focus the current path in the file browser widgets. +- Ability to specify graphics server constructor. + - Essentially gives an ability to change graphics servers at creation/runtime stages. + - By default still uses OpenGL graphics server. +- Added kerning support for fonts. +- `BuildContext::send_message` method. +- Added project manager CI. +- Backward compatibility for deserialization of `Untyped->Typed` resource. +- Ability to specify usage for element buffer. +- `info! + warn! + err!` log macros. +- Documentation improvements. +- `Downcast` trait to remove code bloat. +- Added tooltip for shader field in the material editor. +- Toggle button widget. +- Added tags for reflection. +- `WidgetBuilder::with_uniform_margin(..)`. +- Shortcuts for groups in editor settings: allows quickly jumping to a particular settings group. +- Searching functionality for editor settings. +- `impl TypeUuidProvider for Rect`. +- Added property editors for `Option>`. +- Nine patch widget improvements. + - Added ability to specify a texture region for atlas support. + - Remove explicit uv coordinates and calculate them on the fly. + - Ability to disable drawing of the center region of the nine-patch widget. + - Configurable tiling mode for nine-patch widget. + - Easier editing of texture slice using new texture slice editor. +- Thumb widget for draggable things. +- Messages to change vertical and horizontal scrolling of ScrollViewer widget. + +## Changed + +- Included project license in every source file. +- Reset scene node transform to identity when making it root. +- Take z index into account when linking widgets. +- Split fyrox-template into lib + cli. +- Ability to specify project root dir for template-core. +- Optional app arguments. Prevents crash when trying to parse program arguments. +- Change key bindings to make more intuitive up/down motion. +- Replaced `SurfaceSharedData` into `Resource` + - Surface shared data was essentially a resource of some sort anyway. + - Allows saving meshes as resources externally. + - Allows using standard resource pipeline for surface data. +- Simplified camera picking API in the editor. +- Improved terrain brush system. +- Print surface resource kind in the property editor. +- Fixed new object placement. + - Children objects will stay at (0,0,0). + - When creating via "Create" menu, a new object will be located in front of the camera. + - When creating a parent object whose parent is root, it will also be located in front of the camera. +- Ability to specify name column width of inspector widget. +- Save camera projection mode in editor settings. +- Refactored editor camera controller - allows dragging the camera using mmb in 2d mode. +- Sort items of built-in resources. +- Remove native collider when its shape cannot be created. +- Hijack control over animations from animation container in ABSM - now ABSM itself updates the animations it uses, + and only those that are currently used either by a state or states of active transition. +- Extract the rendering framework into a separate crate. +- Make fbx elements of mesh geometry optional. + - Prints a warning message and continues reading. + - This is needed to be able to load "malformed" fbx, that has no mesh geometry, such as animation-only fbx. +- Enable resource hot reloading by default in executor. +- Move `rotateVec2` to shared shader functions. +- Store initial data and file extension (if any) of built-in resources. +- Moved opengl initialization to the rendering framework. +- Use uniform buffer for bone matrices instead of texture matrix storage. +- Use uniform buffer to pass object instance data to shaders. +- Moved camera properties into its own uniform block. +- Switched to uniform buffers across the renderer. +- Pass material properties using uniform buffers. + - Automatically generate uniform buffer description for material properties. + - Automatically define uniforms for samplers. + - No more need to manually define material properties in shaders, just use `properies.your_property_name`. +- Isolated opengl-specific code of gpu program into its own module. +- Use uniform memory allocator to speed up uniform data upload to gpu. + - Splits rendering of render bundles in two steps: uniform data collection + upload and the actual rendering. + - More efficient use of memory by using all available space in uniform buffers (prevents having uniform. + buffers with just 200–300 bytes of memory, where the actual memory block on gpu is 4 kb). + - It significantly reduces the number of individual data transfers and gapi calls in general. + - Improves performance by 12–15%. +- Removed redundant buffer binding/unbinding - saves some time on api calls (especially in WebGL, where everything is + proxied through JS). +- Pass sceneDepth texture to shaders explicitly. +- Use explicit binding for textures. Prevents dozens of `glUniform1i` calls when drawing stuff, thus improving + performance by 5–10% (more on WebAssembly, where each gl call is passed through JS). +- Refactored shader structure to include resource bindings. + - Makes shader structure more rigid and removes implicit built-in variables. + - Makes binding points of resources explicit. +- Turned `Matrix2Editor` into generic-over-size `MatrixEditor`. +- Use immutable string in shader property name. +- Reworked materials. + - Material now stores only changed shader properties. + - Move validation from set_property/bind to the renderer where it simply prints an error message to the log + if something's wrong. + - Removed fallback value from texture resource binding, it makes no sense to duplicate this info since the correct + one is stored in the shader anyway. + - Removed `default` property from texture definition in shaders. +- Collect light info when constructing a render bundle. Removes redundant loop over scene graph nodes. +- Refactor hot reload to allow custom dynamic plugins besides dylib-based. +- Improved gpu texture api. +- Perform checked borrow in node message processing to prevent crashes. Crash could happen if a node is already deleted, + but its message was still in the queue. +- Replaced component querying from nodes with `ComponentProvider` trait. +- Turned editor inspector into a plugin. +- Cloning physics when cloning Graph to persist Scene settings when saving Scene from the editor. +- TabControl improvements.. +- Changed `traverse_iter` to return a pair of handle and ref - much more convenient when there's a need to handle a + handle with a reference at the same time, no need to do re-borrow which is double work anyway. +- Added `AnimationResource` which decoupled animation tracks data into a shared resource. + - Significantly reduces memory consumption when cloning animations, since it does not need to clone the tracks + anymore. + - Animation resource can be shared across multiple animations using the same tracks. + - Significantly speeds up the instantiation of animation player scene node. + - Backward compatibility is preserved. +- Focus search bar's text box when focusing toolbar itself - toolbar focus makes no sense anyway, because it does not + interact with keyboard, but text box does. +- Node selector usability improvements. + - Focus search bar on open. + - Ability to confirm selection by enter key. + - Bring the first selected item into view on open. + - Added tab navigation. +- Lazy z-index sorting instead of on-demand. +- Exclude samples buffer from a list of animatable properties. +- Improved property selector. + - Focus search bar on opening. + - Tab navigation. + - Highlight selected properties on rebinding. + - Ability to confirm selection by hitting the enter key. +- Detached material-related parts of the editor into its own plugin - material editor is now non-existent by default and + created only when needed, which saves memory (both ram and vram) and cpu/gpu time. +- Detached ragdoll wizard into a separate plugin. +- Move the settings window into a separate plugin. +- Move the animation editor into its own plugin. +- Improved editor plugins api. +- Create animation editor on editor start if animation editor was docked before. +- Move the absm editor to a separate plugin. +- Create save file selector for prefabs on demand. +- Move the curve editor window into its own plugin. +- Move the path fixer into a plugin. +- Use builtin surfaces for meshes created in the editor. +- Migrated to latest `tinyaudio`. +- Removed hardcoded ui widgets constructors. It replaced with user-defined constructors via `ConstructorProvider` trait. +- Sort menu items in alphabetical order in creation menus. +- Replaced hardcoded ui style variables with configurable styles. +- Make tooltips invisible for hit test. +- Move the log panel to `fyrox-ui`. +- Keep the editor running until the active popup is fully shown. +- Change the default path of file browser to `./`. +- Disable log file by default. The log file could be undesirable in some cases, and now it is off by default and can be + enabled by `Log::set_file_name/set_file` in `fn main`. +- Explicit api to change the log file. +- Replaced proprietary Arial font with Roboto in the editor. +- Do not precompile built-in shaders on engine start. + - It is faster to compile them on-demand. + - On WebAssembly such compilation could take 10–15 seconds. +- Detached texture-related code to separate crate. It allows attaching it to `fyrox-ui` to use textures directly without + using hacky `UntypedResource`. +- Use TextureResource directly in ui code where possible - removes redundant juggling with untyped↔typed conversions. +- Force `Image` widget to use texture size on measurement stage - removes "surprising effect" with collapsed image, if + width/height is not set explicitly. +- Audio initialization errors non-fatal now. It allows running the engine in environments without proper audio output + support. +- Print editor version in the window title. +- Print editor version in the log on start. +- Replace the hardcoded version of the engine with the one from Cargo.toml. This is a semi-reliable solution, but much + better than having the hardcoded version. +- Close projection (2d/3d) selector on selection. +- Use toggle button for `track selection` in the world viewer. +- Put the search bar of the world viewer on the same row with other buttons. +- Moved `load_image` to `fyrox-ui` utils. + +## Fixed + +- Fixed blurry fonts. +- Significantly improved editor performance. +- Improved joint stability after migration to the latest Rapier physics. +- Use z index from the respective message. +- Fixed crash when trying to change window title using the respective message. +- Fixed procedural meshes serialization. +- Fixed inspector syncing when replacing the selected object with another type. +- Fixing Rect tests in fyrox-math. +- `transmute_vec_as_bytes` soundness fix. +- Fixed crash when trying to drag'n'drop non-texture in texture field. +- Refresh asset browser after asset deletion. +- Better validation for colliders. +- Support for chained texture nodes in fbx - fixes normal map import on FBX files made in latest 3ds max/Maya/etc. +- Watch for changes in the current directory and refresh asset browser content. +- Fixed potential crash when cloning ui nodes. +- Fixed tool installation check in project exporter. + - Do not try to install already installed tools. + - Prevents accessing the network when there's no actual need. +- Fixed redundant texture binding if it is already bound to pipeline. +- Discard scaling from rotation matrix before passing it to bounding shape - fixes clipping issues of light sources. +- Do not skip light scatter rendering even if there's no fragments lit. It fixes flashing of light scattering. +- Fixed shadow map lod selection condition. +- Speed up access to animation curve data. +- Use `ImmutableString` in `ValueBinding` to make it smaller results in faster copying (32 bytes vs. 16 bytes). +- Prevent render targets from registering multiple times in texture cache. +- Improved performance of render data collection. +- Drop inherited `RUSTFLAGS` for project exporter child processes. +- Fixed crash when rendering large bundles. +- Do not reallocate gpu buffer if there's enough space for data already. +- Ignore buffer write commands when the data is empty. +- Set glsl es precision to `highp`. +- Fixed an invalid editor window size on second startup at the hidpi display. +- Ensure vector images have a set size. +- Fix crash on macOS in notify crate when the path is set first time. +- Reduced code bloat by isolating fallback textures into their own struct. +- Fix wasm tests fails due to using of the deprecated PanicInfo. +- Discard scaling part when calculating light source bounding box. +- Excluded some non-animatable properties from property selector. +- Detached perf of hierarchical properties propagation from graph size. + - Graph now updates hierarchical properties only for ones that actually changed. + - Significantly improves performance in static scenes. +- Prevent redundant global transform update for 2d rigid bodies. +- Fixed "teleportation" bug (when a scene node was located at world's origin for one frame and then teleports back + where it should be). +- Prevent potential nan in `vector_to_quat`. +- Fixed convergence in reverb sound effect. +- Fixed root motion jitter on looping animations - loop boundaries were handled incorrectly, thus leading to error + accumulation that led to annoying jitter after some iterations. +- Fixed visible borders around point lights. +- Reduced code bloat in the engine internals. +- Fixed transform syncing of colliders. +- Fixed `Inspector` widget syncing issues. +- Fixed crash when deleting multiple animation tracks at once. +- Fix for UI layout, including Grid and Text. +- Fixed crash when trying to fetch intersections from a deleted collider. +- Fixed crash when trying to collect animation events without a root state. +- Fixed crash when using `accurate_world_bounding_box` on some meshes - it would crash if a mesh has no position/bone + indices/bone weights attributes in its vertex buffer. +- Fixed name of ragdoll joint generated by ragdoll wizard. +- Improved overall editor performance and ui nodes linking in particular. +- Prevent redundant syncing of the editor settings window - saves ~10% of time. +- Prevent the editor from loading the same texture over and over again. +- Fixed keyboard navigation for tree root - fixes annoying issue which causes keyboard focus to stick at tree root. +- Fixed camera preview panel size. +- Fixed deletion of some widgets. +- Fixed arrow visibility of menu item when dynamically changing its items. +- Fixed `MenuItem` performance issues. +- Fixed syncing of material editor shader field. +- Added `fyrox-build-tools` crate which essentially contains build tools from the editor. +- Fixed incorrect texture bindings invalidation - caused weird bug with incorrect textures applied to some objects (very + noticeable in the ui after resizing the window). +- Use mip mapping for icons in the editor to smooth icons in the editor. +- Fixed background color "leaking" during `Border` widget rendering. +- Fixed syncing bug of R coordinates for volume textures. +- Fixed transform order in visual transform calculation. +- Fixed incorrect memory alignment when deserializing `BinaryBlob`. +- Fixed crash when using nine-patch widget without a texture. +- Fixed crash when dropping non-texture resource on texture field. + +## Removed + +- Removed redundant data hash calculation in textures. +- Removed redundant field from render data bundle - `is_skinned` flag makes no sense, because it could be derived + from bone matrix count anyway and it is always defined on the per-instance basis, not per-bundle. +- Remove redundant decal layer index from mesh/terrain/render the data bundle. These are residuals from before + custom material era, it makes no sense now since decal layer index is defined in materials and these fields simply had + no effect. +- Removed depth offset. + - It could be done with shaders. + - Removed because it adds unnecessary projection matrix juggling for each rendered instance. +- Removed implicit blend shapes storage passing to material shaders - it is now controlled directly from `Mesh` node, + and it creates temp material to pass blend shape storage explicitly. +- Removed `PersistentIdentifier` and `MatrixStorageCache`. +- Removed `cast_shadows` property from `BaseLight` - this property at some point started to be redundant, because `Base` + already has such property and the one in `BaseLight` must be deleted to prevent confusion. +- Remove an incorrect error message in the animation editor. +- Removed `Node::query_component_ref/mut`. + - It duplicates existing functionality. + - Replaced with `SceneGraphNode::component_ref/mut`. +- Removed redundant boxing when applying animation values - makes animation of arbitrary numeric properies significantly + faster. + +# 0.35 + +- Version skipped, because of sub-crates version unification. See 0.36 change log for more info. + +# 0.34.1 Engine + 0.21.1 Editor + +- Fixed crash when trying to create parent for root in the editor +- Dispatch script messages after everything is initialized and updated +- Prevent selection type name from disappearing in the inspector +- Fixed potential crash when undoing asset instantiation +- Fixed rendering issues in 2d projection mode in the editor +- Update visual transform of a widget when render transform changes + +# 0.34 Engine + 0.21.0 Editor + +## Added + +- Code hot reloading for plugins. +- Ability to have multiple scripts on one scene node. +- Static and dynamic batching for meshes. +- Project exporter for automated deployment. +- Configurable build profiles for the editor. +- Ability to have multiple user interface instances. +- GLTF support (available via `gltf` feature). +- Keyboard navigation support in the UI. +- Preview generation for assets in the asset browser. +- Grid for the scene preview. +- `fyrox-template` improvements to generate projects, that supports code hot reloading. +- `AnimationPlayer` + `AnimationBlendingStateMachine` widgets. +- UI prefabs with ability to instantiate them. +- `Pool::try_get_component_of_type` + the same for `MultiBorrowContext`. +- `NodeTrait::on_unlink` method. +- Implemented `ComponentProvider` trait for `Node`. +- `MultiBorrowContext::get/get_mut` methods. +- Ability to remove objects from multiborrow context. +- `newtype_reflect` delegating macro. +- `SceneGraph::change_hierarchy_root` method. +- Ability to change UI scene root. +- Property inheritance for UI widgets. +- Ability to instantiate UI prefabs by dropping prefab into world viewer/scene previewer. +- Ability to open scripts from the editor's inspector. +- `Control::post_draw` method. +- Ability to reorder children of a scene node. +- `SceneGraph::relative_position` + `SceneGraphNode::child_position` methods. +- Ability to reorder nodes/widgets in the world viewer. +- Added more icons for widgets. +- Added support for UI animations in the animation editor. +- Configurable UI update switches. +- Ability to edit ui absm nodes in the absm editor. +- `AbsmEventProvider` widget. +- Ability to enable msaa when initializing graphics context. +- Ability to change corner radius in `Border` widget. +- Ability to draw rectangles with rounded corners in UI drawing context. +- Added layout rounding for `fyrox-ui` which significantly reduced blurring. +- Added support for embedded textures in FBX. +- `Selector` widget. +- Added project dir and scenes to open as cli args to editor. +- `utils::make_cross_primitive` helper method. +- Ability to draw wire circle in the UI drawing context. +- Ability to draw WireCircle primitives in VectorImage widget. +- More tests. +- Vertex buffer API improvements. +- Rendering statistics window for the editor. +- Added shape casting in physics. +- Ability to unassign textures in material editor. +- Allow to set negative playback speed for animations in animation editor. +- `Scene::clone_one_to_one` shortcut for easier scene cloning. +- `fyrox-dylib` crate to be able to link the engine dynamically. +- Ability to link the engine dynamically to the editor. +- Added property editor for untyped textures. +- Added `Plugin::on_loaded` method. +- `NetListener::local_address` method. +- `Model::new` method. +- Ability to disable space optimization of `InheritableVariable` on serialization. +- Added CI for project template for all supported platforms. +- Added diagnostics for degenerated triangles when calculating tangents. +- `Pool::first_ref/first_mut` methods. +- Added release keystore for android project templates. +- Collect rendering statistics on per-scene basis. +- `transmute_slice` helper function. +- Ability to read GPU texture data. +- Experimental histogram-based auto-exposure for HDR (disabled by default). +- Short-path angle interpolation mode for `Curve` - `Curve::angle_at`. +- Property editor for `RcUiNodeHandle` type. +- Adaptive scroll bar thumb. +- Ability to fetch current task pool from resource manager. +- Async icon generation for assets in the asset browser. +- Case-insensitive string comparison helper method `fyrox::core::cmp_strings_case_insensitive`. +- Major performance improvement for searching in the asset browser. +- Configurable interpolation mode for animations. +- Ability to close popups using `Esc` key. +- Added diagnostics for docking manager layout, that warns if a window has empty name. +- Keyboard navigation for tree widget. +- Ability to close windows by `Esc` key. +- Focus opened window automatically. +- Keyboard navigation for `Menu` widget. +- Added `ImmutableString` editor. +- Docs for inspector module. +- Ability to deactivate menus using `Esc` key. +- `PopupMessage::RelayedMessage` to re-cast messages from a popup to a widget. +- `NavigationLayer` widget that handles `Tab`/`Shift+Tab` navigation. +- Ability to switch check box state using space key. +- Ability to click button widget using `Space`/`Enter` keys. +- `accepts_input` for widgets that can be used for keyboard interaction. +- Added keyboard navigation for input fields in the inspector. +- Highlight a widget with keyboard focus. +- `Visitor` docs. +- Ability to open/close drop down list using arrow keys. +- Re-cast `Variant` message on enum property editor. +- Focus popup content (if any) on opening. +- Keyboard navigation for list view widget. +- Focus window content (if any) on opening. +- Optional ability to bring focused item into view in navigation layer. +- Hotkey to run the game from the editor (default is `F5`). +- Ability to increase/decrease `NumericUpDown` widget value by arrow keys. +- Configurable command stack max capacity (prevents the command stack to grow uncontrollably, which could eat a lot of + memory if the editor is running for a long time). +- Auto-select text on focusing `TextBox` widget. +- Ability to render scene manually. +- Ability to set precision for `VecEditor` widget. +- Ability to switch between shaded and wireframe mode in the scene preview. +- Multi-curve support for the curve editor widget. +- `Color::COLORS` array with pre-defined colors. +- Ability to set different brushes for every curve in the curve editor. +- Apply different colors to curves in the animation editor. +- Show multiple curves at once when selecting tracks in the animation editor. +- Dropdown menu widget. +- Quick-access menu for grid snapping. +- `Create Parent` context menu option for scene nodes. +- Add background curves concept to the curve editor widget. +- Smart placement for newly created objects. +- Added mesh control panel - allows to create physics entities (colliders, rigid bodies, etc) in a few clicks. +- `Reflect::assembly_name` to retrieve assembly name of a type. + +## Changed + +- Major style improvements for the editor UI. +- Migrated to Rapier 0.18. +- Refactored multiborrow context - removed static size constraint and made borrowing tracking dynamic and more + efficient. +- Use `Result` instead of `Option` for multiborrowing for better UX. +- Added panic on `Ticket::drop` to prevent dangling pool records. +- Moved generic graph handling code into `fyrox-graph` crate. +- Do not call `Control::update` for every widget: + - in the editor on complex scenes it improves average performance by 13-20%. + - you have to set `need_update` flag when building the widget if you need `Control::update` to be called. +- Mutable access to UI in `Control::update`. +- Refactored `Selection` to use dynamic dispatch. +- Refactored the entire editor command system to use dynamic dispatch. +- Split `SceneGraph` trait into object-safe and object-non-safe parts. +- Run most of `Engine::pre_update` logic even if there's no graphics context. +- Moved color space transformation to vertex shader of particle system to increase performance. +- Recalculate world space bounding box of a mesh on `sync_transform` instead of `update`. +- Refactored rectpacker to use plain `Vec` instead of `Pool`. +- Moved rectangle-related code to `rectutils` crate. +- Automatically unregister faulty resources if registering ok one. +- Prevent uvgen to modifying the actual surface data. +- Extracted uvgen module to `uvgen` crate. +- Use simple vec instead of pool in octree. +- Moved `math` + `curve` + `octree` mods to `fyrox-math` crate. +- Moved lightmapper into a `lightmap` crate. +- Support for backwards movement (negative speed) for navmesh agent. +- Moved the engine implementation into `fyrox-impl` crate, `fyrox` crate now is a proxy to it. +- Moved interaction modes panel to the toolbar. +- Made shader methods public to be able to create them manually. +- Show unassigned handles in orange color to attract attention. +- Major refactoring of `TextBox` widget that makes it much more pleasant to work with. +- Major usability improvements for `DockingManager` tiles. +- `Window` widget content is now linked to `NavigationLayer` widget instance. +- Prevented `TextBox` and `NumericUpDown` widgets from sending change messages when they have not changed. +- Reduced width and precision for worldspace position of current selection. +- Use `ImmutableString` for scene nodes and widgets to reduce memory consumption on duplicated strings. +- Do not flush the renderer when changing scenes, to prevent various graphical issues. +- More informative names for curves in the animation editor. +- Change cursor icon when picking/dragging keys in curve editor. +- Major refactoring of coordinate system in the curve editor. +- Keep the animation player selected in the animation editor. +- Changed AABB validity to include zero-size dimensions to allow camera fitting to work with flat objects. +- Prefer prefab roots when selecting nodes in scene. +- `Reflect` trait bound for `Plugin` trait. + +## Fixed + +- Fixed cascade shadow maps (CSM) rendering. +- Fixed crash when setting particle spawn rate too high. +- Fixed UB when using MultiBorrowContext. +- Fixed visibility of cloned widget. +- Set unique id for widget copies. +- Fixed crash when closing scenes. +- Fixed `Default` impl for `Pool`. +- Fixed rare crash in `TextBox` widget when typing in something +- Fixing double pixel loop (it was looping over y twice) in terrain internals. +- Fixed creating a MenuItem in editor. +- Force ui widget to recalculate layout if it was animated +- Registered property editors for all UI properties. +- Fixed incorrect FBX cluster loading (fixes incorrect rendering of FBX models) +- Fixed crash when selection range is incorrect in the `TextBox` widget. +- Fixed crash in the animation editor when trying to rebind a track referencing deleted scene node. +- Properly expand tree items when building path in file browser widget. +- Fixed doubling of items under disks in file browser widget. +- Fixed track deletion in the animation editor. +- Fixed file browser behaviour on empty file path +- Select current dir in the asset browser. +- Automatically remove disconnected listeners from the log. +- Fixed support of custom layout panel of `ListView` widget. +- Fixed async tasks at WebAssembly target. +- Fixed property inheritance for types with interior mutability. +- Keep selected brush when hovering mouse over a `Decorator` widget. +- Fixed `TabControl` widget headers style. +- Improved SearchBar widget style. +- Fixed incorrect script task handling (it was passing task result to all scripts, instead the one that launched the + task). +- Prevent particle systems from over-spawn particles when spawn rates are high. +- Fixed incorrect vertex buffer data layout. +- Fixed crash if a selected node was deleted during asset hot reloading. +- Prevent moving a folder into its own subfolder in the asset browser. +- Fixed lightmap saving when corresponding lightmap textures were deleted. +- Sort rectangles back-to-front when rendering to prevent blending issues. +- Back-to-front sorting when rendering nodes with transparency. +- Fixed seams on skybox cubemap. +- Hide `should_be_deleted` field. +- Do not update scripts on disabled nodes. +- Fixed sound context serialization (this bug caused all sound buses to disappear on load) +- Fixed potential crash in audio bus editor. +- Fixed crash when closing the editor. +- Fixed crash `attempt to subtract with overflow` in particle systems. +- Fixed incorrect `Selection::is_empty` implementation. +- Fixed canvas background color leaking to the rendered image on WebAssembly. +- Ignore `target` dir when doing search in the asset browser. +- Fixed accidental enabling/disabling tracks when expanding them in the animation editor. +- Fixed editor layout saving and loading. +- Prevent `Inspector` properties from disappearing when expander is closed. +- Use context menus instead of plain popups in color gradient editor. +- Fixed incorrect extension proposal for in the resource creator. +- Fixed incorrect resource creation in resource creator. +- Fixed sluggish tiles resizing in the docking manager. +- Keep the order of interaction modes the same. +- Fixed bring-into-view for `ScrollPanel` widget - not it does not jump unpredictable. +- Do not pass keyboard input to invisible widgets. +- Handle edge cases properly when calculating curve bounds. +- Fixed "zoom to fit" functionality in the curve editor widget. +- Fixed sliding of the view in the curve editor widget on resizing. +- Fixed frustum culling flag usage. +- Fixed inspector syncing/context changing. +- Fixed crash when trying to get selected entity from empty selection. +- Fixed crash when closing scenes using `X` button on the tabs. + +## Removed + +- Removed `define_command_stack` macro +- Removed redundant `old_selection` arg from change selection command + +# 0.33.1 Engine + 0.20.1 Editor + +## Fixed + +- Fixed deadlock when deep cloning a texture. Caused the editor to hang up on saving terrains (#598). +- Fixed occasional crash when undoing node creation +- Fixed highlighting for objects that were cloned + +# 0.33 Engine + 0.20 Editor + +## Added + +- UI editor. +- Tasks system for scripts and plugins. +- Implemented dynamic font atlas. +- Batching for 2D graphics. +- Ability to move resources and folders in the Asset Browser. +- Edge highlighting for selection in the editor. +- Added an ability to create resources from asset browser. +- Added height parameter for `Text` and `TextBox` widgets. +- Ability to specify IO abstraction when loading user interface. +- `Utf32StringPropertyEditorDefinition` to edit `Vec` UTF32 strings. +- `RefCellPropertyEditorDefinition` for `RefCell` types. +- Enable reflection + serialization for formatted text and its instances. +- Built in font resource. +- Font resource property editor with font preview. +- Ability to assign fonts from asset browser. +- Reflection for resources. +- UI graph manipulation methods. +- `Screen` widget automatically fits to the current screen size. +- Show type name in world viewer for widgets. +- Ability to specify ignored types for `Reflect::apply_recursively`. +- Preview for curve and hrir resources. +- Ability to open a window at desired position. +- Ability to edit textures as UntypedResource in widgets. +- Implemented `Serialize + Deserialize + Display` traits for `ErasedHandle`. +- Smart positioning for contextual floating panels in the editor. +- `WidgetMessage::Align` + `WindowMessage::OpenAndAlign` messages. +- Ability to invalidate layout for all widgets at once. +- Ability to mark all fields of a struct/enum optional when deserializing: `#[visit(optional)]` can now be + added to a struct/enum directly, thus overriding all other such attributes on fields. +- Added access to user interface, task pool, graphics context, current scene handle for scripts. +- `PluginsRefMut::get/get_mut/of_type_ref/of_type_mut` methods. +- Added a bunch of `#[inline]` attributes for `Pool` for slight performance improvements. +- Added `AtomicHandle` that can be modified using interrior mutability. +- Ability to pass pixel kind to the `Renderer::render_ui_to_texture` method. +- Show material resource state in the material field editor. +- Ability to scroll to the end of the content for `ScrollViewer` and `ScrollPanel` widgets. +- Ability to save and load light maps into/from a file. +- Ability to repeat clicks of a button while it is hold pressed. +- Ability to open materials for editing from the asset browser. +- Ability to filter a list of types when using reflection for fields iteration. +- Implemented `PartialOrd + Ord` traits for `Handle` type. +- Added icon in the asset browser for material resources. +- Ability to pass generics to `uuid_provider` macro. +- Ability to share navigational mesh across multiple threads. +- Implemented `Reflect` trait for `RwLock`. +- `UserInterface::find_by_name_down_from_root` method to search widgets by name. +- Implemented `Send` trait for UI entities. +- Added user interface resource. +- Collider control panel with ability to fit colliders to parent bounds. +- Property editor for vector image's primitives. +- Show warning in the log when there's script message with no subscribers. +- Implemented `TypeUuidProvider` trait for standard types. +- Ability to specify clear color in `Renderer::render_ui_to_texture`. +- Added icon in the asset browser for shader resources. +- Ability to copy widgets from UI to UI. +- Ability to create ragdolls from `Create` menu. +- Added an ability to rebind tracks in the animation editor. +- Added a set of standard materials, exposed them in the editor. +- Added placeholder texture. +- Ability to fetch resource import options from their respective loaders. +- Implemented `Visit` and `Reflect` traits for `char`. +- Ability to specify icons for assets in respective preview generators. +- `TypedResourceData` trait to be able to set correct default state of a resource. +- Implemented `ResourceData::save` for built-in engine resource types. +- Documentation for LODs. +- Color constants for the colors with names. +- Ability to save resources. +- `ResourceLoader::supports_extension` method. +- Implemented `Error` trait for `VisitError`. +- `Material::set_texture` shortcut. +- Implemented `From<&str>` trait for `ImmutableString`. +- Added normalization option for vertex attribute descriptor. +- Added experimental network abstraction layer. +- Added frustum culling for rectangle node. +- Added camera view pyramid visualization (kudos to [@dasimonde](https://github.com/dasimonde)). +- Added IO abstraction for resource system (kudos to [@jacobtread](https://github.com/jacobtread)). +- Added `Reflect`, `Debug`, `Visit` trait implementations for UI widgets. +- Added `Visit` trait implementation for `usize/isize`. +- Added `ResourceIo::move_file` method. +- Added `ResourceManager::move_resource` method with filtering. +- Added `Drop` message for `FileBrowser` with dropped path. +- Added `ResourceIo::canonicalize_path`. +- Added `Pool::generate_free_handles` methods. +- Added `InteractionMode::make_button` method that creates appropriate button for the mode. + +## Changed + +- Major editor refactoring to support new UI scenes. +- Moved low level animation modules into fyrox-animation crate. + - Type aliases for scene specific animation entities + preludes. + - Texture as generic parameter for sprite sheet animation. +- Turn font into resource + added `TextMessage::Height`. +- Make standard built-in shaders non-procedural by default. +- Refactored internal structure of resources. + - All resource related data is now stored in `ResourceHeader` instead of being scattered all around in + `ResourceState` + variants and even in resource data itself. + - Backward compatibility is preserved. + - `ResourceKind` instead of path+flag, refactored resource loader trait. +- Refactored interaction modes in the editor. +- Switched to UntypedResource from SharedTexture in ui +- Simplified usage of `ResourceManager::request/try_request`. No need to write `rm.request`, just + `rm.request`. +- Registered Light Panel in floating panels, so it can be docked. +- Made searching in the asset browser smarter. +- GPU resources cache refactoring. +- Speed up access to textures. +- Automatic implementation of `ScriptTrait::id()` method. This implementation now should be removed from your + scripts. +- Scroll to the end of build log in the editor. +- Prevented build window from closing when a build has failed. +- Tweaked node handle property editor to also work with ui widgets. +- Filter out texture bytes in the property selector to improve performance. +- Enabled clicks repetition mode for scroll bar increase/decrease buttons. +- Keep the editor active if there's any captured ui element. +- Increased scroll bar step for scroll viewer. +- Added filter argument for `aabb_of_descendants`. +- Use abstract EntityId instead of ErasedHandle in animation entities. +- Optimized internals of navigation mesh. +- Prevented serialization of the data of external resources. +- Pass screen size to `Control::update`. +- Ability to clone user interface entirely. +- Refactored scene saving dialogs in the editor to make them more stable. +- Made `Limb::iterate_recursive` method public. +- Switch character rigid body to kinematic when a ragdoll is active. +- Keep menu items highlighted when opening a menu chain. +- Gizmo improvements for navmesh interaction mode. +- Open navmesh panel at the top right of the scene preview when selecting a navmesh scene node. +- Improved visualization in the dependency viewer. +- Made asset import options inspector generic. +- Provide access to material context in the renderer. +- Movement, scale, rotation gizmo improvements. +- Mutable access for ui nodes. +- Preload resources before generating preview for them. +- Made world viewer to accept data provider instead of scene directly. +- Replaced `Cow` with `&Path` in `ResourceData` trait +- Allow to set materials by drag'n'drop on material editor field. +- Made material fields in the inspector more clickable. +- Improved navigation on navmesh using string pulling algorithm. +- Improved performance of navigation mesh queries. +- Improved text box widget performance. +- `Plane` API improvements. +- Made material editor wider a bit by default. +- Extend resource data constructor with type name. +- Turned material into resource, removed `SharedMaterial` struct. +- Serialize vertex buffer data as a bytes slab. +- Use `Window::pre_present_notify` as recommended in the `winit` docs. +- Refactored sprites rendering to use materials. +- Refactored particle system rendering to use forward renderer. +- More built-in shader variables for lighting. +- Triangle buffer API improvements. +- Use debug message callback instead of message queue for OpenGL errors. +- Enable OpenGL debugging in debug build profile. +- Customizable time-to-live for geometry buffers (allows to create temporary buffers that lives one frame (ttl = 0)). +- Allow to start multiple scenes at editor start up (kudos to [@dasimonde](https://github.com/dasimonde)). +- `push_vertices` + `push_vertices_transform` method for vertex buffer. +- Ability to connect a state with every other state in the ABSM editor (kudos + to [@Riddhiman007](https://github.com/Riddhiman007)) +- Added UUIDs for scene nodes. +- Ability to set navmesh agent path recalculation threshold. +- Reset `modified` flags of inheritable variables when fixing node type. +- Check for node type mismatch on graph resolve and auto-fix this. +- Use type names instead of type ids when reporting inheritance errors. +- Remove orphaned nodes when restoring graph's integrity. +- Code example for `Inspector` widget. +- Pass node handle to surface instance data. +- Check for global `enabled` flag when filtering out cameras for rendering. +- Serialize joints binding local frames. +- Support for touch events in the UI (kudos to [@Bocksdin](https://github.com/Bocksdin)). +- A* pathfinding optimization (kudos to [@TiltedTeapot](https://github.com/TiltedTeapot)). + +## Fixed + +- Fixed crash of the editor on Wayland. +- Fixed font rendering API. +- Fixed restoration of shallow resource handles of untyped resources. +- Prevent double saving of settings after modification. +- Keep aspect ratio when previewing a texture in the asset browser. +- Filter out non-savable resources in resource creation dialog. +- Fixed offscreen UI rendering in the UI editor. +- Fixed deep cloning of materials: make them embedded after cloning. +- Fixed path filters to correctly handle folders with "extensions". +- Save material when changing its shader property in the material editor. +- Fixed massive footgun with pointers to the graphics pipeline state scattered all around the renderer. +- Prevent creating of multiple thread pool across the engine. +- Fixed crash in the material editor if a material is failed to load. +- Prevent the editor from closing after saving a scene via Ctrl+S. +- Fixed position saving of maximized editor window. +- Fixed crash when assigning non-material resource in a material property. +- Fixed forward pass of standard shader for skinned meshes +- Fixed uuid formatting in visitor. +- Fixed resource extension comparison in the editor by making it case-insensitive. +- Fixed crash when drag'n'dropping assets in scene previewer. +- Fixed OpenGL error handling +- Fixed performance issues when modifying vertex/triangle buffers. +- Fixed crash when editing terrains (kudos to [@Riddhiman007](https://github.com/Riddhiman007)) +- Fixed a bug when vertex attribute divisor was ignored. +- Fixed colors for log messages. +- Fixed scene loading in derived mode. +- Fixed text coloring when sending a `WidgetMessage::Foreground` to text. +- Fixed memory leaks on Linux (kudos to [@LordCocoNut](https://github.com/LordCocoNut)) +- Fixed invalid GPU resource indexing bug, that caused crashes/quirks in graphics when switching scenes in the editor. + +## Removed + +- Removed implicit cloning when in `Reflect::into_any` impl for some types. +- Removed redundant memory allocation when fetching fields using reflection. +- Removed redundant memory allocation when iterating over fields. +- Removed `Option` wrapper in typed resource to flatten the internal structure of resources. +- Removed a bunch of redundant clones in the renderer. +- Removed lazy calculations in the navigational mesh. +- Removed unused `soft_boundary_sharpness_factor` param from particle systems (this property was moved to the + standard particle system material). +- Removed `InteractionModeKind` and replaced it with uuids. + +# 0.32 + +- Do not call `Script::on_os_event` if script is not started yet. +- Borrow instead of move in `Visitor::load_from_memory`. +- Ability to load scenes in two modes - derived and raw. +- Fixed selection issues in the animation editor. +- Fixed path fixer. +- Ability to set resource path. +- `ResourceManager::unregister` to unregister loaded resources. +- Refactored scene loading + plugin interface improvements. +- Bring currently selected node into view when clearing filter in the world viewer. +- Fixed searching in the property selector. +- Bring current selection into view in node selector when clearing filter text. +- Fixed `zoom to fit` in the curve editor when there's no keys. +- Fixed node name formatting in the animation editor's track list. +- Fixed tooltips in the inspector. +- `EditorPlugin::on_post_update` that invoked after any other update methods. +- Fixed selection syncing in node selector. +- `TreeRootMessage::ItemsChanged` to catch the moment when tree root items changes. +- Improved visual style of node handle property editor. +- Ability to set scene node handle via node selector. +- `Sound::try_play` method that will only play the sound if it is not already playing. +- `Flip green channel` option for texture import options: this adds an ability to flip green channels for + normal maps made in OpenGL Y+ format. +- Resource manager improvements: added base trait with auto-implementation to reduce boilerplate code, mandatory + `ResourceLoader::data_type_uuid` method to fetch actual data type produced by resource loader, + `ResourceManager::try_request` - returns an optional resource handle, returns `None` if `T` does not match the + actual data id (`request` just panics in this case). +- Print an error message to the log when unable to load a resource. +- Resource field property editor improvements: emit transparent geometry to improve mouse picking, + added margins for elements. +- Exposed resource manager reference to plugin registration context to be able to register custom resource + loaders that will be used in both the game and the editor. +- `Material::sync_to_shader` method to sync material properties with its shader. +- `parallaxCenter` + `parallaxScale` property for standard shaders. +- Fixed TBN-basis visualization in mesh debug drawing. +- Make all gizmo's X axis match the actual coordinate system's X axis. +- Fixed tooltip in asset browser to show full path without clipping. +- Fixed parallax mapping. +- Fixed binormal vector calculation. +- Added missing `tif` extension for texture loader. +- Fixed build window output in the editor. +- Added fade in/fade out for shadows, that prevents them from popping out of nowhere. +- Added scene gizmo. +- Keep frame alpha when applying lighting for transparent background rendering. +- Rewind sound sources before stopping them. +- Improved camera focusing on a scene object. +- Changed orbital camera controls: drag camera was moved to `Shift+RMB`, added configurable zoom range. +- Added orbital camera mode for editor camera (can be activated by middle mouse button). +- Use `f32` instead of `Duration` for scene sound source's playback time. +- Fixed terrain brush bounds visualization. +- Hotkeys for terrain editor. +- Use `workspace.dependencies` in the projects generated by `fyrox-template` to simplify dependency change. +- Improved editor settings handling. +- `Curve::bounds` + ability to `Zoom to fit` with delay for the curve editor. +- Property editor for `Curve` fields. +- New `fyrox-scripts` crate + flying camera controller script. +- Ability to map ui key back to winit + change key binding property editor. +- Fallback to root directory if `fyrox-template script` cant find `game/src`. +- Added debug impls for gpu texture. +- Fixed seams between terrain chunks. +- Removed obsolete examples and replaced them with [new examples](https://github.com/FyroxEngine/Fyrox-demo-projects). +- Fixed curve editor compatibility with scrolling regions. +- Fixed clipping issues in curve editor. +- Save expanded state of the scene items in the world viewer in the editor settings. +- Fixed invalid keys positioning in the curve editor when selecting them. +- Fixed box selection in the curve editor when mouse is outside. +- Focus currently selected entity when clearing filter text in animation editor. +- Fixed a bunch of potential crashes in the `CurveEditor` widget. +- Fixed HiDPI issues on WebAssembly. +- Removed hardcoded list of supported resource extensions from the editor and use ones from resource loaders. +- `Hrir` resource + async HRTF loading for HRTF sound renderer. +- Fixed texture compression. +- Do not use `glCheckError` in release builds since it has bad performance. +- Set nearest filtration for floating-point textures in the renderer (WebAssembly fix). +- Switch a resource without a loader into error state to prevent infinite loading in some cases. +- Fixed resource loading in WebAssembly. +- Do not render anything if screen size is collapsed into a point. +- Split light map generation in two steps + added async generation for the editor. +- Do not allow to create game projects with a number in beginning of its name. +- Optimized light map data serialization (breaking change, regenerate your lightmaps). +- `BinaryBlob` wrapper to serialize arbitrary sets of data as bytes. +- Print an error to the log instead crashing when unable to generate a lightmap. +- Moved light map into `Graph` from `Scene`. +- Fixed light map internal handles mapping when copying a graph. +- `PathEditor` widget + property editor for `PathBuf` for Inspector. +- Reduce default amount of texels per unit for lightmapper in the editor. +- Ability to specify vcs for a new project in `fyrox-template` +- Set `resolver = 2` for workspaces generated by `fyrox-template` +- Improved joints computational stability. +- `Make Unassigned` button for node handle property editor. +- Do not save invalid window attributes of the main editor window. +- Fixed joints binding. +- Joint rebinding is now optional. +- Fixed potential infinite loop when constructing quaternion from a matrix. +- Ability to set custom name to group command in the editor. +- `Ragdoll` scene node. +- Improved mouse picking for node handle property editor. +- Ragdoll wizard to create ragdolls with a few clicks. +- Power-saving mode for the editor. Editor pauses its execution if its window is unfocused or there's no OS events + from the main window. This change reduces CPU/GPU resources consumption down to zero when the editor is non-active. +- Do not create a separate region for inheritable variables on serialization if non-modified. This saves quite a + lot of disk space in derived assets (including saved games). +- Property editors for inheritable vec collections of resources. +- Clamp input time to the actual duration of the buffer when setting sound source's playback time. +- Fixed inability to fetch stream length of ogg/vorbis. +- `GenericBuffer::duration` is now using integer arithmetics which does not suffer from precision + issues (unlike floating point numbers). +- Decoders now returns channel duration in samples, not in seconds. +- Send text box message on changes only if its commit mode is immediate. +- Fixed severity for messages from inability to load editor settings. +- Added vec property editors for collections of resources. +- Property editor for `Vec` will now use appropriate property editor for `T` instead of implicit usage + of `InspectablePropertyEditor`. +- Fixed incorrect focusing of an asset in the asset browser. +- Fixed emitted message direction for `TextBox` widget. +- `Show in Asset Browser` button for resource fields in the inspector. +- Take sound source gain into account when using HRTF renderer. +- Fixed visualization of bones list of a surface in the editor. +- Reduced HRTF sound renderer latency. +- Fixed animation events collection for blend-by-index ABSM nodes. +- Improved ABSM events collection API. +- Ability to fetch animation events from ABSM layers. +- Fixed property reversion: now it reverts only modified ones. +- Ability to revert all inheritable properties at once of a scene node. +- `Reflect::enumerate_fields_recursively` allows you to iterate over descendant fields of an object + while getting info about each field. +- Update only currently active scene in the editor. +- Navmesh path smoothing improvements and fixes. Prevent smoothing from cutting corners. +- `A*` path finder API improvements. +- Debug drawing for NavMesh scene node. +- Light scattering now takes light intensity into account. +- Prevent loading the same scene multiple times. +- Clear UI in the editor when changing scenes to prevent potential visual desync. +- Fixed potential panic when handling UI messages with invalid target widget handle. +- Fixed doubling of the text when printing text in `TextBox` widget on some platforms. +- Ability to duplicate animation tracks in the animation editor. +- Ability to set an ID of animation tracks. +- Fixed potential panic on invalid handles of `Rapier` entities when fetching contacts. +- Ability to close tabs in `TabControl` widget using middle mouse button. +- Visualize directional lights as arrows in the editor. +- Ability to draw arrows in scene debug drawing context. +- Migrated to `winit 0.29`. +- Fixed `Rect::clip_by` method. +- Removed `VecExtensions` trait, because its functionality was already added in the standard library. +- `Popup` widget improvements: `Placement::target` method, ability to create popups without adding them + to the UI. +- Fixed potential infinite loop in the `Menu` widget. +- Added context menu to the file browser to be able to create folders and remove files. +- Significantly improved test coverage for `fyrox-core` and `fyrox-resource` crates (kudos to + [@san-smith](https://github.com/san-smith)) +- Optional node deletion dialog to warn if a node is referenced somewhere in the graph. +- Fixed potential double free issue in the vertex buffer. +- Fixed unsoundness of type-erasure in the vertex buffer. +- `Graph::find_references_to` to search for node references in the graph. +- `Reflect::apply_recursively` for recursive iteration over the descendant fields of an object. +- Added `try` reserved keyword for `fyrox-template`. +- Built-in sky box for `Camera` scene node. +- Improved search in the World Viewer. +- Make `TriangleDefinition` trivially-copyable. +- Major UI documentation improvements. +- Docs for `VectorImage`, `ScrollPanel`, `RectEditor`, `RangeEditor`, `ProgressBar`, `ListView`, `Canvas`, + `SearchBar`, `ScrollViewer`, `Expander`, `KeyBindingEditor`, `HotKeyEditor`, `Tree`, widgets. +- Major book improvements. + +# 0.31 + +- Multi-scene editing +- Docs for `Window` widget +- Fixed opengl es usage when opengl is not supported +- Docs for `Decorator` widget +- Added `crv` extension for `CurveLoader` +- Basic editor plugins support +- Updated deps +- Expose all editor fields so they can be accessible outside +- Docs for `UuidEditor` widget +- Use user_data field of physics entities to store handle to engine entity +- Ability to encode/decode handles to/from u128 +- Ability to fetch all contact pairs from 2d/3d physics worlds +- Docs for `MessageBox` widget +- `Graph::aabb_of_descendants` +- Aabb api improvements +- Ability to open asset of a node from the world viewer +- Improved `impl_component_provider` macro to accept `field.foo.ab` chains +- Docs for navmesh node +- Useful shortcuts for behaviour trees +- Fixed standard materials for new serialization format +- Inverter node for behaviour trees +- Docs and examples for `VertexBuffer` +- Added `VertexTrait` to prevent using a vertex type with different layout +- Improved `surface` mod docs +- Added `elapsed_time` in `PluginContext` +- Use all texture channels in sprite fragment shader +- Load editor's docking manager layout on reconfiguration +- Open window of a tile when restoring docking manager layout +- Ability to save/load editor's docking manager layout +- Prevent panic in ui search methods +- Ability to apply saved docking manager layout + improved layout saving +- Ability to save docking manager layout +- Changed error to warning when unable to load missing options file +- Fixed crash when exiting the editor +- Fixed opening arbitrary files from asset browser +- Ability to open scenes from asset browser +- User-defined data for tabs +- Ability to add and remove tabs in the `TabControl` widget via messages +- Added a nine patch widget +- Fixed tab control's content alignment +- `can_be_closed` flag for `TabControl` tabs +- Ability to close tabs in `TabControl` widget +- Docs for `TabControl` widget +- Ability to catch the moment when the active tab of `TabControl` changed +- Docs for `ScrollBar` widget +- Docs for `Popup` widget +- Docs for `NumericUpDown` widget +- Ability to change `StackPanel`'s orientation via message +- Ability to change `WrapPanel`'s orientation via message +- Docs for `WrapPanel` widget +- Docs for `CheckBox` widget +- Docs for `Widget` +- Docs for `TextBox` widget +- Docs for `StackPanel` widget +- Docs for `Grid` widget +- Docs for `Image` widget +- Docs for `Text` widget +- Fyrox-ui docs +- Docs for `Button` widget +- Access to current transform of `TransformStack` +- Docs for `Border` +- Ability to pass doc comments in `define_constructor` macro +- Docs for `BuildContext` +- Docs for `UiNode` +- Iterative font atlas packing. +- Docs for `Thickness` +- Docs for widget alignments +- Docs for `BaseControl` +- Update hierarchical data when instantiating a prefab +- Docs for `trait Control` +- Hotkey to focus editor's camera on a selected object +- Helper methods for `Frustum` +- Ability to focus editor's camera on an object +- Helper methods for `TextureKind` +- Camera fitting functionality +- Aabb helper methods +- Save editor settings only if they were modified by user +- `Camera::frustum` +- Fixed camera preview + added camera preview control panel +- Automatically select newly created scene nodes in the editor + +# 0.30 + +- Ability to change graph root to arbitrary graph node. +- Ability to change graph root in the editor. +- Optional checkerboard background for `Image` widget. +- Simplified animation blending. +- Mutable access to curve key's value. +- Added property validation for the animation editor. +- Track validation for the animation editor. +- Ability to set widget's tooltip via message. +- Correctly sync track names in the animation editor. +- Ability to change target nodes on animation tracks. +- Preserve parent when extracting a sub-graph from a graph. +- Refactored editor scene structure to allow modifying the root node. +- Play sound buffer resource when inspecting it in the asset browser. +- Show textured quad in resources previewer when inspecting a texture. +- Configurable scroll speed for `ScrollViewer` widget + speed up scrolling 2x. +- Helper methods to quickly check a resource state. +- Helper methods to access script components faster. +- Improved range property editor. +- `Enter State` for state menu in absm editor. Works the same as double click, removes confusion for ppl that does not + get used to double-click on things. +- Leave preview mode when closing or changing scenes in the editor. +- Prevent panic when trying to generate random number from an empty range. +- Serialize delay line samples as POD array. +- Optional ability to save current scene in text form for debugging. +- Do not render disabled sprite nodes. +- Fixed property inheritance subtle bugs. +- Do not allow revering a property value in the editor if there's no parent. +- Do not save content of non-modified inheritable variables. +- Fixed directional light docs. +- Fixed `Node::is_x,as_x,as_x_mut` methods. +- `Graph::try_get_script_of + try_get_script_of_mut` methods +- `Base::root_resource` - allows you to find root resource in dependency graph. +- Prevent deadlock on self-referencing model resources +- UUID for widgets. +- Save editor's window position and size into editor's settings. +- Apply local scaling of terrain to heightfield collider. +- `MachineLayer::is_all_animations_of_state_ended` +- Ability to fetch all animations of a state in ABSM layer. +- Added `IsAnimationEnded` condition for ABSM transitions. +- ABSM state actions. Allows you to rewind/enable/disable specific animations when entering/leaving a state. +- Fixed incorrect "state enter" event sent from source instead of dest. +- Added a collection of built-in resources for resource manager. This collection is used on resource deserialization + step to restore references to built-in resources. +- Pre-compile built-in shaders on engine startup. +- Ability to change camera zoom speed in the editor. +- `Plugin::before_rendering` +- Matrix storage cache to prevent driver synchronization steps. +- Persistent identifiers for render entities. +- Improved deserialization performance. +- Use `fast_image_resize` crate to generate mip maps (which gave 5x performance boost). +- Configurable filter for mip-map generation for textures. +- Fixed tooltip position - it now does not go outside of screen bounds. +- "Immutable collection" reflection attribute for collection fields that prevent changing collection size. +- Ability to get typed data of specific mip level of a texture. +- Ability to fetch specific mip level data of textures. +- Ability to set height map of terrain chunks directly from an image. +- Dependency graph visualizer for asset browser. +- Resource dependency graph. +- Ability to flatten terrain slopes. +- Return local height value at intersection point in ray-terrain test. +- Cleaned editor's command API. +- Removed visibility cache. +- Ability to index graph with `Handle` +- `Handle::transmute` +- Doc comments support for reflection. +- Show doc comments for selected entity in a separate window. +- Moved logger to `fyrox_core`. +- Resource system refactoring to support user-defined resources. +- Blackboard for visitor to pass arbitrary data when serializing/deserializing. +- Added missing recalculation of terrain bounding box. +- `Texture::deep_clone` +- `Log::verify_message` +- `R32F` + `R16F` texture formats. +- `data_of_type` methods to reinterpret inner texture data storage to a particular type. +- Debug drawing for scene nodes. +- Configurable polygon rasterization mode for scenes (gbuffer only). +- Ability to set polygon rasterization mode to select between solid and wireframe rendering. +- Force `Framebuffer::draw_x` methods to accept element range to draw. +- Proper culling for terrains. +- Refactored rendering: scene nodes can now supply renderer with data. `NodeTrait::collect_render_data` is now used to + supply renderer with data. +- Batch generation is now done on per-camera (which includes light sources for shadows) basis. +- Added a method to link nodes while keeping child's global position and rotation. +- LODs for terrains. +- Limits for collider shape values. +- Added doc example for `Graph::begin_multi_borrow`. +- Fixed samplers type collision when rendering with materials with different sampler types. +- Unbind texture from other samplers when setting it to a new one. +- Fixed half-float textures + fixed volume textures mip maps. +- `RGB16F` texture format. +- Use texture-based matrix storage for "unlimited" bone matrices. Raises matrix count per surface from 64 + to 255. +- Fixed texture alignment issues. +- Use correct sampler index when changing texture data. +- Set new mip count for texture when changing its data. +- Fixed texture binding bug. +- Warning instead of panic when there's not enough space for bone matrices. +- Rename `visitor::Node` to `visitor::VisitorNode` to prevent confusing import in IDEs. +- `InheritableVariable::take` +- Ability to change size of terrain height map and layer masks. +- Ability to add chunks from any side of the terrain. +- Fixed crash when deleting a navmesh edge. +- Improved package description. +- Make navmesh panel floating by default + open it when a navmesh is selected. +- Navigational mesh refactoring. +- Navigational mesh scene node. +- Pass light intensity into lightmapper. +- "Headless" mode for `Executor` - suitable for server-side of multiplayer games. +- Added editor's window icon. +- Blend shape support. +- Changed sidebar to be inspector in the view dropdown menu. +- Tweaked step values for transform properties. +- Limits for vec editor. +- Generic `Vector` property editor. +- Added support for min, max, step property attributes for vecN. +- Ability to create/destroy audio output device on demand. +- Migrate to `tinyaudio` as audio output backend +- Use `RcUiNodeHandle` for context menus. This ensures that context menu will be destroyed when it is + not used anymore. +- Fixed multiple lightmapping issues. +- Fixed incorrect `sRGB` conversion for WASM. +- Android support. +- Ability to run the engine without graphics/window/sound by making these parts optional. +- Update to latest `winit` + `glutin`. +- Ability to change value in `NumericUpDown` widget by dragging +- Removed "Scene Graph" item from world viewer + made breadcrumbs much more compact. +- Put interaction mode panel on top of scene previewer. +- Added ability to search assets in the asset browser. +- `SearchBar` widget. +- Ability to hide path text box in file browser widget. +- Hide path field in the asset browser. +- Tooltip for asset items in the asset browser that shows full asset path. +- Improved simple tooltip style. +- Optional ability to suppress closing menus by clicking on non-empty menu. +- Added `No Scene` reminder in the editor and how to create/load a scene. +- Editor UI style improvements. +- `DrawingContext::push_arc+push_rounded_rect` +- Ability to enable/disable debug geometry for camera/light sources. +- Show indices of input sockets of ABSM nodes. +- Keep animations enabled on import. +- Blend space support. +- Added help menu (with `Open Book` and `Open API Reference` items) +- Ability to create special (much faster) bindings to position/scale/rotation of nodes in the animation + editor. +- Ability to reimport animations in the animation editor. +- New example: render to texture. +- Audio bus graph. +- Root motion support. +- Audio panel rework to support audio bus graphs. +- Sound effect API improvements. +- Keep recent files list sorted and up-to-date. +- Fixed incorrect sound panning in HRTF mode. +- Ability to get unique material instances when cloning a surface. +- Validation for sound node +- Audio preview panel +- Do not play sounds in the editor automatically. Sounds can only be played from the audio preview panel + instead. fixes the issue when you have a scene with multiple sounds, but since they're playing, their playback + position + changes and these changes sneak in the saved scene preventing from defining strict playback position +- Ability to partially update global properties of a hierachy of nodes. +- Do not crash if a root node in the previewer died. +- Fixed deadlock when selecting object's property in animation editor. +- Ability to set pre-generated particles in particle systems. +- Provided access to standard shader names. +- Print texture resource name when failed to create its GPU version. +- Rebuild terrain's geometry on deserialization. +- Automatic, reflection-based resource handle mapping. +- Ability to ignore some type when doing property inheritance. +- Support for hash maps in the property selector. +- Expose material fields via reflection. +- Keep flags of `ScrollBarMessage` when responding to value message. +- Delegating implementation of `Debug` trait for `ImmutableString`. +- Added reflection for hash maps. +- Reflection system refactoring to support types with interior mutability (`Mutex`, `RefCell`, etc.) +- Ability to rewind particle systems to a particular time. +- Determinism for particle systems. +- Fixed preview mode for particle systems. +- Ability to "rewind" particle systems in particle system control panel. +- Fixed `ParticleSystem::clear_particles` for emitters that does not resurrect their particles. +- Fixed potential panic in formatted text on missing glyphs. +- Supply `PluginContext` with performance statistics for the previous frame. +- Property editor for `ColorGradient`s. +- Simplified `color_over_lifetime` field in particle systems. +- Improved color gradient API. +- Fixed incorrect activation of transition/states during the preview mode in the ABSM editor. +- Compound conditions for ABSM transitions +- Fixed off-screen UI rendering compatibility with HDR pipeline. +- Refactored scene node lifetime management - this mainly fixes the bug when a node with `Some(lifetime)` would crash + the editor. The same is applied to play-once sounds. `Node::update` now does not manage node's lifetime anymore, + instead + there's `Node::is_alive`. +- Fixed incorrect handling of user-defined forces of rigid bodies. A body was pushed continuously using + previously set force. +- Configurable size for light pictograms in the editor +- `ActiveStateChanged` event now contains both previous and new states. +- Message passing for scripts with multiple routing strategies +- `Graph::find_map/find_up_map/find_up_by_name` +- Improved `Graph::find_x` methods - returns `Option<(Handle, &Node)>` now, that removes another + borrow if there's a need to borrow it at a call site. + +# 0.29 + +- Animation system rework. +- Animation Editor. +- Animation Blending State Machine Editor. +- Fixed potential crash when joint was initialized earlier than connected rigid bodies. +- Model instantiation scaling now used for prefab preview. +- Fixed lots of potential sources of panic in perspective and ortho projections. +- Fixed editor's camera movement speed setting for 3D mode. +- Standard "two-side" shader - useful for foliage and grass. +- Sprite sheet editor +- Support for `Vector(2/3/4)` types in serializer. +- Sprite sheet animation now uses frames coordinates instead of explicit uv rectangles for each frame. +- Sprite sheet animation now has a texture associated with it. +- Fixed reflection fallback in case of missing field setter. +- Ability to set uv rect for Image widget +- Scene settings window for the editor - gives you an ability to edit scene settings: change + physics integration parameters, ambient lighting color, various flags, etc. +- Prevent crash when adding a new surface to a Mesh node in the editor +- Fixed directory/file duplicates in file browser widget when double-clicking on an item. +- Show use count for materials in Inspector +- Replace `Arc>` with `SharedMaterial` new-type. +- Ability to assign a unique copy of a material to an object. +- Replace `Arc>` with `SurfaceSharedData` +- Clear collections before deserialization +- Property inheritance for collections +- Fixed incorrect material replacement when loading a scene with an FBX with custom materials. +- Added Blender material slots names in FBX loader +- Access to `procedural` flag for `SurfaceData` +- Property editor for mesh's surface data. +- Validation for scene nodes + - Helps to find invalid cases like: + - Missing joint bodies or invalid types of bodies (i.e. use 2d rigid body for 3d joint) + - Wrongly attached colliders (not being a child of a rigid body) + - Shows small exclamation mark if there's something wrong with a node +- Share tooltip across widgets on clone +- Fixed color picker: brightness-saturation grid wasn't visible +- Added support for Collider intersection check (kudos to [@Thomas Hauth](https://github.com/ThomasHauth)) +- Animation system refactoring + - Use curves for numeric properties. + - Ability to animate arbitrary numeric properties via reflection. +- Prevent crash in case of invalid node handle in animation +- `Curve::value_at` optimization - 2x performance improvement of using binary search for spans. +- `Curve::add_key` optimized insertion using binary search. +- Node Selector widget - allows you to pick a node from a scene. +- Merge `Inspect` trait functionality into `Reflect` trait - it is now possible to obtain fields metadata + while iterating over them. +- Property Selector widget - allows you to pick a property path from an object that supports `Reflect` trait. +- `Reflect` implementation for `Uuid` +- `fyrox::gui::utils::make_cross` - small helper to create a vector image of a cross +- `FieldInfo::type_name` - allows to get type name of a field without using unstable + `std::any::type_name_of_val` +- `PathVertex::g_score` penalty for A* pathfinding (kudos to [@cordain](https://github.com/Cordain)) +- Added `Default`, `Debug`,`Clone` impls for `RawMesh` +- Name and uuid for `Curve` +- Send curve when adding new keys in the `CurveEditor` widget +- Preserve curve and keys id in the curve editor widget +- Correctly wrap `Audio Panel` in docking manager tile (kudos to [@iRaiko](https://github.com/iRaiko)) +- `AsyncSceneLoader` - cross-platform (wasm included) asynchronous scene loader +- Added support for wasm in fyrox-template - now fyrox-template generates `executor-wasm` crate which is a special + version of executor for webassembly +- Non-blocking resource waiting before processing scene scripts +- Added missing property editor for sound status +- Sync sound buffer first, then playback position +- Property editor for `Machine` type. +- Rectangle+RectangleFilled primitives for `VectorImage` widget +- Draw x values in curve editor widget at the top of the view +- Ability to show/hide axes values in the curve editor widget +- Use messages to modify view position and zoom in the curve editor (helps to catch the moment when zoom or view + position changes) +- Fixed UI messages not being passed to plugins based on when they happened during frame (kudos to + [@bolshoytoster](https://github.com/bolshoytoster)) +- Ability to explicitly set animation time slice instead of length. +- Cloning a node now produces exact clone. +- Ability to set min, max values, step, precision for numericupdown widget +- Prevent panic when trying to iterate over pool items using reflection +- Split `Model::retarget_animations` in two separate methods +- Smart movement move for move gizmo (kudos to [@Zoltan Haindrich](https://github.com/kgyrtkirk)) +- `Reflect::set_field_by_path` +- Ability to add zones for highlighting in the `CurveEditor` +- Ability to zoom non-uniformly via shift or ctrl pressed during zooming in the `CurveEditor` widget +- Animation signals rework + - uuid instead of numeric identifier + - added name for signals + - removed getters/setters + - added more signal management methods +- `Animation::pop_signal` +- Refactored animation blending state machine to support animation layers +- `Visit` impl for `HashSet` +- Ability to set layer mask in the absm editor +- Added animation system documentation. +- `Graph::try_get_of_type+try_get_mut_of_type` +- Rename `InheritableVariable` methods to remove ambiguity +- `Model::retarget_animations_to_player` +- Use correct property editor for `PoseWeight` +- Show handles of absm entities in the editor +- Show more info on absm nodes + - PlayAnimation nodes shows name of the animation + - blend nodes shows the amount of animations blended +- `AnimationContainer::find_by_name_ref/mut` +- Ability to search various animation entities by their names +- Add more information to panic messages in `fyrox-template` (kudos to [@lenscas](https://github.com/lenscas)) +- Check for reserved names in `fyrox-template` (kudos to [@TheEggShark](https://github.com/TheEggShark)) +- Ability to enable/disable scene nodes +- Basic support for headless mode for server part of games (kudos to [@martin-t](https://github.com/martin-t)) +- Removed `Scene::remove_node` +- Rename `NodeTrait::clean_up` -> `NodeTrait::on_removed_from_graph` +- Fixed colorization in the world viewer +- Ability to disable steps of update pipeline of the graph +- Preview mode for animation player, animation blending state machine, particle system nodes. +- Rename colliding `ParticleSystem::set_enabled` method to `play` +- Particle system preview control panel +- Property editor for `Uuid` type. +- Restrict `Reflect` trait on `Debug`. +- Optional ability to `Copy Value as String` for properties in `Inspector` widget +- Pass animation signal name to animation event - makes much easier to respond to multiple animation events with the + same name +- Ability to maximize ui windows +- `Animation::take_events` +- `Reflect::type_name` +- Show type name of selected object in the inspector +- Fixed multiple nodes parenting in the world viewer +- Apply grid snapping when instantiating a prefab +- Added range selection for tree widget (Shift + Click) +- Docking manager now collapses tiles when closing a docked window +- Improved search bar style in the world viewer +- Improved breadcrumbs in the world viewer +- `HotKey` + `KeyBinding` + respective property editors +- Ability to change editor controls. + +# 0.28 + +- Preview for prefab instantiation. +- Drag preview nodes are now input-transparent. +- Expand/collapse trees by double click. +- Fixed move/rotate/scale gizmo behaviour for mouse events. +- Fixed fallback to defaults when editor's config is corrupted. +- Save `Track Selection` option in the editor's config. +- Clear breadcrumbs when changing scene in the editor. +- Fixed 1-frame delay issues in the editor. +- Emit MouseUp message before Drop message. +- Fixed UI "flashing" in the editor in some cases. +- Do not silently discard UI messages from nodes that were already be deleted. +- Show node handle in breadcrumbs in the editor. +- Provide direct read-only access to current dragging context in UI. +- Fixed crash when trying to select a node by invalid handle in the editor. +- Highlight invalid handles in the Inspector. +- Discard "leftover" debug geometry when undoing actions in the editor. +- Some menus in the editor now more intuitive now. +- Fixed critical bug with incorrect unpack alignment for RGB textures - this causes hard crash in some + cases. +- Do not try to reload a resource if it is already loading. +- Ability to set desired frame rate for `Executor` (default is 60 FPS). +- Ability to paste editor's clipboard content to selected node (paste-as-child functionality). +- Ability to render into transparent window while keeping the transparency of untouched pixels (see + `transparent` example). +- Ability to specify custom window builder in `Executor` + a way to disable vsync in `Executor`. +- `MultiBorrowContext` for `Pool` and `Graph::begin_multi_borrow`, helps you to borrow multiple mutable + references to different items. +- Speed up code generation in proc-macros. +- Correctly map handles in instances after property inheritance (fixed weird bugs when handles to nodes + in your scripts mapped to incorrect ones) +- Refactored script processing: + - Added `ScriptTrait::on_start` - it is guaranteed to be called after all scripts in scene are initialized, useful + when a script depends on some other script + - Script processing is now centralized, not scattered as before. + - More deterministic update path (`on_init` -> `on_start` -> `on_update` -> `on_destroy`) +- Fixed crash when modifying text in a text box via message and then trying to type something. +- `ButtonBuilder::with_text_and_font` +- Show node names in for fields of `Handle` fields of structs in the editor. +- Fixed crash in the editor when a script has resource field. +- Ability to clone behaviour trees. +- Automatic node handle mapping via reflection. +- Removed `ScriptTrait::remap_handles` method. +- Pass elapsed time to scripts. +- Do not call `ScriptTrait::on_os_event` if scene is disabled. +- Make world viewer filtering case-insensitive. +- Correctly set self handle and sender for graph's root node. +- `#[inline]` attributes for "hot" methods. +- Fixed panic when rigid body is a root node of a scene. +- `Base::has_script` + `Base::try_get_script` + `Base::try_get_script_mut` helper methods, it is now easier + to fetch scripts on scene nodes. +- Ability to change selected node type in the editor (useful to change scene root type). +- Optimized script trait parameter passing, script context now passed by reference instead of value. +- Script context now have access to all plugins, which makes possible create cross plugin interaction. +- Removed requirement of scripts api to provide parent plugin's uuid. +- There is no more need to define uuid for plugins. +- Do not update scene scripts if it is disabled. +- `Graph::find_first_by_script` - helps you find a node by its script type. +- Added missing property editors for `Inspector` widget. +- Save editor's scene camera settings (position, orientation, zoom, etc.) per scene. +- Skip-chars list to be able to treat some chars like white space. +- Optional text shadow effect. +- Ctrl+Shift+Arrow to select text word-by-word in text box widget. +- Added navmesh settings to editor's settings panel. +- Make text box widget to accept text messages + special messages for text box widget. +- Set 500 ms double click interval (previously it was 750 ms). +- Fixed text selection in case of custom ui scaling. +- Fixed `TextBox::screen_pos_to_text_pos` - incorrect usage of `char_code` as index was leading to incorrect screen + position to text position mapping. +- Ability to scroll text in the text box widget. +- `Rect::with_position` + `Rect::with_size` methods. +- Fixed caret position when removing text from text box in specific cases. +- Fixed crash when typing spaces at the end of text box with word wrap. +- Fixed caret position when adding text to the multiline text box widget. +- Fixed new line addition in the text box widget. +- Ability to select words (or whitespace spans) in the text box by double click. +- Emit double click after mouse down event (not before). +- Fixed caret blinking in the text box widget for various scenarios. +- Ctrl+LeftArrow and Ctrl+RightArrow to skip words in the text box widget. +- Allow setting caret position in the text box widget by clicking outside of line bounds. +- `raycast2d` example. +- Fixed text deletion in text box by `Delete` key + selection fixes. +- Fixed selection by Ctrl+Home, Ctrl+End in the text box widget. +- Fixed selected text highlighting in the text box widget. +- Fixed panic when Ctrl+C in a text box when selection is right-to-left. +- Ability to focus/unfocus a widget by sending a message. +- Added `TextBox` example. +- Removed `is_modified` flag from `PropertyInfo`. +- Ability to revert inherited property to parent's prefab value. +- Replaced manual property inheritance with reflection. +- Added `fields` and `fields_mut` for `Reflect` trait. +- Property inheritance for scripts. +- Ability to extract selection as a prefab. +- Fixed tooltips for complex properties in `Inspector` widget. +- Allow selecting build profile when running a game from the editor. +- `NodeHandle` wrapper to bypass some limitations of `Inspector` widget. +- Return result instead of unwrap and panic in `make_relative_path` - fixed some issues with symlinks in the + editor. +- Added missing `Reflect` implementation for scripts made in `fyrox-template`. +- Added dependencies optimization for projects generated in `fyrox-template`. +- Provided access to some sound engine methods to plugins (`set_sound_gain` and `sound_gain`) +- Fixed style for ArrayPropertyEditor widget. +- Do not emit events for disabled animation signals. +- Sprite sheet animations with signals. +- Fixed terrain rendering - there's no more seams between layers with skybox content. +- Ability to set blending equation in draw parameters in the renderer. +- Ability to set blend function separately for RGB and Alpha in the renderer. +- Ignore invisible menus when closing menu chain by out-of-bounds click. +- Make some buttons in the editor smaller and less bright, add more tooltips. +- Use images for `Expand all`, `Collapse all`, `Locate Selection` buttons in world viewer. +- Fixed potential infinite loops when performing some math operations. +- Smoothing for cascaded shadow maps. +- Fixed script property editor - no more weird bugs in the editor when setting/editing/removing scripts from + a node. +- Fixed cascaded shadow maps for directional lights. +- Added `Frustum::center` method. +- Fixed list of panels in `View` menu in the editor. +- Create tool tips for interaction modes hidden by default. +- Reload settings when reconfiguring the editor. +- Added list of recent scenes to `File` menu in the editor - makes easier to switch between most used scenes. +- Ability to add, remove, set items for `MenuItem` widget +- Correctly highlight selected interaction mode button +- More hotkeys for the editor + - `[5]` - activate navmesh edit mode + - `[6]` - activate terrain edit mode +- Ability to set `Selected` flag to `Decorator` widget on build stage +- Added `Invert drag` option for camera settings in the editor. +- Fixed incorrect rendering of `Luminance` and `LuminanceAlpha` textures. +- Fixed closing menus by clicking outside them. +- Direct access to all fields in all widgets. +- Force `TextBox` widget to consume all input messages, this fixes hot keys triggering in the editor while + typing something in text fields. + +# 0.27.1 + +- Fixed `Operation failed! Reason: Modify { value: dyn Reflect }` error. +- Fixed inability to edit properties of 2d collider shape +- Fixed inability to edit some properties of Joint2D. +- Added property editor for `Color Grading Lut` property of the Camera node. +- Fixed panic when editing cascades properties of directional light. +- Prevent panic when there's invalid bone handle. +- Hide `data` field from inspector for Surface, because it has no proper property editor. +- Fixed terrain layer deletion from the Inspector. + +# 0.27 + +- Added compile-time reflection (huge thanks to [@toyboot4e](https://github.com/toyboot4e)) +- Most editor commands were removed and replaced by universal command based on reflection. +- Backward compatibility for native engine data formats was dropped - use FyroxEd 0.13 to convert your scenes to newer + version. +- Fixed panic when loading an FBX model with malformed animation curves (when there is only 1 or 2 components animated + instead of 3, X and Y, but not Z for example). +- ABSM editor now have smaller default size and fits on small screens. +- Asset previewer now plays model animations +- Fixed critical FBX importer bug, that caused malformed animations. +- Ability to define "playable" time slice for animations. +- Fixed editor update rate, previously it was very high and that caused some weird issues. +- Proper support for all resource types in Inspector +- Show ABSM resources in the asset browser +- Ability to edit sound import options in the asset browser +- Dynamic type casting for script instances +- Provide access to parameters in ABSM +- Fixed transition instantiation in ABSM - it incorrectly handled "invert rule" flag. +- Prevent panic when deleting a node from script methods. +- Dynamic type casting for plugin instances +- Two-step ABSM instantiation - at first step you load all animations in parallel (async) and on second step you + create actual ABSM instance. +- Wait for all resources to load before initialize scripts - this prevents panicking when trying to access + not yet loaded resource in script methods. +- Default instantiation scaling options for 3D models - allows you to scale 3D models automatically on instantiation. +- Graph event broadcaster - allows you to receive `Added` and `Removed` events for nodes. +- Correctly initialize scripts of nodes that created at runtime. +- Component provider for scripts - allows you to provide access to inner script components via unified interface. +- Disable automatic texture compression - having compression enabled for all kinds of textures is not good, because + there could be some textures with gradients, and they'll have significant distortion. +- `Pool::drain` - allows you to remove all objects from a pool while processing every object via closure. +- `Script::on_deinit` - allows you to execute any code for cleanup. +- Added `NodeHandleMap` - a small wrapper over map that have some methods that makes node handle mapping much + shorter. +- Correctly handle missing properties in Inspector for various objects. +- Provide access to main application window from plugins. +- Allow chaining `ScriptConstructorContainer::add` calls +- Removed `screen_size` parameter from `UserInterface::new` +- Ability to remove render passes. +- Run the game in a separate process from the editor. +- Provide access to default engine's user interface instance for plugins. +- `--override-scene` parameter for Executor +- `ButtonContent` improvements - it is now possible to re-create button's text field using `ButtonMessage::Content` +- Provide access to control flow switch for plugins. +- `Plugin::on_ui_message` +- Two-step plugins initialization: + - `PluginConstructor` trait defines a method that creates an instance of `Plugin` trait, instance of plugin + constructor is used to create plugins on demand. It is needed because engine has deferred plugin initialization. +- `Framework` is removed, its functionality was merged with plugins. +- Simplified `ScriptConstructorContainer::add` definition, there were redundant generic parameters that just add + visual clutter. +- Implemented `Clone+Debug` traits for `NavmeshAgent` +- Fixed spam in log in the editor when any file was changed. +- High DPI screens support for the editor. +- Newly created cameras in the editor are now enabled by default. +- Added "Preview" option for cameras in world viewer. +- Refactored joints: + - Joints binding now is fully automatic and it is based on world transform of the joint, no need to manually + set local frames. + - Rebinding happens when a joint changes its position + - Joints editing in the editor is now much more intuitive +- Improved debug visualization for physics. +- Read-only mode for NumericUpDown and Vec2/Vec3/Vec4 widgets +- Show global coordinates of current selection in the scene previewer +- BitField widget - it helps you to edit numbers as bit containers, allowing you to switch separate bits +- More compact editors for properties in Inspector +- NumericUpDown widget does not use word wrapping by default anymore +- CheckBox widget can now be switched only by left mouse button +- Ability to disable contacts between connected bodies of a joint +- `style` parameter for project template generator - it defines which scene will be used by default - either `2d` + or `3d` +- Ability to select portion of the texture to render in `Rectangle` nodes. +- Ability to generate script skeleton for template generator +- HSL color model +- Ability to copy log enties to the clipboard +- `Log` API improvements +- Visualize cameras in the editor +- Context menu for asset items, it is now possible to open, delete, show-in-explorer items and also + to copy file name and full file path to the clipboard. +- Visualize point and spot lights in the editor. + +# 0.26 + +This release is mostly to fix critical bugs of 0.25 and add missing functionality that stops you from using scripting +system. + +- Added project template generator +- Fixed invisible selected item in drop-down list widget. +- Correctly sync node names in `World Viewer` +- Reset editor's camera projection mode switch when creating new scene +- Fixed doubling scene entities in `World Viewer` when loading scene via `StartupData` +- More logging for renderer +- Fixed shader cache - now the engine won't re-compile shaders each 20 seconds. +- Temporarily disable `Lifetime` property editing because it causes crashes +- Do not show `dirty` flag of `Transform` in the `Inspector` +- Provide access to property editors container for editor's `Inspector` - it is now possible + to register your own property editors +- Fixed panic when syncing `Inspector` for an entity with `Option` field. +- Added `handle_object_property_changed` and `handle_collection_property_changed` macros to reduce + boilerplate code in script property handling. +- Added ability to restore resource handles for scripts +- Fixed selection visualization in `Asset Browser` +- Validation for sky box cube map generator + +## Migration guide + +There are no breaking changes in this release. + +# 0.25 + +- Static plugin system +- User-defined scripts +- Play mode for the editor +- Animation Blending State Machine (ABSM) editor. +- Some of sound entities were integrated in the scene graph. +- New `Sound` and `Listener` scene nodes. +- Sound buffer import options. +- `ResourceManager::request_sound_buffer` now accepts only path to sound buffer. +- Prefab inheritance improvements - now most of the properties of scene nodes are inheritable. +- Access to simulation properties of the physics. +- Engine and Resource manager are nonserializable anymore, check migration guide to find how to create + save files in the correct way. +- `Node` enumeration was removed and replaced with dynamic dispatch. This allows you to define your own + types of scene nodes. +- `Base` is not a scene node anymore, it was replaced with `Pivot` node (see migration guide for more info) +- `Base` now has `cast_shadows` property, respective property setters/getters was removed from `Mesh` and + `Terrain` nodes. +- Ability to bring ListView item into view. +- Logger improvements: event subscriptions + collecting timestamps +- Log panel improvements in the editor: severity filtering, color differentiation. +- Scene nodes now have more or less correct local bounds (a bounding box that can fit the node). +- Improved picking in the editor: now it is using precise hit test against node's geometry. +- "Ignore back faces" option for picking in the editor: allows you to pick through "back" of polygon + faces, especially useful for closed environment. +- Rotation ribbons were replaced with torus, it is much easier to select desired rotation mode. +- New material for gizmos in the editor, that prevent depth issues. +- New expander for TreeView widget, `V` and `>` arrows instead of `+` and `-` signs. +- ScrollBar widget is much thinner by default. +- Editor settings window now based on Inspector widget, which provides uniform way of data visualization. +- `DEFAULT_FONT` singleton was removed, it is replaced with `default_font` +- Shortcuts improvements in the editor. +- Overall UI performance improvements. +- Ability to disable clipping of widget bounds to parent bounds. +- Layout and render transform support for widgets - allows you to scale/rotate/translate widgets. +- Ability to make widget lowermost in hierarchy. +- Animation blending state machine refactoring, optimizations and stability improvements. +- Animation blending state machines are now stored in special container which stored in the Scene. +- Docking manager now shows anchors only for its windows. +- Model previewer now has much more intuitive controls. +- NumericUpDown don't panic anymore on edges of numeric bounds (i.e when trying to do `i32::MAX_VALUE + 1`) +- DoubleClick support for UI. +- Update rate fix for editor, it fixes annoying issue with flickering in text boxes. +- `UserInterface::hit_test_unrestricted` which performs hit test that is not restricted to current + picking restriction stack. +- WASM renderer fixes. +- `Pool::try_free` which returns `Option` on invalid handles, instead of panicking. +- Light source for model previewer +- Default skybox for editor and model previewer cameras +- `Color` API improvements. +- `#[reflect(expand)]` and `#[reflect(expand_subtree)]` were removed from `Inspect` proc-macro +- Correct field name generation for enum variants +- Ability to draw Bézier curves in the UI. +- Fix for navmesh agent navigation of multilayer navigational meshes. +- Improvements for serializer, now it allows you correctly recover from serialization errors. + +## Migration guide + +**WARNING:** This release **does not** provide legacy sound system conversion to new one, which means if +any of your scene had any sound, they will be lost! + +Now there is limited access to `fyrox_sound` entities, there is no way to create sound contexts, sounds, +effects manually. You have to use respective scene nodes (`Sound`, `Listener`) and `Effect` from +`fyrox::scene::sound` module (and children modules). + +### Nodes + +Since `Node` enumeration was removed, there is a new way of managing nodes: + +- `Node` now is just `Box` wrapped in a new-type-struct. +- Pattern matching was replaced with `cast` and `cast_mut` methods. +- In addition to `cast/cast_mut` there are two more complex methods for polymorphism: `query_component_ref` and + `query_component_mut` which are able to extract references to internal parts of the nodes. This now has only one + usage - `Light` enumeration was removed and `PointLight`, `SpotLight`, `DirectionalLight` provides unified access + to `BaseLight` component via `query_component_ref/query_component_mut`. `query_component` could be a bit slower, + since it might involve additional branching while attempting to query component. +- `Base` node was replaced with `Pivot` node (and respective `PivotBuilder`), it happend due to problems with + `Deref/DerefMut` implementation, if `Base` is implementing `NodeTrait` then it must implement `Deref` + but implementing `Deref` for `Base` causes infinite deref coercion loop. +- To be able to create custom scene nodes and having the ability to serialize/deserialize scene graph with such + nodes, `NodeConstructorContainer` was added. It contains a simple map `UUID -> NodeConstructor` which allows to + pick the right node constructor based on type uuid at deserialization stage. + +#### Replacing `BaseBuilder` with `PivotBuilder` + +It is very simply, just wrap `BaseBuilder` with a `PivotBuilder` and call `build` on `PivotBuilder` instance: + +```rust +// Before +fn create_pivot_node(graph: &mut Graph) -> Handle { + BaseBuilder::new().build(graph) +} + +// After +fn create_pivot_node(graph: &mut Graph) -> Handle { + PivotBuilder::new(BaseBuilder::new()).build(graph) +} +``` + +#### Pattern matching replacement + +Pattern matching was replaced with 4 new methods `cast/cast_mut/query_component_ref/query_component_mut`: + +```rust +fn set_sprite_color(node: &mut Node, color: Color) { + // Use `cast_mut` when you are sure about the real node type. + if let Some(sprite) = node.cast_mut::() { + sprite.set_color(color); + } +} + +fn set_light_color(node: &mut Node, color: Color) { + // Use query_component_mut if you unsure what is the exact type of the node. + // In this example the `node` could be either PointLight, SpotLight, DirectionalLight, + // since they're all provide access to `BaseLight` via `query_component_x` the function + // will work with any of those types. + if let Some(base_light) = node.query_component_mut::() { + base_light.set_color(color); + } +} +``` + +### Listener + +Now there is no need to manually sync position and orientation of the sound listener, all you need to do +instead is to create `Listener` node and attach it to your primary camera (or other scene node). Keep +in mind that the engine supports only one listener, which means that only one listener can be active +at a time. The engine will not stop you from having multiple listeners active, however only first (the +order is undefined) will be used to output sound. + +### Sound sources + +There is no more 2D/3D separation between sounds, all sounds in 3D by default. Every sound source now is +a scene node and can be created like so: + +```rust +let sound = SoundBuilder::new( +BaseBuilder::new().with_local_transform( +TransformBuilder::new() +.with_local_position(position) +.build(), +), +) +.with_buffer(buffer.into()) +.with_status(Status::Playing) +.with_play_once(true) +.with_gain(gain) +.with_radius(radius) +.with_rolloff_factor(rolloff_factor) +.build(graph); +``` + +Its API mimics `fyrox_sound` API so there should be now troubles in migration. + +### Effects + +Effects got a thin wrapper around `fyrox_sound` to make them compatible with `Sound` scene nodes, a reverb +effect instance can be created like so: + +```rust +let reverb = ReverbEffectBuilder::new(BaseEffectBuilder::new().with_gain(0.7)) +.with_wet(0.5) +.with_dry(0.5) +.with_decay_time(3.0) +.build( & mut scene.graph.sound_context); +``` + +A sound source can be attached to an effect like so: + +```rust +graph +.sound_context +.effect_mut( self .reverb) +.inputs_mut() +.push(EffectInput { +sound, +filter: None, +}); +``` + +### Filters + +Effect input filters API remain unchanged. + +### Engine initialization + +`Engine::new` signature has changed to accept `EngineInitParams`, all previous argument were moved to the +structure. However, there are some new engine initialization parameters, like `serialization_context` and +`resource_manager`. Previously `resource_manager` was created implicitly, currently it has to be created +outside and passed to `EngineInitParams`. This is because of new `SerializationContext` which contains +a set of constructors for various types that may be used in the engine and be added by external plugins. +Typical engine initialization could look something like this: + +```rust +use fyrox::engine::{Engine, EngineInitParams}; +use fyrox::window::WindowBuilder; +use fyrox::engine::resource_manager::ResourceManager; +use fyrox::event_loop::EventLoop; +use std::sync::Arc; +use fyrox::engine::SerializationContext; + +fn init_engine() { + let evt = EventLoop::new(); + let window_builder = WindowBuilder::new() + .with_title("Test") + .with_fullscreen(None); + let serialization_context = Arc::new(SerializationContext::new()); + let mut engine = Engine::new(EngineInitParams { + window_builder, + resource_manager: ResourceManager::new(serialization_context.clone()), + serialization_context, + events_loop: &evt, + vsync: false, + }) + .unwrap(); +} +``` + +## Serialization + +Engine and ResourceManager both are non-serializable anymore. It changes approach of creating save files in games. +Previously you used something like this (following code snippets are modified versions of `save_load` example): + +```rust +const SAVE_FILE: &str = "save.bin"; + +fn save(game: &mut Game) { + let mut visitor = Visitor::new(); + + game.engine.visit("Engine", visitor)?; // This no longer works + game.game_scene.visit("GameScene", visitor)?; + + visitor.save_binary(Path::new(SAVE_FILE)).unwrap(); +} + +fn load(game: &mut Game) { + if Path::new(SAVE_FILE).exists() { + if let Some(game_scene) = game.game_scene.take() { + game.engine.scenes.remove(game_scene.scene); + } + + let mut visitor = block_on(Visitor::load_binary(SAVE_FILE)).unwrap(); + + game.engine.visit("Engine", visitor)?; // This no longer works + game.game_scene.visit("GameScene", visitor)?; + } +} +``` + +However, on practice this approach could lead to some undesirable side effects. The main problem with the old +approach is that when you serialize the engine, it serializes all scenes you have. This fact is more or less +ok if you have only one scene, but if you have two and more scenes (for example one for menu and one for +game level) it writes/reads redundant data. The second problem is that you cannot load saved games asynchronously +using the old approach, because it takes mutable access of the engine and prevents you from off-threading work. + +The new approach is much more flexible and do not have such issues, instead of saving the entire state of the +engine, you just save and load only what you actually need: + +```rust +const SAVE_FILE: &str = "save.bin"; + +fn save(game: &mut Game) { + if let Some(game_scene) = game.game_scene.as_mut() { + let mut visitor = Visitor::new(); + + // Serialize game scene first. + game.engine.scenes[game_scene.scene] + .save("Scene", &mut visitor) + .unwrap(); + // Then serialize the game scene. + game_scene.visit("GameScene", &mut visitor).unwrap(); + + // And call save method to write everything to disk. + visitor.save_binary(Path::new(SAVE_FILE)).unwrap(); + } +} + +// Notice that load is now async. +async fn load(game: &mut Game) { + // Try to load saved game. + if Path::new(SAVE_FILE).exists() { + // Remove current scene first. + if let Some(game_scene) = game.game_scene.take() { + game.engine.scenes.remove(game_scene.scene); + } + + let mut visitor = Visitor::load_binary(SAVE_FILE).await.unwrap(); + + let scene = SceneLoader::load("Scene", &mut visitor) + .unwrap() + .finish(game.engine.resource_manager.clone()) + .await; + + let mut game_scene = GameScene::default(); + game_scene.visit("GameScene", &mut visitor).unwrap(); + + game_scene.scene = game.engine.scenes.add(scene); + game.game_scene = Some(game_scene); + } +} +``` + +As you can see in the new approach you save your scene and some level data, and on load - you load the scene, add +it to the engine as usual and load level's data. The new approach is a bit more verbose, but it is much more +flexible. + +# 0.24 + +## Engine + +- 2D games support (with 2D physics as well) +- Three new scene nodes was added: RigidBody, Collider, Joint. Since rigid body, collider and joint are graph nodes + now, it is possible to have complex hierarchies built with them. +- It is possible to attach rigid body to any node in scene graph, its position now will be correct in this case ( + previously it was possible to have rigid bodies attached only on root scene nodes). +- New `Inspector` widget + tons of built-in property editors (with the ability to add custom editors) +- `Inspect` trait + proc macro for lightweight reflection +- UI now using dynamic dispatch allowing you to add custom nodes and messages easily +- fyrox-sound optimizations (30% faster) +- Linear interpolation for sound samples when sampling rate != 1.0 (much better quality than before) +- Color fields in material editor now editable +- Window client area is now correctly filled by the renderer on every OS, not just Windows. +- NumericRange removal (replaced with standard Range + extension trait) +- Sort files and directories in FileBrowser/FileSelector widgets +- RawStreaming data source for sound +- Renderer performance improvements (2.5x times faster) +- UI layout performance improvements +- Prevent renderer from eating gigabytes of RAM +- Use `#[inline]` attribute to enable cross-crate inlining +- `ImmutableString` for faster hashing of static strings +- `SparseBuffer` as a lightweight analog for `Pool` (non-generational version) +- Support diffuse color in FBX materials +- Frustum culling fixes for terrain +- Shaders don't print empty lines when compiles successfully. +- `Pool` improvements +- Impl `IntoIterator` for references to `Pool` +- Cascaded shadow maps for directional light sources +- `spawn_at` + `spawn_at_handle` for `Pool` +- Preview for drag'n'drop +- `Grid` widget layout performance optimizations (**1000x** performance improvement - this is not a typo) +- `query_component` for UI widgets +- Curve resource +- Remove all associated widgets of a widget when deleting the widget (do not leave dangling objects) +- World bounding box calculation fix +- Heavy usage of invalidation in UI routines (prevents checking tons of widgets every frame) +- Migrate to `parking-lot` synchronization primitives +- Migrate to `FxHash` (faster hashing) +- `Log::verify` to log errors of `Result<(), Error` +- Custom scene node properties support +- `Alt+Click` prevents selection in `Tree` widget +- Ability to change camera projection (Perspective or Orthographic) +- Smart position selection for popups (prevents them from appearing outside screen bounds) +- High-quality mip-map generation using Lanczos filter. + +## Editor + +- `Inspector` widget integration, which allowed to remove tons of boilerplate code +- Middle mouse button camera dragging +- Q/E + Space to move camera up/down +- Working directory message is much less confusing now +- Ability to edit sound sources in the editor +- Checkerboard colorization fix in the world viewer +- Search in the world viewer +- Floating brush panel for terrain editor +- Editor camera has manual exposure (not affected by auto-exposure) +- Curve editor +- Automatically select an newly created instance of a scene node +- Grid snapping fix +- Angle snapping +- Edit properties of multiple selected objects at once. +- Context menu for scene items in world viewer +- `Create child` for scene item context menu +- Import options editor for asset browser +- Hot reload for textures. + +## Breaking changes and migration guide + +There are lots of breaking changes in this version, however all of them mostly related to the code and scenes made in +previous version _should_ still be loadable. + +### Convert old scenes to new format + +At first, install the rusty-editor from crates.io and run it: + +```shell +cargo install rusty-editor +rusty-editor +``` + +And then just re-save your scenes one-by-one. After this all your scenes will be converted to the newest version. +Keep in mind that the editor from GitHub repo (0.25+) is not longer have backward compatibility/conversion code! + +### 2D scenes + +2D scene were completely removed and almost every 2D node were removed, there is only one "2D" node left - Rectangle. +2D now implemented in 3D scenes, you have to use orthographic camera for that. There is no migration guide for 2D scenes +because 2D had rudimentary support, and I highly doubt that there is any project that uses 2D of the engine. + +## Resource management + +Resource manager has changed its API and gained some useful features that should save you some time. + +`request_texture` now accepts only one argument - path to texture, second argument was used to pass +`TextureImportOptions`. Import options now should be located in a separate options file. For example, you have a +`foo.jpg` texture and you want to change its import options (compression, wrapping modes, mip maps, etc.). To do this +you should create `foo.jpg.options` file in the same directory near your file with following content (each field is +optional): + +```text +( + minification_filter: LinearMipMapLinear, + magnification_filter: Linear, + s_wrap_mode: Repeat, + t_wrap_mode: Repeat, + anisotropy: 16, + compression: NoCompression, +) +``` + +The engine will read this file when you'll call `request_texture` and it will apply the options on the first load. +This file is not mandatory, you can always set global import defaults in resource manage by calling +`set_texture_import_options`. + +`request_model` have the same changes, there is only one argument and import options were moved to options file: + +```text +( + material_search_options: RecursiveUp +) +``` + +Again, all fields aren't mandatory and the entire file can be omitted, global import defaults can be set by calling +`set_model_import_options`. + +### Physics + +Old physics was replaced with new scene nodes: RigidBody, Collider, Joint. Old scenes will be automatically converted +on load, you should convert your scenes as soon as possible using the editor (open your scene and save it, that will +do the conversion). + +Now there are two ways of adding a rigid body to a scene node: + +- If you want your object to have a rigid body (for example a crate with box rigid body), your object must be + **child** object of a rigid body. Graphically it can be represented like this: + +```text +- Rigid Body + - Crate3DModel + - Cuboid Collider +``` + +- If you want your object to have a rigid body that should move together with your object (to simulate hit boxes for + example), then rigid body must be child object of your object. Additionally it should be marked as `Kinematic`, + otherwise it will be affected by simulation (simply speaking it will fall on ground). Graphically it can be + represented like this: + +```text +- Limb + - Rigid Body + - Capsule Collider +``` + +#### Migration + +This section will help you to migrate to new physics. + +##### Rigid bodies + +Rigid body and colliders now can be created like so: + +```rust +use fyrox_impl::{ + core::{algebra::Vector3, pool::Handle}, + scene::{ + base::BaseBuilder, + collider::{ColliderBuilder, ColliderShape}, + node::Node, + rigidbody::RigidBodyBuilder, + transform::TransformBuilder, + Scene, + }, +}; + +fn create_capsule_rigid_body(scene: &mut Scene) -> Handle { + RigidBodyBuilder::new( + BaseBuilder::new() + .with_local_transform( + // To position, rotate rigid body you should use engine's transform. + TransformBuilder::new() + .with_local_position(Vector3::new(1.0, 2.0, 3.0)) + .build(), + ) + .with_children(&[ + // It is very important to add at least one child collider node, otherwise rigid + // body will not do collision response. + ColliderBuilder::new( + BaseBuilder::new().with_local_transform( + // Colliders can have relative position to their parent rigid bodies. + TransformBuilder::new() + .with_local_position(Vector3::new(0.0, 0.5, 0.0)) + .build(), + ), + ) + // Rest of properties can be set almost as before. + .with_friction(0.2) + .with_restitution(0.1) + .with_shape(ColliderShape::capsule_y(0.5, 0.2)) + .build(&mut scene.graph), + ]), + ) + // Rest of properties can be set almost as before. + .with_mass(2.0) + .with_ang_damping(0.1) + .with_lin_vel(Vector3::new(2.0, 1.0, 3.0)) + .with_ang_vel(Vector3::new(0.1, 0.1, 0.1)) + .build(&mut scene.graph) +} +``` + +##### Joints + +Joints can be created in a similar way: + +```rust +fn create_ball_joint(scene: &mut Scene) -> Handle { + JointBuilder::new(BaseBuilder::new()) + .with_params(JointParams::BallJoint(BallJoint { + local_anchor1: Vector3::new(1.0, 0.0, 0.0), + local_anchor2: Vector3::new(-1.0, 0.0, 0.0), + limits_local_axis1: Vector3::new(1.0, 0.0, 0.0), + limits_local_axis2: Vector3::new(1.0, 0.0, 0.0), + limits_enabled: true, + limits_angle: 45.0, + })) + .with_body1(create_capsule_rigid_body(scene)) + .with_body2(create_capsule_rigid_body(scene)) + .build(&mut scene.graph) +} +``` + +##### Raycasting + +Raycasting located in `scene.graph.physics`, there were almost no changes to it, except now it returns handles to +scene nodes instead of raw collider handles. + +##### Contact info + +Contact info can now be queried from the collider node itself, via `contacts()` method. + +```rust +fn query_contacts(collider: Handle, graph: &Graph) -> impl Iterator { + graph[collider].as_collider().contacts(&graph.physics) +} +``` \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..2b86be2 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,74 @@ +# Contributors guidelines + +This document explains how to contribute to the engine. Keep in mind that this is not a "must-obey" list; use common +sense when contributing something to the engine. + +## How to contribute + +- **Code** — writing code is the most obvious way of contribution. You can add missing features, fix bugs, improve + existing tools, etc. See the [code section](#contributing-code) for more info. +- **Documentation** — documentation is the next place where you can contribute, this engine is already quite big and + there's a bunch of undocumented code. If you're familiar with some undocumented API, don't hesitate — write + documentation for it. You will save a lot of time for the next people who will be using this API and they will be + grateful that the docs exists. + See the [documentation section](#contributing-documentation) for more info. +- **Make games** — the best way to understand what's missing or needs to be improved is by making games using the + engine. When you find something missing or can be improved, don't hesitate — create an issue in this repository and + may be somebody will spot this issue and fix it. Filing issues is always good, it clearly shows that there's something + wrong and people can track the progress. +- **Report bugs** — if something does not work as it should, file an issue about it so the problem will be clear. Any + software has edge cases; that could be hidden for a long time, until you need to do something non-trivial. +- **Donation** — if you don't have any time to write the code or docs, and you want to see the project alive, you should + consider donating any amount of money to the developers of the engine. +- **Promote the engine** - write posts, make videos, share news about the engine on social media and so on. + +## Contributing code + +Common rules for code contributions: + +- **Keep code clean** — name your variables and functions meaningfully. Try to not create god-like functions that + handle everything at once. Always compile your code before making a pull request. +- **Write documentation** — document your code. It should explain what the code does at high level. Do not include low + level details in your documentation (unless you need to explain something, that is very important). +- **Format your code** — use `rustfmt` to format the code you're writing. +- **Write unit tests** — if you're adding new functionality to the engine, make sure to write unit tests for it. It is + not always possible to write meaningful unit tests — for example, graphics can hardly be tested this way. In this + case, make sure to thoroughly test your code manually. +- **Describe your code** — it is important to explain why you wrote the code and what it does. Do not create pull + requests with description like: `fixed bug`, `added stuff`, etc. It does not help anyone, instead write a proper + description. +- **License** — include the content of `LICENSE.md` file at the top of any new source code file. Every line must be + start from `// ` (two slashes with a space after them). You can add your own copyright line with dates, but you must + keep the license unchanged (MIT). +- **No AI-generated slop** - Fyrox is a handcrafted game engine, there's no place for AI-generated code. All pull + requests suspected in AI generation won't be accepted. If you want to extend the engine functionality with + AI-generated code, then create your own plugin as a separate crate. + +When you're writing something for the editor, you can run its standalone version using `fyroxed` package like so: + +```shell +cargo run --package fyroxed --profile=editor-standalone +``` + +This way the editor will run without any plugins, and you can test your changes quickly without a need to create a +project and test there. + +Sometimes there's a need to have a scene for testing, loading the same scene everytime is very tedious and boring. +So the standalone editor has command line arguments that can be used to specify the list of scenes for loading: + +```shell +cargo run --package fyroxed --profile editor-standalone -- --scenes data/unnamed.rgs --project-directory . +``` + +This script loads the scene `unnamed.rgs` right after the start with the last editor's camera location. + +## Contributing documentation + +Common rules for documentation contributions: + +- **Write everything in English** — official API documentation and [the book](https://fyrox-book.github.io/) written in + English. If you want to create a translation for the book, you should create your own repository. +- **Add code examples** — code snippets helps other developers to quickly understand how to use a function/method. +- **Use spell checker** — keep the docs clean and readable. +- **Expertise** — make sure that you understand the thing you're writing the docs for. Shallow docs are usually + misleading, and sometimes they're even worse, than no documentation at all. \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..8b55459 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,48 @@ +[workspace] +members = [ + "fyrox-core-derive", + "fyrox-core", + "fyrox-sound", + "fyrox-ui", + "fyrox-resource", + "fyrox-scripts", + "fyrox-animation", + "editor", + "editor-standalone", + "template-core", + "template", + "fyrox-graph", + "fyrox-math", + "fyrox-dylib", + "fyrox", + "fyrox-impl", + "project-manager", + "fyrox-graphics", + "fyrox-build-tools", + "fyrox-texture", + "fyrox-autotile", + "fyrox-material", + "fyrox-graphics-gl"] +resolver = "2" + +[profile.editor-standalone] +inherits = "dev" +opt-level = 1 + +[profile.release] +opt-level = 3 +debug = true + +[profile.project-manager] +inherits = "release" +opt-level = "z" +debug = false +strip = true +panic = "abort" +lto = true + +[profile.github-ci] +inherits = "dev" +strip = "symbols" +debug = false +opt-level = 3 diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..f872443 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,19 @@ +Copyright (c) 2019-present Dmitry Stepanov and Fyrox Engine contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..055e549 --- /dev/null +++ b/README.md @@ -0,0 +1,62 @@ +
+ + Fyrox + +

Fyrox - a modern Rust game engine

+
+ +[![License (MIT)](https://img.shields.io/crates/l/fyrox)](https://github.com/FyroxEngine/Fyrox/blob/master/LICENSE.md) +[![CI Status](https://github.com/FyroxEngine/Fyrox/actions/workflows/ci.yml/badge.svg)](https://github.com/FyroxEngine/Fyrox/actions/workflows/ci.yml) +[![Crates.io](https://img.shields.io/crates/v/fyrox)](https://crates.io/crates/fyrox) +[![docs.rs](https://img.shields.io/badge/docs-website-blue)](https://docs.rs/Fyrox/) +[![Discord](https://img.shields.io/discord/756573453561102427)](https://discord.gg/xENF5Uh) +[![Lines of code](https://tokei.rs/b1/github/FyroxEngine/Fyrox)](https://github.com/FyroxEngine/Fyrox) + +A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor. +_Formerly known as rg3d_ + +## [Learning materials](https://fyrox-book.github.io/) + +[Read the official Fyrox book here.](https://fyrox-book.github.io/) It contains comprehensive information about many aspects of the engine, starting +by "how to build" and ending by various tutorials. + +## Community + +You can always ask your question in Discord server - [Join the Discord server](https://discord.gg/xENF5Uh), or directly in +[Discussions](https://github.com/FyroxEngine/Fyrox/discussions). + +## Examples + +You can run examples directly in your web browser, the full list of demo projects is [available here](https://fyrox.rs/examples.html). +Source code for each demo project [can be found here](https://github.com/FyroxEngine/Fyrox-demo-projects). + +## Support + +If you want to support the development of the project, click the link below. Preferrable way is to use [Boosty](https://boosty.to/fyrox) - this way the money +will be available for the development immediately. Alternatively you can can use [Patreon](https://www.patreon.com/mrdimas), but in this case the money will +be on-hold for unknown period of time ([details are here](https://github.com/FyroxEngine/Fyrox/issues/363)). + +## Contributing + +Contributions are very welcome! See the [contributions guidelines](CONTRIBUTING.md) for more info. Check the [good first issue](https://github.com/FyroxEngine/Fyrox/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label to +see where you can help. + +## Sponsors + +The engine is supported by very generous people, their donations provides sustainable development of the engine: + +[Brandon Thomas](https://www.patreon.com/user?u=34951681) | [Taylor C. Richberger](https://www.patreon.com/user/creators?u=60141723) | [Avery Wagar](https://www.patreon.com/user?u=41863848) | +[George Atkinson](https://www.patreon.com/user?u=61771027) | [Erlend Sogge Heggen](https://www.patreon.com/amethystengine/creators) | [Mitch Skinner](https://www.patreon.com/user/creators?u=60141723) | [ozkriff](https://www.patreon.com/ozkriff) | [Taylor Gerpheide](https://www.patreon.com/user/creators?u=32274918) | +[zrkn](https://www.patreon.com/user/creators?u=23413376) | [Aleks Row](https://www.patreon.com/user/creators?u=51907853) | [Edward L](https://www.patreon.com/user/creators?u=53507198) | [L.apz](https://www.patreon.com/user/creators?u=5448832) | [Luke Jones](https://www.patreon.com/flukejones) | [toyboot4e](https://www.patreon.com/user/creators?u=53758973) | [Vish Vadlamani](https://www.patreon.com/user/creators?u=42768509) | +[Alexey Kuznetsov](https://www.patreon.com/user?u=39375025) | [Daniel Simon](https://www.patreon.com/user/creators?u=43754885) | [Jesper Nordenberg](https://www.patreon.com/jesnor) | [Kornel](https://www.patreon.com/user?u=59867) | [Parham Gholami](https://www.patreon.com/user?u=33009238) | [Yuki Ishii](https://www.patreon.com/user/creators?u=9564103) | +[Joseph Catrambone](https://www.patreon.com/user?u=4738580) | [MGlolenstine](https://github.com/MGlolenstine) | [zamar lomax](https://www.patreon.com/user?u=65928523) | [Gheorghe Ugrik](https://www.patreon.com/user?u=54846813) | +[Anton Zelenin](https://www.patreon.com/user?u=62378966) | [Barugon](https://www.patreon.com/user?u=11344465) | [Tom Leys](https://www.patreon.com/user?u=222856) | [Jay Sistar](https://www.patreon.com/user?u=284041) | [tc](https://www.patreon.com/user?u=11268466) | [false](https://www.patreon.com/user?u=713537) | [BlueSkye](https://www.patreon.com/EmotionalSnow) | +[Ben Anderson](https://www.patreon.com/user/creators?u=14436239) | [Thomas](https://www.patreon.com/user?u=317826) | [Iulian Radu](https://www.patreon.com/user?u=8698230) | [Vitaliy (ArcticNoise) Chernyshev](https://www.patreon.com/user?u=2601918) + +### JetBrains + +JetBrains provided an open-source all-products license for their products which drastically helps in development of the engine. + +JetBrains logo. + +_Copyright © 2000-2021 [JetBrains](https://jb.gg/OpenSource) s.r.o. JetBrains and the JetBrains logo are registered trademarks of JetBrains s.r.o._ diff --git a/README.wehub.md b/README.wehub.md new file mode 100644 index 0000000..6d1a251 --- /dev/null +++ b/README.wehub.md @@ -0,0 +1,7 @@ +# WeHub 来源说明 + +- 原始项目:`FyroxEngine/Fyrox` +- 原始仓库:https://github.com/FyroxEngine/Fyrox +- 导入方式:上游默认分支的最新快照 +- 原作者、版权和许可证信息以原始仓库及本仓库 LICENSE 为准 +- 本文件仅用于记录来源,不代表 WeHub 是原项目作者 diff --git a/editor-standalone/Cargo.toml b/editor-standalone/Cargo.toml new file mode 100644 index 0000000..b7dbeb5 --- /dev/null +++ b/editor-standalone/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "fyroxed" +version = "2.0.0-rc.1" +license = "MIT" +authors = ["Dmitry Stepanov "] +edition = "2021" +rust-version = "1.94" +description = "A standalone scene editor for Fyrox game engine" +homepage = "https://github.com/FyroxEngine/Fyrox" +keywords = ["fyrox", "editor", "rust"] +repository = "https://github.com/FyroxEngine/Fyrox" +readme = "README.md" +include = ["/src/**/*", "/Cargo.toml", "/LICENSE", "/README.md"] + +[dependencies] +fyrox = { version = "2.0.0-rc.1", path = "../fyrox" } +fyroxed_base = { version = "2.0.0-rc.1", path = "../editor" } +clap = { version = "4", features = ["derive"] } diff --git a/editor-standalone/LICENSE b/editor-standalone/LICENSE new file mode 100644 index 0000000..9bcce00 --- /dev/null +++ b/editor-standalone/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Dmitry Stepanov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/editor-standalone/README.md b/editor-standalone/README.md new file mode 100644 index 0000000..a644ca4 --- /dev/null +++ b/editor-standalone/README.md @@ -0,0 +1,41 @@ +# FyroxEd (standalone) + +**WARNING:** Standalone version of the editor is not supported, use +[project template generator](https://fyrox-book.github.io/fyrox/beginning/scripting.html) to utilize the full power +of the editor. Standalone version does not support plugins and scripts, it won't be update in next releases! + +A standalone version of FyroxEd - native editor of [Fyrox engine](https://github.com/FyroxEngine/Fyrox). The standalone +version allows you only to create and edit scenes, but **not run your game in the editor**. Please see +[the book](https://fyrox-book.github.io/) to learn how to use the editor in different ways. + +## How to install and run + +To install the latest stable **standalone** version from crates.io use: + +```shell +cargo install fyroxed +``` + +After that, you can run the editor by simply calling: + +```shell +fyroxed +``` + +If you're on Linux, please make sure that the following dependencies are installed: + +```shell +sudo apt install libxcb-shape0-dev libxcb-xfixes0-dev libxcb1-dev libxkbcommon-dev libasound2-dev +``` + +## Controls + +- [Click] - Select +- [W][S][A][D] - Move camera +- [Space][Q]/[E] - Raise/Lower Camera +- [1] - Select interaction mode +- [2] - Move interaction mode +- [3] - Scale interaction mode +- [4] - Rotate interaction mode +- [Ctrl]+[Z] - Undo +- [Ctrl]+[Y] - Redo]() \ No newline at end of file diff --git a/editor-standalone/src/main.rs b/editor-standalone/src/main.rs new file mode 100644 index 0000000..f385498 --- /dev/null +++ b/editor-standalone/src/main.rs @@ -0,0 +1,61 @@ +// Copyright (c) 2019-present Dmitry Stepanov and Fyrox Engine contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +use clap::Parser; +use fyrox::core::log::Log; +use fyrox::event_loop::EventLoop; +use fyroxed_base::{Editor, StartupData}; + +#[derive(Parser, Debug)] +#[command(version, about, long_about = None)] +struct Args { + /// Project root directory + #[arg(short, long)] + project_directory: Option, + + /// List of scenes to load + #[arg(short, long)] + scenes: Option>, + + #[arg(short, long)] + named_objects: bool, +} + +fn main() { + Log::set_file_name("fyrox.log"); + + let args = Args::parse(); + let startup_data = if let Some(proj_dir) = args.project_directory { + Some(StartupData { + working_directory: proj_dir.into(), + scenes: args + .scenes + .unwrap_or_default() + .iter() + .map(Into::into) + .collect(), + named_objects: args.named_objects, + }) + } else { + None + }; + + Editor::new(startup_data).run(EventLoop::new().unwrap()) +} diff --git a/editor/.gitignore b/editor/.gitignore new file mode 100644 index 0000000..774d5b2 --- /dev/null +++ b/editor/.gitignore @@ -0,0 +1,11 @@ +/target +**/*.rs.bk +*.lock +.idea +/*.log +/*.txt +*.rgs +/data +history.bin +/settings.ron +/AutomatedTests \ No newline at end of file diff --git a/editor/Cargo.toml b/editor/Cargo.toml new file mode 100644 index 0000000..9f68926 --- /dev/null +++ b/editor/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "fyroxed_base" +license = "MIT" +version = "2.0.0-rc.1" +authors = ["Dmitry Stepanov "] +edition = "2021" +rust-version = "1.94" +description = "A scene editor for Fyrox game engine" +homepage = "https://github.com/FyroxEngine/Fyrox" +keywords = ["fyrox", "editor", "rust"] +repository = "https://github.com/FyroxEngine/Fyrox" +readme = "README.md" +include = ["/src/**/*", "/Cargo.toml", "/LICENSE", "/README.md", "/resources/**/*"] + +[dependencies] +fyrox = { version = "2.0.0-rc.1", path = "../fyrox", default-features = false } +fyrox-build-tools = { version = "2.0.0-rc.1", path = "../fyrox-build-tools" } +ron = "0.11" +serde = { version = "1", features = ["derive"] } +toml = { version = "0.9", default-features = false, features = ["parse"] } +toml_edit = "0.23" +strum = "0.27" +strum_macros = "0.27" +open = "5" +opener = { version = "0.8", default-features = false, features = ["reveal"] } +rust-fuzzy-search = "0.1.1" +cargo_metadata = "0.22" +serde_json = { version = "1", features = ["raw_value", "default", "std", "unbounded_depth"] } +image = { version = "0.25.1", default-features = false, features = ["gif", "jpeg", "png", "tga", "tiff", "bmp"] } +imageproc = "0.25.0" +notify = "8" +bitflags = "2.9.1" + +[features] +default = ["fyrox/default"] +dylib_engine = ["fyrox/dylib"] diff --git a/editor/LICENSE b/editor/LICENSE new file mode 100644 index 0000000..9bcce00 --- /dev/null +++ b/editor/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Dmitry Stepanov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/editor/README.md b/editor/README.md new file mode 100644 index 0000000..3c05889 --- /dev/null +++ b/editor/README.md @@ -0,0 +1,6 @@ +# FyroxEd + +Full-featured editor for [Fyrox engine](https://github.com/FyroxEngine/Fyrox). This is the basic library for the editor, +it cannot be run as executable. See `editor-standalone` for this. + +The main purpose of making the editor library is to use it with static plugins, see `scripting` example for more info. \ No newline at end of file diff --git a/editor/resources/Roboto-Regular.ttf b/editor/resources/Roboto-Regular.ttf new file mode 100644 index 0000000..2d116d9 Binary files /dev/null and b/editor/resources/Roboto-Regular.ttf differ diff --git a/editor/resources/add.png b/editor/resources/add.png new file mode 100644 index 0000000..a3ed807 Binary files /dev/null and b/editor/resources/add.png differ diff --git a/editor/resources/add_box_emitter.png b/editor/resources/add_box_emitter.png new file mode 100644 index 0000000..b209c3a Binary files /dev/null and b/editor/resources/add_box_emitter.png differ diff --git a/editor/resources/add_cylinder_emitter.png b/editor/resources/add_cylinder_emitter.png new file mode 100644 index 0000000..063e26b Binary files /dev/null and b/editor/resources/add_cylinder_emitter.png differ diff --git a/editor/resources/add_sphere_emitter.png b/editor/resources/add_sphere_emitter.png new file mode 100644 index 0000000..dcec29d Binary files /dev/null and b/editor/resources/add_sphere_emitter.png differ diff --git a/editor/resources/all_curves.png b/editor/resources/all_curves.png new file mode 100644 index 0000000..ed947a7 Binary files /dev/null and b/editor/resources/all_curves.png differ diff --git a/editor/resources/asset.png b/editor/resources/asset.png new file mode 100644 index 0000000..d3a82c8 Binary files /dev/null and b/editor/resources/asset.png differ diff --git a/editor/resources/border-icon.png b/editor/resources/border-icon.png new file mode 100644 index 0000000..c3422c3 Binary files /dev/null and b/editor/resources/border-icon.png differ diff --git a/editor/resources/brush.png b/editor/resources/brush.png new file mode 100644 index 0000000..15efa68 Binary files /dev/null and b/editor/resources/brush.png differ diff --git a/editor/resources/button-icon.png b/editor/resources/button-icon.png new file mode 100644 index 0000000..7c2c37f Binary files /dev/null and b/editor/resources/button-icon.png differ diff --git a/editor/resources/canvas-icon.png b/editor/resources/canvas-icon.png new file mode 100644 index 0000000..195fd2d Binary files /dev/null and b/editor/resources/canvas-icon.png differ diff --git a/editor/resources/checkbox-icon.png b/editor/resources/checkbox-icon.png new file mode 100644 index 0000000..2bd7313 Binary files /dev/null and b/editor/resources/checkbox-icon.png differ diff --git a/editor/resources/circle.png b/editor/resources/circle.png new file mode 100644 index 0000000..0d6ef04 Binary files /dev/null and b/editor/resources/circle.png differ diff --git a/editor/resources/clear.png b/editor/resources/clear.png new file mode 100644 index 0000000..ac0b40d Binary files /dev/null and b/editor/resources/clear.png differ diff --git a/editor/resources/close.png b/editor/resources/close.png new file mode 100644 index 0000000..dd6a4b0 Binary files /dev/null and b/editor/resources/close.png differ diff --git a/editor/resources/collapse.png b/editor/resources/collapse.png new file mode 100644 index 0000000..c3ce87d Binary files /dev/null and b/editor/resources/collapse.png differ diff --git a/editor/resources/collider.png b/editor/resources/collider.png new file mode 100644 index 0000000..1c36eb3 Binary files /dev/null and b/editor/resources/collider.png differ diff --git a/editor/resources/copy.png b/editor/resources/copy.png new file mode 100644 index 0000000..54db7de Binary files /dev/null and b/editor/resources/copy.png differ diff --git a/editor/resources/cross.png b/editor/resources/cross.png new file mode 100644 index 0000000..df420c1 Binary files /dev/null and b/editor/resources/cross.png differ diff --git a/editor/resources/cube.png b/editor/resources/cube.png new file mode 100644 index 0000000..b209c3a Binary files /dev/null and b/editor/resources/cube.png differ diff --git a/editor/resources/curve.png b/editor/resources/curve.png new file mode 100644 index 0000000..2ab3678 Binary files /dev/null and b/editor/resources/curve.png differ diff --git a/editor/resources/die.png b/editor/resources/die.png new file mode 100644 index 0000000..b10b179 Binary files /dev/null and b/editor/resources/die.png differ diff --git a/editor/resources/doc.png b/editor/resources/doc.png new file mode 100644 index 0000000..ba24e19 Binary files /dev/null and b/editor/resources/doc.png differ diff --git a/editor/resources/eraser.png b/editor/resources/eraser.png new file mode 100644 index 0000000..09be4b9 Binary files /dev/null and b/editor/resources/eraser.png differ diff --git a/editor/resources/expand.png b/editor/resources/expand.png new file mode 100644 index 0000000..b3767bf Binary files /dev/null and b/editor/resources/expand.png differ diff --git a/editor/resources/eye.png b/editor/resources/eye.png new file mode 100644 index 0000000..3a7499d Binary files /dev/null and b/editor/resources/eye.png differ diff --git a/editor/resources/fileBrowser-icon.png b/editor/resources/fileBrowser-icon.png new file mode 100644 index 0000000..34ba002 Binary files /dev/null and b/editor/resources/fileBrowser-icon.png differ diff --git a/editor/resources/fill.png b/editor/resources/fill.png new file mode 100644 index 0000000..555f6eb Binary files /dev/null and b/editor/resources/fill.png differ diff --git a/editor/resources/filter.png b/editor/resources/filter.png new file mode 100644 index 0000000..bdaa7b7 Binary files /dev/null and b/editor/resources/filter.png differ diff --git a/editor/resources/fit.png b/editor/resources/fit.png new file mode 100644 index 0000000..29d81ea Binary files /dev/null and b/editor/resources/fit.png differ diff --git a/editor/resources/flip_x.png b/editor/resources/flip_x.png new file mode 100644 index 0000000..377fb63 Binary files /dev/null and b/editor/resources/flip_x.png differ diff --git a/editor/resources/flip_y.png b/editor/resources/flip_y.png new file mode 100644 index 0000000..2204399 Binary files /dev/null and b/editor/resources/flip_y.png differ diff --git a/editor/resources/folder.png b/editor/resources/folder.png new file mode 100644 index 0000000..ad46fc5 Binary files /dev/null and b/editor/resources/folder.png differ diff --git a/editor/resources/folder_return.png b/editor/resources/folder_return.png new file mode 100644 index 0000000..b76b6df Binary files /dev/null and b/editor/resources/folder_return.png differ diff --git a/editor/resources/font.png b/editor/resources/font.png new file mode 100644 index 0000000..eb5b964 Binary files /dev/null and b/editor/resources/font.png differ diff --git a/editor/resources/game_scene.png b/editor/resources/game_scene.png new file mode 100644 index 0000000..087322b Binary files /dev/null and b/editor/resources/game_scene.png differ diff --git a/editor/resources/grid-icon.png b/editor/resources/grid-icon.png new file mode 100644 index 0000000..4cb9c49 Binary files /dev/null and b/editor/resources/grid-icon.png differ diff --git a/editor/resources/grid_snapping.png b/editor/resources/grid_snapping.png new file mode 100644 index 0000000..4749ce8 Binary files /dev/null and b/editor/resources/grid_snapping.png differ diff --git a/editor/resources/hammer.png b/editor/resources/hammer.png new file mode 100644 index 0000000..634ed24 Binary files /dev/null and b/editor/resources/hammer.png differ diff --git a/editor/resources/hourglass.png b/editor/resources/hourglass.png new file mode 100644 index 0000000..c169dc3 Binary files /dev/null and b/editor/resources/hourglass.png differ diff --git a/editor/resources/hrir.png b/editor/resources/hrir.png new file mode 100644 index 0000000..5fbce19 Binary files /dev/null and b/editor/resources/hrir.png differ diff --git a/editor/resources/icon.png b/editor/resources/icon.png new file mode 100644 index 0000000..7c95f21 Binary files /dev/null and b/editor/resources/icon.png differ diff --git a/editor/resources/image-icon.png b/editor/resources/image-icon.png new file mode 100644 index 0000000..90e427a Binary files /dev/null and b/editor/resources/image-icon.png differ diff --git a/editor/resources/import.png b/editor/resources/import.png new file mode 100644 index 0000000..3b7819d Binary files /dev/null and b/editor/resources/import.png differ diff --git a/editor/resources/inspector-icon.png b/editor/resources/inspector-icon.png new file mode 100644 index 0000000..93e7df4 Binary files /dev/null and b/editor/resources/inspector-icon.png differ diff --git a/editor/resources/invisible.png b/editor/resources/invisible.png new file mode 100644 index 0000000..7aab993 Binary files /dev/null and b/editor/resources/invisible.png differ diff --git a/editor/resources/joint.png b/editor/resources/joint.png new file mode 100644 index 0000000..8dddacb Binary files /dev/null and b/editor/resources/joint.png differ diff --git a/editor/resources/key.png b/editor/resources/key.png new file mode 100644 index 0000000..c3ea834 Binary files /dev/null and b/editor/resources/key.png differ diff --git a/editor/resources/light.png b/editor/resources/light.png new file mode 100644 index 0000000..52873f5 Binary files /dev/null and b/editor/resources/light.png differ diff --git a/editor/resources/light_source.png b/editor/resources/light_source.png new file mode 100644 index 0000000..4978e5e Binary files /dev/null and b/editor/resources/light_source.png differ diff --git a/editor/resources/line.png b/editor/resources/line.png new file mode 100644 index 0000000..9f1b634 Binary files /dev/null and b/editor/resources/line.png differ diff --git a/editor/resources/link.png b/editor/resources/link.png new file mode 100644 index 0000000..b366d31 Binary files /dev/null and b/editor/resources/link.png differ diff --git a/editor/resources/list-icon.png b/editor/resources/list-icon.png new file mode 100644 index 0000000..b9abcb2 Binary files /dev/null and b/editor/resources/list-icon.png differ diff --git a/editor/resources/locate.png b/editor/resources/locate.png new file mode 100644 index 0000000..cc74805 Binary files /dev/null and b/editor/resources/locate.png differ diff --git a/editor/resources/loop.png b/editor/resources/loop.png new file mode 100644 index 0000000..655c239 Binary files /dev/null and b/editor/resources/loop.png differ diff --git a/editor/resources/material.png b/editor/resources/material.png new file mode 100644 index 0000000..7052027 Binary files /dev/null and b/editor/resources/material.png differ diff --git a/editor/resources/menu-icon.png b/editor/resources/menu-icon.png new file mode 100644 index 0000000..d96f1ec Binary files /dev/null and b/editor/resources/menu-icon.png differ diff --git a/editor/resources/messageBox-icon.png b/editor/resources/messageBox-icon.png new file mode 100644 index 0000000..835509e Binary files /dev/null and b/editor/resources/messageBox-icon.png differ diff --git a/editor/resources/model.png b/editor/resources/model.png new file mode 100644 index 0000000..2073caa Binary files /dev/null and b/editor/resources/model.png differ diff --git a/editor/resources/move_arrow.png b/editor/resources/move_arrow.png new file mode 100644 index 0000000..0a0fc9b Binary files /dev/null and b/editor/resources/move_arrow.png differ diff --git a/editor/resources/navmesh.png b/editor/resources/navmesh.png new file mode 100644 index 0000000..651134a Binary files /dev/null and b/editor/resources/navmesh.png differ diff --git a/editor/resources/nine_slice.png b/editor/resources/nine_slice.png new file mode 100644 index 0000000..f28c085 Binary files /dev/null and b/editor/resources/nine_slice.png differ diff --git a/editor/resources/open-folder.png b/editor/resources/open-folder.png new file mode 100644 index 0000000..78281e7 Binary files /dev/null and b/editor/resources/open-folder.png differ diff --git a/editor/resources/palette.png b/editor/resources/palette.png new file mode 100644 index 0000000..a09d981 Binary files /dev/null and b/editor/resources/palette.png differ diff --git a/editor/resources/pick.png b/editor/resources/pick.png new file mode 100644 index 0000000..e25c34c Binary files /dev/null and b/editor/resources/pick.png differ diff --git a/editor/resources/pipette.png b/editor/resources/pipette.png new file mode 100644 index 0000000..195e55b Binary files /dev/null and b/editor/resources/pipette.png differ diff --git a/editor/resources/play.png b/editor/resources/play.png new file mode 100644 index 0000000..c2a6871 Binary files /dev/null and b/editor/resources/play.png differ diff --git a/editor/resources/play_pause.png b/editor/resources/play_pause.png new file mode 100644 index 0000000..f30407f Binary files /dev/null and b/editor/resources/play_pause.png differ diff --git a/editor/resources/popup-icon.png b/editor/resources/popup-icon.png new file mode 100644 index 0000000..1818c84 Binary files /dev/null and b/editor/resources/popup-icon.png differ diff --git a/editor/resources/position_track.png b/editor/resources/position_track.png new file mode 100644 index 0000000..15cd936 Binary files /dev/null and b/editor/resources/position_track.png differ diff --git a/editor/resources/property_track.png b/editor/resources/property_track.png new file mode 100644 index 0000000..fb7a252 Binary files /dev/null and b/editor/resources/property_track.png differ diff --git a/editor/resources/recent.png b/editor/resources/recent.png new file mode 100644 index 0000000..19b42db Binary files /dev/null and b/editor/resources/recent.png differ diff --git a/editor/resources/rect_fill.png b/editor/resources/rect_fill.png new file mode 100644 index 0000000..3f45aea Binary files /dev/null and b/editor/resources/rect_fill.png differ diff --git a/editor/resources/redo.png b/editor/resources/redo.png new file mode 100644 index 0000000..4cc1f98 Binary files /dev/null and b/editor/resources/redo.png differ diff --git a/editor/resources/reimport.png b/editor/resources/reimport.png new file mode 100644 index 0000000..32e1fef Binary files /dev/null and b/editor/resources/reimport.png differ diff --git a/editor/resources/rename.png b/editor/resources/rename.png new file mode 100644 index 0000000..47d31b1 Binary files /dev/null and b/editor/resources/rename.png differ diff --git a/editor/resources/resave.png b/editor/resources/resave.png new file mode 100644 index 0000000..d1fa7cd Binary files /dev/null and b/editor/resources/resave.png differ diff --git a/editor/resources/rigid_body.png b/editor/resources/rigid_body.png new file mode 100644 index 0000000..1848b8e Binary files /dev/null and b/editor/resources/rigid_body.png differ diff --git a/editor/resources/root_motion.png b/editor/resources/root_motion.png new file mode 100644 index 0000000..83bc0db Binary files /dev/null and b/editor/resources/root_motion.png differ diff --git a/editor/resources/rotate_arrow.png b/editor/resources/rotate_arrow.png new file mode 100644 index 0000000..0d25546 Binary files /dev/null and b/editor/resources/rotate_arrow.png differ diff --git a/editor/resources/rotation_track.png b/editor/resources/rotation_track.png new file mode 100644 index 0000000..1ca7ef6 Binary files /dev/null and b/editor/resources/rotation_track.png differ diff --git a/editor/resources/save-as.png b/editor/resources/save-as.png new file mode 100644 index 0000000..f6c0fbb Binary files /dev/null and b/editor/resources/save-as.png differ diff --git a/editor/resources/save.png b/editor/resources/save.png new file mode 100644 index 0000000..63fe8aa Binary files /dev/null and b/editor/resources/save.png differ diff --git a/editor/resources/save_all.png b/editor/resources/save_all.png new file mode 100644 index 0000000..00ed5b5 Binary files /dev/null and b/editor/resources/save_all.png differ diff --git a/editor/resources/scale_arrow.png b/editor/resources/scale_arrow.png new file mode 100644 index 0000000..ffa122b Binary files /dev/null and b/editor/resources/scale_arrow.png differ diff --git a/editor/resources/scaling_track.png b/editor/resources/scaling_track.png new file mode 100644 index 0000000..a6489ec Binary files /dev/null and b/editor/resources/scaling_track.png differ diff --git a/editor/resources/screen-icon.png b/editor/resources/screen-icon.png new file mode 100644 index 0000000..6003df4 Binary files /dev/null and b/editor/resources/screen-icon.png differ diff --git a/editor/resources/select.png b/editor/resources/select.png new file mode 100644 index 0000000..6b3a183 Binary files /dev/null and b/editor/resources/select.png differ diff --git a/editor/resources/select_in_wv.png b/editor/resources/select_in_wv.png new file mode 100644 index 0000000..8469c5f Binary files /dev/null and b/editor/resources/select_in_wv.png differ diff --git a/editor/resources/settings.png b/editor/resources/settings.png new file mode 100644 index 0000000..9891614 Binary files /dev/null and b/editor/resources/settings.png differ diff --git a/editor/resources/shader.png b/editor/resources/shader.png new file mode 100644 index 0000000..0b52914 Binary files /dev/null and b/editor/resources/shader.png differ diff --git a/editor/resources/shaders/gizmo.shader b/editor/resources/shaders/gizmo.shader new file mode 100644 index 0000000..7023806 --- /dev/null +++ b/editor/resources/shaders/gizmo.shader @@ -0,0 +1,85 @@ +( + name: "GizmoShader", + + resources: [ + ( + name: "properties", + kind: PropertyGroup([ + ( + name: "diffuseColor", + kind: Color(r: 255, g: 255, b: 255, a: 255), + ), + ]), + binding: 0 + ), + ( + name: "fyrox_instanceData", + kind: PropertyGroup([ + // Autogenerated + ]), + binding: 1 + ), + ], + + disabled_passes: ["GBuffer", "DirectionalShadow", "PointShadow", "SpotShadow"], + + passes: [ + ( + name: "Forward", + draw_parameters: DrawParameters( + cull_face: None, + color_write: ColorMask( + red: true, + green: true, + blue: true, + alpha: true, + ), + depth_write: true, + stencil_test: None, + depth_test: Some(Less), + blend: Some(BlendParameters( + func: BlendFunc( + sfactor: SrcAlpha, + dfactor: OneMinusSrcAlpha, + alpha_sfactor: SrcAlpha, + alpha_dfactor: OneMinusSrcAlpha, + ), + equation: BlendEquation( + rgb: Add, + alpha: Add + ) + )), + stencil_op: StencilOp( + fail: Keep, + zfail: Keep, + zpass: Keep, + write_mask: 0xFFFF_FFFF, + ), + scissor_box: None + ), + vertex_shader: + r#" + layout(location = 0) in vec3 vertexPosition; + + void main() + { + gl_Position = fyrox_instanceData.worldViewProjection * vec4(vertexPosition, 1.0); + } + "#, + + fragment_shader: + r#" + out vec4 FragColor; + + void main() + { + FragColor = properties.diffuseColor; + + // Pull depth towards near clipping plane so the gizmo will be drawn on top + // of everything, but its parts will be correctly handled by depth test. + gl_FragDepth = gl_FragCoord.z * 0.001; + } + "#, + ), + ], +) \ No newline at end of file diff --git a/editor/resources/shaders/grid.shader b/editor/resources/shaders/grid.shader new file mode 100644 index 0000000..1b21785 --- /dev/null +++ b/editor/resources/shaders/grid.shader @@ -0,0 +1,205 @@ +( + name: "GridShader", + + resources: [ + ( + name: "properties", + kind: PropertyGroup([ + ( + name: "diffuseColor", + kind: Color(r: 40, g: 40, b: 40, a: 255), + ), + ( + name: "xAxisColor", + kind: Color(r: 255, g: 0, b: 0, a: 255), + ), + ( + name: "yAxisColor", + kind: Color(r: 0, g: 255, b: 0, a: 255), + ), + ( + name: "zAxisColor", + kind: Color(r: 0, g: 0, b: 255, a: 255), + ), + ( + name: "orientation", + kind: Int(value: 0), + ), + ( + name: "isPerspective", + kind: Bool(value: false) + ), + ( + name: "scale", + kind: Vector2(value: (1.0, 1.0)) + ) + ]), + binding: 0 + ), + ( + name: "fyrox_cameraData", + kind: PropertyGroup([ + // Autogenerated + ]), + binding: 1 + ), + ], + + disabled_passes: ["GBuffer", "DirectionalShadow", "PointShadow", "SpotShadow"], + + passes: [ + ( + name: "Forward", + draw_parameters: DrawParameters( + cull_face: None, + color_write: ColorMask( + red: true, + green: true, + blue: true, + alpha: true, + ), + depth_write: true, + stencil_test: None, + depth_test: Some(Less), + blend: Some(BlendParameters( + func: BlendFunc( + sfactor: SrcAlpha, + dfactor: OneMinusSrcAlpha, + alpha_sfactor: SrcAlpha, + alpha_dfactor: OneMinusSrcAlpha, + ), + equation: BlendEquation( + rgb: Add, + alpha: Add + ) + )), + stencil_op: StencilOp( + fail: Keep, + zfail: Keep, + zpass: Keep, + write_mask: 0xFFFF_FFFF, + ), + scissor_box: None + ), + vertex_shader: + r#" + layout(location = 0) in vec3 vertexPosition; + + out vec3 nearPoint; + out vec3 farPoint; + + vec3 Unproject(float x, float y, float z, mat4 matrix) + { + vec4 position = matrix * vec4(x, y, z, 1.0); + return position.xyz / position.w; + } + + void main() + { + mat4 invViewProj = inverse(fyrox_cameraData.viewProjectionMatrix); + nearPoint = Unproject(vertexPosition.x, vertexPosition.y, 0.0, invViewProj); + farPoint = Unproject(vertexPosition.x, vertexPosition.y, 1.0, invViewProj); + gl_Position = vec4(vertexPosition, 1.0); + } + "#, + + fragment_shader: + r#" + // Original code: https://asliceofrendering.com/scene%20helper/2020/01/05/InfiniteGrid/ + // Fixed and adapted for Fyrox. + + out vec4 FragColor; + + in vec3 nearPoint; + in vec3 farPoint; + + vec4 grid(vec3 fragPos3D) { + vec2 projection; + vec3 planeNormal; + vec4 xColor; + vec4 yColor; + if (properties.orientation == 0) { + projection = fragPos3D.xz; + planeNormal = vec3(0.0, 1.0, 0.0); + xColor = properties.xAxisColor; + yColor = properties.zAxisColor; + } else if (properties.orientation == 1) { + projection = fragPos3D.xy; + planeNormal = vec3(0.0, 0.0, 1.0); + xColor = properties.yAxisColor; + yColor = properties.xAxisColor; + } else if (properties.orientation == 2) { + projection = fragPos3D.zy; + planeNormal = vec3(1.0, 0.0, 0.0); + xColor = properties.zAxisColor; + yColor = properties.yAxisColor; + } + + vec2 coord = projection * properties.scale; + vec2 derivative = fwidth(coord); + vec2 grid = abs(fract(coord - 0.5) - 0.5) / derivative; + float line = min(grid.x, grid.y); + float minX = 0.5 * min(derivative.x, 1.0); + float minY = 0.5 * min(derivative.y, 1.0); + + vec4 color = properties.diffuseColor; + float alpha = 1.0 - min(line, 1.0); + // Sharpen lines a bit. + color.a = alpha >= 0.5 ? 1.0 : 0.0; + + if (projection.x > -minX && projection.x < minX) { + color.xyz = xColor.xyz; + } else if (projection.y > -minY && projection.y < minY) { + color.xyz = yColor.xyz; + } else { + vec3 viewDir = fragPos3D - fyrox_cameraData.position; + // This helps to negate moire pattern at large distances. + float cosAngle = abs(dot(planeNormal, normalize(viewDir))); + color.a *= cosAngle; + } + + return color; + } + + float computeDepth(vec3 pos) { + vec4 clip_space_pos = fyrox_cameraData.viewProjectionMatrix * vec4(pos.xyz, 1.0); + return (clip_space_pos.z / clip_space_pos.w); + } + + void main() + { + float nearCoord; + float farCoord; + if (properties.orientation == 0) { + nearCoord = nearPoint.y; + farCoord = farPoint.y; + } else if (properties.orientation == 1) { + nearCoord = nearPoint.z; + farCoord = farPoint.z; + } else if (properties.orientation == 2) { + nearCoord = nearPoint.x; + farCoord = farPoint.x; + } + + float denominator = farCoord - nearCoord; + float t = denominator != 0.0 ? -nearCoord / denominator : 0.0; + + vec3 fragPos3D = nearPoint + t * (farPoint - nearPoint); + + float depth = computeDepth(fragPos3D); + gl_FragDepth = ((gl_DepthRange.diff * depth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0; + + FragColor = grid(fragPos3D); + if (properties.isPerspective) { + FragColor.a *= float(t > 0.0); + } + + // Alpha test to prevent blending issues. + if (FragColor.a < 0.01) { + discard; + } + } + "#, + ), + ], +) \ No newline at end of file diff --git a/editor/resources/shaders/highlight.shader b/editor/resources/shaders/highlight.shader new file mode 100644 index 0000000..5987561 --- /dev/null +++ b/editor/resources/shaders/highlight.shader @@ -0,0 +1,100 @@ +( + name: "Highlight", + resources: [ + ( + name: "frameTexture", + kind: Texture(kind: Sampler2D, fallback: White), + binding: 0 + ), + ( + name: "properties", + kind: PropertyGroup([ + (name: "worldViewProjection", kind: Matrix4()), + (name: "color", kind: Vector4()), + ]), + binding: 0 + ), + ], + passes: [ + ( + name: "Primary", + + draw_parameters: DrawParameters( + cull_face: None, + color_write: ColorMask( + red: true, + green: true, + blue: true, + alpha: true, + ), + depth_write: false, + stencil_test: None, + depth_test: None, + blend: Some(BlendParameters( + func: BlendFunc( + sfactor: SrcAlpha, + dfactor: OneMinusSrcAlpha, + alpha_sfactor: SrcAlpha, + alpha_dfactor: OneMinusSrcAlpha, + ), + equation: BlendEquation( + rgb: Add, + alpha: Add + ) + )), + stencil_op: StencilOp( + fail: Keep, + zfail: Keep, + zpass: Keep, + write_mask: 0xFFFF_FFFF, + ), + scissor_box: None + ), + + vertex_shader: + r#" + layout(location = 0) in vec3 vertexPosition; + layout(location = 1) in vec2 vertexTexCoord; + + out vec2 texCoord; + + void main() + { + texCoord = vertexTexCoord; + gl_Position = properties.worldViewProjection * vec4(vertexPosition, 1.0); + } + "#, + + fragment_shader: + r#" + layout (location = 0) out vec4 outColor; + + in vec2 texCoord; + + void main() { + ivec2 size = textureSize(frameTexture, 0); + + float w = 1.0 / float(size.x); + float h = 1.0 / float(size.y); + + float n[9]; + n[0] = texture(frameTexture, texCoord + vec2(-w, -h)).a; + n[1] = texture(frameTexture, texCoord + vec2(0.0, -h)).a; + n[2] = texture(frameTexture, texCoord + vec2(w, -h)).a; + n[3] = texture(frameTexture, texCoord + vec2( -w, 0.0)).a; + n[4] = texture(frameTexture, texCoord).a; + n[5] = texture(frameTexture, texCoord + vec2(w, 0.0)).a; + n[6] = texture(frameTexture, texCoord + vec2(-w, h)).a; + n[7] = texture(frameTexture, texCoord + vec2(0.0, h)).a; + n[8] = texture(frameTexture, texCoord + vec2(w, h)).a; + + float sobel_edge_h = n[2] + (2.0 * n[5]) + n[8] - (n[0] + (2.0 * n[3]) + n[6]); + float sobel_edge_v = n[0] + (2.0 * n[1]) + n[2] - (n[6] + (2.0 * n[7]) + n[8]); + float sobel = sqrt((sobel_edge_h * sobel_edge_h) + (sobel_edge_v * sobel_edge_v)); + + outColor = vec4(properties.color.rgb, properties.color.a * sobel); + } + "#, + ) + ] +) \ No newline at end of file diff --git a/editor/resources/shaders/overlay.shader b/editor/resources/shaders/overlay.shader new file mode 100644 index 0000000..07c4341 --- /dev/null +++ b/editor/resources/shaders/overlay.shader @@ -0,0 +1,87 @@ +( + name: "Overlay", + resources: [ + ( + name: "diffuseTexture", + kind: Texture(kind: Sampler2D, fallback: White), + binding: 0 + ), + ( + name: "properties", + kind: PropertyGroup([ + (name: "viewProjectionMatrix", kind: Matrix4()), + (name: "worldMatrix", kind: Matrix4()), + (name: "cameraSideVector", kind: Vector3()), + (name: "cameraUpVector", kind: Vector3()), + (name: "size", kind: Float()), + ]), + binding: 0 + ), + ], + passes: [ + ( + name: "Primary", + + draw_parameters: DrawParameters( + cull_face: None, + color_write: ColorMask( + red: true, + green: true, + blue: true, + alpha: true, + ), + depth_write: false, + stencil_test: None, + depth_test: None, + blend: Some(BlendParameters( + func: BlendFunc( + sfactor: SrcAlpha, + dfactor: OneMinusSrcAlpha, + alpha_sfactor: SrcAlpha, + alpha_dfactor: OneMinusSrcAlpha, + ), + equation: BlendEquation( + rgb: Add, + alpha: Add + ) + )), + stencil_op: StencilOp( + fail: Keep, + zfail: Keep, + zpass: Keep, + write_mask: 0xFFFF_FFFF, + ), + scissor_box: None + ), + + vertex_shader: + r#" + layout (location = 0) in vec3 vertexPosition; + layout (location = 1) in vec2 vertexTexCoord; + + out vec2 texCoord; + + void main() + { + texCoord = vertexTexCoord; + vec2 vertexOffset = vertexTexCoord * 2.0 - 1.0; + vec4 worldPosition = properties.worldMatrix * vec4(vertexPosition, 1.0); + vec3 offset = (vertexOffset.x * properties.cameraSideVector + vertexOffset.y * properties.cameraUpVector) * properties.size; + gl_Position = properties.viewProjectionMatrix * (worldPosition + vec4(offset.x, offset.y, offset.z, 0.0)); + } + "#, + + fragment_shader: + r#" + out vec4 FragColor; + + in vec2 texCoord; + + void main() + { + FragColor = texture(diffuseTexture, texCoord); + } + "#, + ) + ] +) \ No newline at end of file diff --git a/editor/resources/shaders/sprite_gizmo.shader b/editor/resources/shaders/sprite_gizmo.shader new file mode 100644 index 0000000..442e73c --- /dev/null +++ b/editor/resources/shaders/sprite_gizmo.shader @@ -0,0 +1,104 @@ +( + name: "SpriteGizmoShader", + + resources: [ + ( + name: "diffuseTexture", + kind: Texture(kind: Sampler2D, fallback: White), + binding: 0 + ), + ( + name: "fyrox_instanceData", + kind: PropertyGroup([ + // Autogenerated + ]), + binding: 0 + ), + ( + name: "fyrox_cameraData", + kind: PropertyGroup([ + // Autogenerated + ]), + binding: 1 + ), + ], + + disabled_passes: ["GBuffer", "DirectionalShadow", "PointShadow", "SpotShadow"], + + passes: [ + ( + name: "Forward", + draw_parameters: DrawParameters( + cull_face: None, + color_write: ColorMask( + red: true, + green: true, + blue: true, + alpha: true, + ), + depth_write: true, + stencil_test: None, + depth_test: Some(Less), + blend: Some(BlendParameters( + func: BlendFunc( + sfactor: SrcAlpha, + dfactor: OneMinusSrcAlpha, + alpha_sfactor: SrcAlpha, + alpha_dfactor: OneMinusSrcAlpha, + ), + equation: BlendEquation( + rgb: Add, + alpha: Add + ) + )), + stencil_op: StencilOp( + fail: Keep, + zfail: Keep, + zpass: Keep, + write_mask: 0xFFFF_FFFF, + ), + scissor_box: None + ), + vertex_shader: + r#" + layout(location = 0) in vec3 vertexPosition; + layout(location = 1) in vec2 vertexTexCoord; + layout(location = 2) in vec2 vertexParams; + layout(location = 3) in vec4 vertexColor; + + out vec2 texCoord; + out vec4 color; + + void main() + { + float size = vertexParams.x; + float rotation = vertexParams.y; + + texCoord = vertexTexCoord; + color = vertexColor; + vec2 vertexOffset = S_RotateVec2(vertexTexCoord * 2.0 - 1.0, rotation); + vec4 worldPosition = fyrox_instanceData.worldMatrix * vec4(vertexPosition, 1.0); + vec3 offset = (vertexOffset.x * fyrox_cameraData.sideVector + vertexOffset.y * fyrox_cameraData.upVector) * size; + gl_Position = fyrox_cameraData.viewProjectionMatrix * (worldPosition + vec4(offset.x, offset.y, offset.z, 0.0)); + } + "#, + + fragment_shader: + r#" + out vec4 FragColor; + + in vec2 texCoord; + in vec4 color; + + void main() + { + FragColor = color * S_SRGBToLinear(texture(diffuseTexture, texCoord)); + + // Pull depth towards near clipping plane so the gizmo will be drawn on top + // of everything, but its parts will be correctly handled by depth test. + gl_FragDepth = gl_FragCoord.z * 0.001; + } + "#, + ), + ], +) \ No newline at end of file diff --git a/editor/resources/sound.png b/editor/resources/sound.png new file mode 100644 index 0000000..8993182 Binary files /dev/null and b/editor/resources/sound.png differ diff --git a/editor/resources/sound_source.png b/editor/resources/sound_source.png new file mode 100644 index 0000000..ec727a4 Binary files /dev/null and b/editor/resources/sound_source.png differ diff --git a/editor/resources/speed.png b/editor/resources/speed.png new file mode 100644 index 0000000..3c038d3 Binary files /dev/null and b/editor/resources/speed.png differ diff --git a/editor/resources/stackPanel-icon.png b/editor/resources/stackPanel-icon.png new file mode 100644 index 0000000..8014ae7 Binary files /dev/null and b/editor/resources/stackPanel-icon.png differ diff --git a/editor/resources/stop.png b/editor/resources/stop.png new file mode 100644 index 0000000..252bc73 Binary files /dev/null and b/editor/resources/stop.png differ diff --git a/editor/resources/terrain.png b/editor/resources/terrain.png new file mode 100644 index 0000000..fe59bdb Binary files /dev/null and b/editor/resources/terrain.png differ diff --git a/editor/resources/text-icon.png b/editor/resources/text-icon.png new file mode 100644 index 0000000..09281e0 Binary files /dev/null and b/editor/resources/text-icon.png differ diff --git a/editor/resources/tile.png b/editor/resources/tile.png new file mode 100644 index 0000000..da45d3b Binary files /dev/null and b/editor/resources/tile.png differ diff --git a/editor/resources/tile_set.png b/editor/resources/tile_set.png new file mode 100644 index 0000000..09f331c Binary files /dev/null and b/editor/resources/tile_set.png differ diff --git a/editor/resources/time.png b/editor/resources/time.png new file mode 100644 index 0000000..7f0d62f Binary files /dev/null and b/editor/resources/time.png differ diff --git a/editor/resources/track.png b/editor/resources/track.png new file mode 100644 index 0000000..9e5f06c Binary files /dev/null and b/editor/resources/track.png differ diff --git a/editor/resources/triangle.png b/editor/resources/triangle.png new file mode 100644 index 0000000..4dbce43 Binary files /dev/null and b/editor/resources/triangle.png differ diff --git a/editor/resources/turn_left.png b/editor/resources/turn_left.png new file mode 100644 index 0000000..0f98456 Binary files /dev/null and b/editor/resources/turn_left.png differ diff --git a/editor/resources/turn_right.png b/editor/resources/turn_right.png new file mode 100644 index 0000000..f8a2972 Binary files /dev/null and b/editor/resources/turn_right.png differ diff --git a/editor/resources/ui.png b/editor/resources/ui.png new file mode 100644 index 0000000..39d99da Binary files /dev/null and b/editor/resources/ui.png differ diff --git a/editor/resources/ui_scene.png b/editor/resources/ui_scene.png new file mode 100644 index 0000000..046c2b5 Binary files /dev/null and b/editor/resources/ui_scene.png differ diff --git a/editor/resources/undo.png b/editor/resources/undo.png new file mode 100644 index 0000000..7f42f36 Binary files /dev/null and b/editor/resources/undo.png differ diff --git a/editor/resources/visible.png b/editor/resources/visible.png new file mode 100644 index 0000000..f16a3ce Binary files /dev/null and b/editor/resources/visible.png differ diff --git a/editor/resources/warning.png b/editor/resources/warning.png new file mode 100644 index 0000000..f5ff6a8 Binary files /dev/null and b/editor/resources/warning.png differ diff --git a/editor/resources/window-icon.png b/editor/resources/window-icon.png new file mode 100644 index 0000000..429229e Binary files /dev/null and b/editor/resources/window-icon.png differ diff --git a/editor/screenshots/latest.png b/editor/screenshots/latest.png new file mode 100644 index 0000000..4738431 Binary files /dev/null and b/editor/screenshots/latest.png differ diff --git a/editor/src/asset/creator.rs b/editor/src/asset/creator.rs new file mode 100644 index 0000000..0b04df3 --- /dev/null +++ b/editor/src/asset/creator.rs @@ -0,0 +1,268 @@ +// Copyright (c) 2019-present Dmitry Stepanov and Fyrox Engine contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +use crate::{ + fyrox::{ + asset::{ + manager::ResourceManager, + untyped::{ResourceKind, UntypedResource}, + }, + core::{log::Log, make_pretty_type_name, pool::Handle, SafeLock}, + engine::Engine, + gui::{ + button::{ButtonBuilder, ButtonMessage}, + grid::{Column, GridBuilder, Row}, + list_view::{ListViewBuilder, ListViewMessage}, + message::UiMessage, + stack_panel::StackPanelBuilder, + text::TextMessage, + text_box::TextBoxBuilder, + utils::make_dropdown_list_option, + widget::{WidgetBuilder, WidgetMessage}, + window::{WindowBuilder, WindowMessage, WindowTitle}, + BuildContext, HorizontalAlignment, Orientation, Thickness, UserInterface, + }, + }, + message::MessageSender, + Message, +}; +use fyrox::core::uuid::Uuid; +use fyrox::gui::button::Button; +use fyrox::gui::list_view::ListView; +use fyrox::gui::text_box::TextBox; +use fyrox::gui::window::{Window, WindowAlignment}; +use std::path::{Path, PathBuf}; + +pub struct ResourceCreator { + pub window: Handle, + resource_constructors_list: Handle, + ok: Handle