mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
Compare commits
264 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a097c0a2f4 | |||
| 20ae2b4dd1 | |||
| 115b5a3471 | |||
| 77893629f9 | |||
| afb27b1aa9 | |||
| 61006122ae | |||
| 4eb0f59fc0 | |||
| 3b4bf24a16 | |||
| 51d93c4464 | |||
| d83a8121db | |||
| 2584cda5c3 | |||
| c90497f77b | |||
| 0de6b4589f | |||
| 8004c8c181 | |||
| 1246c4ed07 | |||
| ab463e1caa | |||
| 4f13010e7d | |||
| 83d3cc099f | |||
| 625c676010 | |||
| 2d9ed4cfc8 | |||
| 29795e9906 | |||
| 0328fef4f7 | |||
| 687772f073 | |||
| c66df11754 | |||
| 0450dc3547 | |||
| 0bd9eda48f | |||
| 858314fa0a | |||
| f277b1038c | |||
| 15c055beb7 | |||
| 4d24815f3e | |||
| d96b0cd2f7 | |||
| d238bd137f | |||
| 17b150499d | |||
| c7228c9674 | |||
| 7a9f5d4966 | |||
| a16050242a | |||
| ea8f3d8d51 | |||
| 08d2ccc03a | |||
| 21ec23d77b | |||
| 2c4ff37062 | |||
| 695a8035b5 | |||
| d12b236e56 | |||
| 7a5090d9f6 | |||
| ec76a7239c | |||
| 2758f549a3 | |||
| 493931ef0f | |||
| 9e1990942b | |||
| f1984fbe46 | |||
| f1fbea21a7 | |||
| 4b44ce0667 | |||
| 231ef35a0a | |||
| 1aa62cb396 | |||
| 8e411771c2 | |||
| d65852d1a4 | |||
| 21f5e82a20 | |||
|
|
851ec37350 | ||
| f1cd9dbeb3 | |||
| 7a1c7d6cc4 | |||
| cb704b3621 | |||
|
|
646d295876 | ||
| 8e09556c25 | |||
| 7dbebc996d | |||
| 278ffba0ff | |||
| 647cf02a38 | |||
| 4be2986681 | |||
| 06d9b4c910 | |||
| a074fdcb92 | |||
|
|
8241d9c355 | ||
| 66258f0f6d | |||
| 65541fa2c7 | |||
| 7e4a6134bf | |||
| a54a537239 | |||
| f01bbde537 | |||
| 2c710555d6 | |||
| 9c2be6306c | |||
| d37840d4ef | |||
| b4a3b5d529 | |||
| c2a772142c | |||
| 76fca7f527 | |||
| 73ccd24e3e | |||
| a642feafb5 | |||
| faf9f34af8 | |||
| b56801ac91 | |||
| a81d12d480 | |||
| 17eb0cd0dc | |||
| 52024285d2 | |||
| f179aea4d7 | |||
| 1196bb86b4 | |||
| 5489c296e9 | |||
| 50ddf2d31e | |||
| a6e4c0461d | |||
| 6749f9f759 | |||
| 9a38d47b0d | |||
| f6f8bba032 | |||
| ce08fcdd29 | |||
| 49ea113348 | |||
| af21f9a946 | |||
| f096f7179f | |||
| e025e99d18 | |||
| 30eef59360 | |||
| c2a6cf5c47 | |||
| 7f55383bc1 | |||
| 449c60133c | |||
| 31d3359507 | |||
| dd738f365d | |||
| b5e788385d | |||
| df6d75e554 | |||
| be3fae63b8 | |||
| dd731b60c3 | |||
| b06fd00673 | |||
| 998c8f3a43 | |||
| faeef594b9 | |||
| 40a301186e | |||
| a41526c494 | |||
| a0d1dc4313 | |||
| 1c5c9360c8 | |||
| 4615769682 | |||
| 4ef674f7b4 | |||
| 69b9049fb0 | |||
| 2734b58bdd | |||
| d7f1f49165 | |||
| 94b1453cae | |||
| 3e67d8a99c | |||
| 8c00ab3d9d | |||
| d14cb1e93e | |||
| c692cf39e1 | |||
| 9c934c5d9c | |||
|
|
f8202b116d | ||
| 8bf0bb8e0d | |||
| a340766348 | |||
| 254674a62e | |||
| 97c2da893b | |||
| 0ce30a7038 | |||
| 492ddfd566 | |||
| baf7ee8f88 | |||
| 9fde11733f | |||
| 0069b8bd96 | |||
| 127bae0b78 | |||
| bed204a663 | |||
| 3f6ea010dc | |||
| 592a98f38c | |||
| 7873047550 | |||
| 1601f3cbc8 | |||
| 2180f8ab97 | |||
| b613ff9ef1 | |||
| 145eadfffa | |||
| 14acebad5f | |||
| 4a7a631932 | |||
| e08c22f604 | |||
| 1b47f45af9 | |||
| 466d8f7bec | |||
| 3631c5d698 | |||
| b58956efe3 | |||
| fc1e0c62b8 | |||
|
|
8e861b8a85 | ||
|
|
55085604fd | ||
|
|
7b712ed960 | ||
| 138c996393 | |||
| 0f2a858306 | |||
| ea6c1cc929 | |||
| eeb6e40909 | |||
| d72ad663cd | |||
| 3e75d32f59 | |||
| a8ce5cbaa0 | |||
| 79f76a0755 | |||
| 5773cc7798 | |||
| b6b0184523 | |||
| a797dd134a | |||
| dc43411bd2 | |||
| 8959161904 | |||
| 5d5bd215b2 | |||
| a48a257648 | |||
| ffba4e256a | |||
| d9219cdddb | |||
| 5a1014a239 | |||
| 74f2241bcf | |||
| 8977557a61 | |||
| 481d7b85df | |||
| 2b59fb6aa2 | |||
| 4f037a1952 | |||
| ef11183c3f | |||
| 326d8baaae | |||
| e46067b0b9 | |||
| 68ac7f7b3d | |||
| 17de6d407c | |||
| 59d686e252 | |||
| 713af1b772 | |||
| a8922230b3 | |||
| b8d79eb8b4 | |||
| 5acd166d8f | |||
| c7dda0ff10 | |||
| 2688d977a9 | |||
|
|
b9ac44a901 | ||
| 35658b1f6d | |||
| 8f4b61319f | |||
| 832c2ea5ef | |||
| 50c336e044 | |||
|
|
e80e22bd5b | ||
| 27576ed761 | |||
| f85243e892 | |||
| 9b6d0beb03 | |||
| ee9829af22 | |||
| cd452b0397 | |||
| 2fa0c500a7 | |||
| 0740d0778c | |||
| f5c271cfa6 | |||
| 064a31f527 | |||
| e5d0adf247 | |||
| 8fc107ec0f | |||
| 6dd72d2448 | |||
| c76f6e91b0 | |||
| d1d06c24ca | |||
| 169011e238 | |||
| 934ca0da0a | |||
| 4200ef63a6 | |||
| 58e2c3b5b7 | |||
|
|
c3202a3bc3 | ||
|
|
39ab9d065d | ||
|
|
ed372a1c78 | ||
| 70313f5ae0 | |||
|
|
978656b573 | ||
|
|
a0f746b84c | ||
|
|
6d0d267743 | ||
| 9ba3bc754a | |||
| 3d1844fa0e | |||
| f21d29c6c2 | |||
| 28a35d5bc9 | |||
| d9684ff73f | |||
| 900501f37e | |||
| 5639cd0eb5 | |||
| 244d01c313 | |||
| e31ffac103 | |||
| ae87257adf | |||
| 906f5099d1 | |||
| 96e4e1c9d6 | |||
| 872dbe146f | |||
| e0dcb65e3f | |||
| d0c532df39 | |||
| 31907ceca3 | |||
| afcfed4834 | |||
| 835fd110ba | |||
| 29629a737d | |||
| 6a324e8c0e | |||
| 42c84f2523 | |||
| 9a4fb67289 | |||
| 824b301d40 | |||
| dcf466316c | |||
| dc0bca14c5 | |||
| b2db06a739 | |||
| cdce07f2a5 | |||
| 931937d010 | |||
| af880be056 | |||
| c3bfd12971 | |||
| 9ad8ec755b | |||
| 409cd18de6 | |||
| 001c6a8a47 | |||
| 30bc3f2c6d | |||
| 232f456a4d | |||
| 2b9575311e | |||
| e497308349 | |||
| 390e584aee | |||
| 93082d6a8d | |||
| c8c3c4e5fc | |||
|
|
24ad4ac698 |
@@ -1,62 +1,64 @@
|
||||
# Generated from CLion C/C++ Code Style settings
|
||||
---
|
||||
Language: Cpp
|
||||
# Generated by CLion for Stroustrup
|
||||
# The Stroustrup style, named after Bjarne Stroustrup, the creator of C++, is similar to the K&R style but differs
|
||||
# in its treatment of the class definitions and the placement of braces in certain contexts. The opening brace is
|
||||
# placed on the same line as the control statement, and the closing brace is on its own line.
|
||||
BasedOnStyle: LLVM
|
||||
|
||||
AccessModifierOffset: -4
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignOperands: true
|
||||
AlignConsecutiveAssignments: None
|
||||
AlignConsecutiveBitFields: None
|
||||
AlignConsecutiveDeclarations: None
|
||||
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
|
||||
AlignTrailingComments: false
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
BraceWrapping:
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
BreakTemplateDeclarations: Leave
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: true
|
||||
AfterClass: true
|
||||
AfterControlStatement: true
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterControlStatement: true
|
||||
SplitEmptyFunction: true
|
||||
AfterEnum: true
|
||||
AfterNamespace: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterExternBlock: true
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
BeforeLambdaBody: true
|
||||
BeforeWhile: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
BeforeWhile: true
|
||||
SplitEmptyRecord: true
|
||||
SplitEmptyNamespace: true
|
||||
BreakBeforeBraces: Custom
|
||||
BreakConstructorInitializers: AfterColon
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
BreakBeforeConceptDeclarations: false
|
||||
ColumnLimit: 120
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ContinuationIndentWidth: 8
|
||||
IncludeCategories:
|
||||
- Regex: '^<.*'
|
||||
Priority: 1
|
||||
- Regex: '^".*'
|
||||
Priority: 2
|
||||
- Regex: '.*'
|
||||
Priority: 3
|
||||
IncludeIsMainRegex: '([-_](test|unittest))?$'
|
||||
IndentCaseLabels: true
|
||||
IncludeBlocks: Merge
|
||||
IndentExternBlock: Indent
|
||||
IndentRequiresClause: false
|
||||
IndentWidth: 4
|
||||
InsertNewlineAtEOF: true
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 2
|
||||
ContinuationIndentWidth: 8
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
NamespaceIndentation: All
|
||||
PointerAlignment: Left
|
||||
SpaceAfterCStyleCast: true
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeCtorInitializerColon: false
|
||||
SpaceBeforeParens: Custom
|
||||
SpaceBeforeParensOptions:
|
||||
AfterControlStatements: true
|
||||
AfterFunctionDeclarationName: false
|
||||
AfterFunctionDefinitionName: false
|
||||
AfterForeachMacros: true
|
||||
AfterIfMacros: true
|
||||
AfterOverloadedOperator: false
|
||||
BeforeNonEmptyParentheses: false
|
||||
SpaceBeforeRangeBasedForLoopColon: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesInAngles: false
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
TabWidth: 4
|
||||
...
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInParentheses: false
|
||||
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
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.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
10
.github/ISSUE_TEMPLATE/custom.md
vendored
Normal file
10
.github/ISSUE_TEMPLATE/custom.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Custom issue template
|
||||
about: Describe this issue template's purpose here.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
BIN
.github/images/banner.png
vendored
Normal file
BIN
.github/images/banner.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 137 KiB |
79
.github/workflows/cmake-multi-platform.yml
vendored
Normal file
79
.github/workflows/cmake-multi-platform.yml
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
name: Omath CI (Arch Linux / Windows)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
|
||||
##############################################################################
|
||||
# 1) ARCH LINUX – Clang / Ninja
|
||||
##############################################################################
|
||||
jobs:
|
||||
arch-build-and-test:
|
||||
name: Arch Linux (Clang)
|
||||
runs-on: ubuntu-latest
|
||||
container: archlinux:latest
|
||||
|
||||
steps:
|
||||
- name: Install basic tool-chain with pacman
|
||||
shell: bash
|
||||
run: |
|
||||
pacman -Sy --noconfirm archlinux-keyring
|
||||
pacman -Syu --noconfirm --needed \
|
||||
git base-devel clang cmake ninja
|
||||
|
||||
- name: Checkout repository (with sub-modules)
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Configure (cmake --preset)
|
||||
shell: bash
|
||||
run: cmake --preset linux-release -DOMATH_BUILD_TESTS=ON
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: cmake --build cmake-build/build/linux-release --target all
|
||||
|
||||
- name: Run unit_tests
|
||||
shell: bash
|
||||
run: ./out/Release/unit_tests
|
||||
|
||||
|
||||
|
||||
##############################################################################
|
||||
# 2) Windows – MSVC / Ninja
|
||||
##############################################################################
|
||||
windows-build-and-test:
|
||||
name: Windows (MSVC)
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository (with sub-modules)
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install Ninja
|
||||
uses: seanmiddleditch/gha-setup-ninja@v4
|
||||
|
||||
- name: Set up MSVC developer command-prompt
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Configure (cmake --preset)
|
||||
shell: bash
|
||||
run: cmake --preset windows-release -DOMATH_BUILD_TESTS=ON
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: cmake --build cmake-build/build/windows-release --target all
|
||||
|
||||
- name: Run unit_tests.exe
|
||||
shell: bash
|
||||
run: ./out/Release/unit_tests.exe
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
/cmake-build/
|
||||
/.idea
|
||||
/out
|
||||
*.DS_Store
|
||||
/extlibs/vcpkg
|
||||
.idea/workspace.xml
|
||||
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
209
.idea/codeStyles/Project.xml
generated
Normal file
209
.idea/codeStyles/Project.xml
generated
Normal file
@@ -0,0 +1,209 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<RiderCodeStyleSettings>
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="LINE_BREAK" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="NEXT_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FREE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Classes_0020and_0020structs/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Classes_0020and_0020structs/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Concepts/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Concepts/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Enums/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Enums/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Unions/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Unions/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Template_0020parameters/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Template_0020parameters/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Parameters/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Local_0020variables/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Local_0020variables/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020variables/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020variables/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020functions/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020functions/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020methods/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020methods/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020fields/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020fields/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020public_0020fields/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020public_0020fields/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Union_0020members/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Union_0020members/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Enumerators/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Enumerators/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Other_0020constants/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Other_0020constants/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020constants/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020constants/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Namespaces/@EntryIndexedValue" value="<NamingElement Priority="1"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="namespace" /><type Name="namespace alias" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Typedefs/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Typedefs/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Macros/@EntryIndexedValue" value="<NamingElement Priority="7"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="macro" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AA_BB" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Properties/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Properties/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Events/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Events/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Types/@EntryIndexedValue" value="<NamingElement Priority="2"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="__interface" /><type Name="class" /><type Name="concept" /><type Name="enum" /><type Name="struct" /><type Name="type alias" /><type Name="type template parameter" /><type Name="typedef" /><type Name="union" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Functions/@EntryIndexedValue" value="<NamingElement Priority="3"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global function" /><type Name="member function" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Fields/@EntryIndexedValue" value="<NamingElement Priority="4"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="class field" /><type Name="struct field" /><type Name="union member" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Variables/@EntryIndexedValue" value="<NamingElement Priority="5"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global variable" /><type Name="local variable" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINKAGE_SPECIFICATION_BRACES/@EntryValue" value="NEXT_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=0B82708A1BA7774EB13D27F245698A56/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=0B82708A1BA7774EB13D27F245698A56/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A42D627FA43B054F91D1E1C4281D8896/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A42D627FA43B054F91D1E1C4281D8896/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A7EBF16DA3BDCB42A0B710704BC8A053/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A7EBF16DA3BDCB42A0B710704BC8A053/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2229A2BE1AA9214483A51F028530E042/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2229A2BE1AA9214483A51F028530E042/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=18392FF80FA40749AA8CC53981A32AE0/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=18392FF80FA40749AA8CC53981A32AE0/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=1350D079A82E0740947E85445B5AF47C/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=1350D079A82E0740947E85445B5AF47C/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=0AFB7787612DF743B09AD9412E48D4CC/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=0AFB7787612DF743B09AD9412E48D4CC/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=72514D5DF422D442B71A277F97B72887/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=72514D5DF422D442B71A277F97B72887/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=821F3C5CF47D5640AD3511BCBADE17C4/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=821F3C5CF47D5640AD3511BCBADE17C4/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=8F69F48E2532F54CBAA0039D4557825E/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=8F69F48E2532F54CBAA0039D4557825E/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=B6E900853D6D05429D8C57765B2E546A/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=B6E900853D6D05429D8C57765B2E546A/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=B82A063F0DDD98498A70D8D7EBB97F8D/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=B82A063F0DDD98498A70D8D7EBB97F8D/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=BBE8AA08E662BF409B2CB08EC597C493/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=BBE8AA08E662BF409B2CB08EC597C493/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=5653BA7B6222F349B94149A2A53C35B8/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=5653BA7B6222F349B94149A2A53C35B8/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=4203BE6F332C5149B409B4D5F7197E54/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=4203BE6F332C5149B409B4D5F7197E54/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2B232F1067F0324F8FF4B9D63ACECDB2/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2B232F1067F0324F8FF4B9D63ACECDB2/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=BF0D1AE66D64FE4FAF613448A12051A0/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=BF0D1AE66D64FE4FAF613448A12051A0/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=1CBDD658AEE8EA4382EE1F914B5B3314/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=1CBDD658AEE8EA4382EE1F914B5B3314/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A4FAA2257682A94F8C2C93E123FAFC7A/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A4FAA2257682A94F8C2C93E123FAFC7A/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=05D45346A5B5B54F93A9F94C46B14079/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=05D45346A5B5B54F93A9F94C46B14079/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=9E4D28CA929F6B4AB5F6F3FEB9E69A47/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=9E4D28CA929F6B4AB5F6F3FEB9E69A47/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2AD8EC23F81C6F4AB06852FBF796A3D1/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2AD8EC23F81C6F4AB06852FBF796A3D1/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=299C42B75F5A8C4DB381AE89010A7CC8/@EntryIndexedValue" value="<NamingElement Priority="1" Title="Namespaces"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="namespace" /><type Name="namespace alias" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A279BB9D47B8754E9482D81B5D3B3489/@EntryIndexedValue" value="<NamingElement Priority="2" Title="Types"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="__interface" /><type Name="class" /><type Name="concept" /><type Name="enum" /><type Name="struct" /><type Name="type alias" /><type Name="type template parameter" /><type Name="typedef" /><type Name="union" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=82D01E1970D2F6419CE2737C415D3A01/@EntryIndexedValue" value="<NamingElement Priority="3" Title="Functions"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global function" /><type Name="member function" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2A0CD4590563D04B89402AC0279B5E10/@EntryIndexedValue" value="<NamingElement Priority="4" Title="Fields"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="class field" /><type Name="struct field" /><type Name="union member" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=DC1F6BB6E0EFFC49A38E940DB8A84CF6/@EntryIndexedValue" value="<NamingElement Priority="5" Title="Variables"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global variable" /><type Name="lambda" /><type Name="local variable" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=AA17EF9DE2E5364DAEBE52F9EBBEA658/@EntryIndexedValue" value="<NamingElement Priority="6" Title="Parameters"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="function parameter" /><type Name="lambda parameter" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=9BA140847B0718418342A07C8F0CE1ED/@EntryIndexedValue" value="<NamingElement Priority="7" Title="Macros"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="macro" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AA_BB" /></NamingElement>" type="string" />
|
||||
</RiderCodeStyleSettings>
|
||||
<clangFormatSettings>
|
||||
<option name="ENABLED" value="true" />
|
||||
</clangFormatSettings>
|
||||
<files>
|
||||
<extensions>
|
||||
<pair source="cpp" header="hpp" fileNamingConvention="SNAKE_CASE" />
|
||||
<pair source="c" header="h" fileNamingConvention="NONE" />
|
||||
<pair source="cu" header="cuh" fileNamingConvention="NONE" />
|
||||
<pair source="ixx" header="" fileNamingConvention="NONE" />
|
||||
<pair source="mxx" header="" fileNamingConvention="NONE" />
|
||||
<pair source="cppm" header="" fileNamingConvention="NONE" />
|
||||
<pair source="ccm" header="" fileNamingConvention="NONE" />
|
||||
<pair source="cxxm" header="" fileNamingConvention="NONE" />
|
||||
<pair source="c++m" header="" fileNamingConvention="NONE" />
|
||||
</extensions>
|
||||
</files>
|
||||
</code_scheme>
|
||||
</component>
|
||||
6
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
6
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
||||
6
.idea/developer-tools.xml
generated
Normal file
6
.idea/developer-tools.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DeveloperToolsToolWindowSettingsV1" lastSelectedContentNodeId="code-style-formatting" pluginVersion="7.0.0">
|
||||
<developerToolsConfigurations />
|
||||
</component>
|
||||
</project>
|
||||
435
.idea/editor.xml
generated
Normal file
435
.idea/editor.xml
generated
Normal file
@@ -0,0 +1,435 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="BackendCodeEditorSettings">
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedOverridenMethod/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppModulePartitionWithSeveralPartitionUnits/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantFwdClassOrEnumSpecifier/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifierADL/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="NEXT_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FREE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINKAGE_SPECIFICATION_BRACES/@EntryValue" value="NEXT_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="LINE_BREAK" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020fields/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020fields/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020methods/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020methods/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020public_0020fields/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Class_0020and_0020struct_0020public_0020fields/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Classes_0020and_0020structs/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Classes_0020and_0020structs/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Concepts/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Concepts/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Enumerators/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Enumerators/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Enums/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Enums/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Events/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Events/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Fields/@EntryIndexedValue" value="<NamingElement Priority="4"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="class field" /><type Name="struct field" /><type Name="union member" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Functions/@EntryIndexedValue" value="<NamingElement Priority="3"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global function" /><type Name="member function" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020constants/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020constants/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020functions/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020functions/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020variables/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Global_0020variables/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Local_0020variables/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Local_0020variables/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Macros/@EntryIndexedValue" value="<NamingElement Priority="7"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="macro" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AA_BB" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Namespaces/@EntryIndexedValue" value="<NamingElement Priority="1"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="namespace" /><type Name="namespace alias" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Other_0020constants/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Other_0020constants/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Parameters/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Properties/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Properties/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Template_0020parameters/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Template_0020parameters/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Typedefs/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Typedefs/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Types/@EntryIndexedValue" value="<NamingElement Priority="2"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="__interface" /><type Name="class" /><type Name="concept" /><type Name="enum" /><type Name="struct" /><type Name="type alias" /><type Name="type template parameter" /><type Name="typedef" /><type Name="union" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Union_0020members/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Union_0020members/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Unions/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Unions/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNaming/Rules/=Variables/@EntryIndexedValue" value="<NamingElement Priority="5"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global variable" /><type Name="local variable" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=05D45346A5B5B54F93A9F94C46B14079/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=05D45346A5B5B54F93A9F94C46B14079/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=0AFB7787612DF743B09AD9412E48D4CC/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=0AFB7787612DF743B09AD9412E48D4CC/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=0B82708A1BA7774EB13D27F245698A56/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=0B82708A1BA7774EB13D27F245698A56/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=1350D079A82E0740947E85445B5AF47C/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=1350D079A82E0740947E85445B5AF47C/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=18392FF80FA40749AA8CC53981A32AE0/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=18392FF80FA40749AA8CC53981A32AE0/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=1CBDD658AEE8EA4382EE1F914B5B3314/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=1CBDD658AEE8EA4382EE1F914B5B3314/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2229A2BE1AA9214483A51F028530E042/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2229A2BE1AA9214483A51F028530E042/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=299C42B75F5A8C4DB381AE89010A7CC8/@EntryIndexedValue" value="<NamingElement Priority="1" Title="Namespaces"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="namespace" /><type Name="namespace alias" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2A0CD4590563D04B89402AC0279B5E10/@EntryIndexedValue" value="<NamingElement Priority="4" Title="Fields"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="class field" /><type Name="struct field" /><type Name="union member" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2AD8EC23F81C6F4AB06852FBF796A3D1/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2AD8EC23F81C6F4AB06852FBF796A3D1/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2B232F1067F0324F8FF4B9D63ACECDB2/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2B232F1067F0324F8FF4B9D63ACECDB2/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=4203BE6F332C5149B409B4D5F7197E54/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=4203BE6F332C5149B409B4D5F7197E54/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=5653BA7B6222F349B94149A2A53C35B8/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=5653BA7B6222F349B94149A2A53C35B8/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=72514D5DF422D442B71A277F97B72887/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=72514D5DF422D442B71A277F97B72887/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=821F3C5CF47D5640AD3511BCBADE17C4/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=821F3C5CF47D5640AD3511BCBADE17C4/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=82D01E1970D2F6419CE2737C415D3A01/@EntryIndexedValue" value="<NamingElement Priority="3" Title="Functions"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global function" /><type Name="member function" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=8F69F48E2532F54CBAA0039D4557825E/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=8F69F48E2532F54CBAA0039D4557825E/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=9BA140847B0718418342A07C8F0CE1ED/@EntryIndexedValue" value="<NamingElement Priority="7" Title="Macros"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="macro" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AA_BB" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=9E4D28CA929F6B4AB5F6F3FEB9E69A47/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=9E4D28CA929F6B4AB5F6F3FEB9E69A47/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A279BB9D47B8754E9482D81B5D3B3489/@EntryIndexedValue" value="<NamingElement Priority="2" Title="Types"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="__interface" /><type Name="class" /><type Name="concept" /><type Name="enum" /><type Name="struct" /><type Name="type alias" /><type Name="type template parameter" /><type Name="typedef" /><type Name="union" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A42D627FA43B054F91D1E1C4281D8896/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A42D627FA43B054F91D1E1C4281D8896/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A4FAA2257682A94F8C2C93E123FAFC7A/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A4FAA2257682A94F8C2C93E123FAFC7A/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A7EBF16DA3BDCB42A0B710704BC8A053/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A7EBF16DA3BDCB42A0B710704BC8A053/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=AA17EF9DE2E5364DAEBE52F9EBBEA658/@EntryIndexedValue" value="<NamingElement Priority="6" Title="Parameters"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="function parameter" /><type Name="lambda parameter" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=B6E900853D6D05429D8C57765B2E546A/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=B6E900853D6D05429D8C57765B2E546A/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=B82A063F0DDD98498A70D8D7EBB97F8D/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=B82A063F0DDD98498A70D8D7EBB97F8D/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=BBE8AA08E662BF409B2CB08EC597C493/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=BBE8AA08E662BF409B2CB08EC597C493/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=BF0D1AE66D64FE4FAF613448A12051A0/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=BF0D1AE66D64FE4FAF613448A12051A0/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=DC1F6BB6E0EFFC49A38E940DB8A84CF6/@EntryIndexedValue" value="<NamingElement Priority="5" Title="Variables"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global variable" /><type Name="lambda" /><type Name="local variable" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aa_bb" /></NamingElement>" type="string" />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
8
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="CppInconsistentNaming" enabled="true" level="HINT" enabled_by_default="true" />
|
||||
<inspection_tool class="CppTabsAreDisallowed" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="CppUnnecessaryWhitespace" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
||||
7
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
7
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="PROJECT_PROFILE" value="Default" />
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
12
.idea/misc.xml
generated
Normal file
12
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakePythonSetting">
|
||||
<option name="pythonIntegrationState" value="YES" />
|
||||
</component>
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
<component name="CidrRootsConfiguration">
|
||||
<excludeRoots>
|
||||
<file path="$PROJECT_DIR$/cmake-build" />
|
||||
</excludeRoots>
|
||||
</component>
|
||||
</project>
|
||||
2
.idea/modules.xml
generated
2
.idea/modules.xml
generated
@@ -2,7 +2,7 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/uml.iml" filepath="$PROJECT_DIR$/.idea/uml.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/omath.iml" filepath="$PROJECT_DIR$/.idea/omath.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
0
.idea/uml.iml → .idea/omath.iml
generated
0
.idea/uml.iml → .idea/omath.iml
generated
1
.idea/vcs.xml
generated
1
.idea/vcs.xml
generated
@@ -2,7 +2,6 @@
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/extlibs/glm" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/extlibs/googletest" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
145
CMakeLists.txt
145
CMakeLists.txt
@@ -1,44 +1,121 @@
|
||||
cmake_minimum_required(VERSION 3.26)
|
||||
|
||||
project(omath VERSION 1.0.0)
|
||||
project(omath VERSION 3.3.0 LANGUAGES CXX)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 26)
|
||||
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}")
|
||||
|
||||
option(OMATH_BUILD_TESTS "Build unit tests" ON)
|
||||
option(OMATH_BUILD_TESTS "Build unit tests" ${PROJECT_IS_TOP_LEVEL})
|
||||
option(OMATH_THREAT_WARNING_AS_ERROR "Set highest level of warnings and force compiler to treat them as errors" ON)
|
||||
option(OMATH_BUILD_AS_SHARED_LIBRARY "Build Omath as .so or .dll" OFF)
|
||||
option(OMATH_USE_AVX2 "Omath will use AVX2 to boost performance" ON)
|
||||
option(OMATH_IMGUI_INTEGRATION "Omath will define method to convert omath types to imgui types" OFF)
|
||||
option(OMATH_BUILD_EXAMPLES "Build example projects with you can learn & play" OFF)
|
||||
option(OMATH_STATIC_MSVC_RUNTIME_LIBRARY "Force Omath to link static runtime" OFF)
|
||||
option(OMATH_SUPRESS_SAFETY_CHECKS "Supress some safety checks in release build to improve general performance" ON)
|
||||
option(OMATH_USE_UNITY_BUILD "Will enable unity build to speed up compilation" ON)
|
||||
option(OMATH_ENABLE_LEGACY "Will enable legacy classes that MUST be used ONLY for backward compatibility" OFF)
|
||||
|
||||
message(STATUS "[${PROJECT_NAME}]: Building on ${CMAKE_HOST_SYSTEM_NAME}")
|
||||
message(STATUS "[${PROJECT_NAME}]: Warnings as errors ${OMATH_THREAT_WARNING_AS_ERROR}")
|
||||
message(STATUS "[${PROJECT_NAME}]: Build unit tests ${OMATH_BUILD_TESTS}")
|
||||
message(STATUS "[${PROJECT_NAME}]: As dynamic library ${OMATH_BUILD_AS_SHARED_LIBRARY}")
|
||||
message(STATUS "[${PROJECT_NAME}]: Static C++ runtime ${OMATH_STATIC_MSVC_RUNTIME_LIBRARY}")
|
||||
message(STATUS "[${PROJECT_NAME}]: CMake unity build ${OMATH_USE_UNITY_BUILD}")
|
||||
message(STATUS "[${PROJECT_NAME}]: Example projects ${OMATH_BUILD_EXAMPLES}")
|
||||
message(STATUS "[${PROJECT_NAME}]: AVX2 feature status ${OMATH_USE_AVX2}")
|
||||
message(STATUS "[${PROJECT_NAME}]: ImGUI integration feature status ${OMATH_IMGUI_INTEGRATION}")
|
||||
message(STATUS "[${PROJECT_NAME}]: Legacy features support ${OMATH_ENABLE_LEGACY}")
|
||||
|
||||
file(GLOB_RECURSE OMATH_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp")
|
||||
file(GLOB_RECURSE OMATH_HEADERS CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp")
|
||||
|
||||
|
||||
if (OMATH_BUILD_AS_SHARED_LIBRARY)
|
||||
add_library(omath SHARED source/Vector3.cpp)
|
||||
else()
|
||||
add_library(omath STATIC source/Vector3.cpp)
|
||||
endif()
|
||||
add_library(${PROJECT_NAME} SHARED ${OMATH_SOURCES} ${OMATH_HEADERS})
|
||||
else ()
|
||||
add_library(${PROJECT_NAME} STATIC ${OMATH_SOURCES} ${OMATH_HEADERS})
|
||||
endif ()
|
||||
|
||||
target_compile_definitions(omath PUBLIC OMATH_EXPORT)
|
||||
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
target_compile_options(omath PRIVATE /Zc:static_assert-)
|
||||
endif()
|
||||
if (OMATH_IMGUI_INTEGRATION)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC OMATH_IMGUI_INTEGRATION)
|
||||
|
||||
add_subdirectory(source)
|
||||
# IMGUI is being linked as submodule
|
||||
if (TARGET imgui)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC imgui)
|
||||
install(TARGETS imgui
|
||||
EXPORT omathTargets
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
RUNTIME DESTINATION bin)
|
||||
else ()
|
||||
# Assume that IMGUI linked via VCPKG.
|
||||
find_package(imgui CONFIG REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC imgui::imgui)
|
||||
endif ()
|
||||
|
||||
if(OMATH_BUILD_TESTS)
|
||||
endif ()
|
||||
|
||||
if (OMATH_USE_AVX2)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC OMATH_USE_AVX2)
|
||||
endif ()
|
||||
|
||||
if (OMATH_SUPRESS_SAFETY_CHECKS)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC OMATH_SUPRESS_SAFETY_CHECKS)
|
||||
endif ()
|
||||
|
||||
if (OMATH_ENABLE_LEGACY)
|
||||
target_compile_options(${PROJECT_NAME} PUBLIC OMATH_ENABLE_LEGACY)
|
||||
endif ()
|
||||
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
|
||||
CXX_STANDARD 23
|
||||
CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if (OMATH_USE_UNITY_BUILD)
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
UNITY_BUILD ON
|
||||
UNITY_BUILD_BATCH_SIZE 20)
|
||||
endif ()
|
||||
|
||||
if (OMATH_STATIC_MSVC_RUNTIME_LIBRARY)
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
|
||||
)
|
||||
endif ()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE -mavx2 -mfma)
|
||||
endif ()
|
||||
|
||||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_23)
|
||||
|
||||
|
||||
if (OMATH_BUILD_TESTS)
|
||||
add_subdirectory(extlibs)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (OMATH_BUILD_EXAMPLES)
|
||||
add_subdirectory(examples)
|
||||
endif ()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND OMATH_THREAT_WARNING_AS_ERROR)
|
||||
target_compile_options(omath PRIVATE /W4 /WX)
|
||||
elseif(OMATH_THREAT_WARNING_AS_ERROR)
|
||||
target_compile_options(omath PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
||||
endif()
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX)
|
||||
elseif (OMATH_THREAT_WARNING_AS_ERROR)
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
||||
endif ()
|
||||
|
||||
target_include_directories(omath
|
||||
# Windows SDK redefine min/max via preprocessor and break std::min and std::max
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
target_compile_definitions(${PROJECT_NAME} INTERFACE NOMINMAX)
|
||||
endif ()
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> # Use this path when building the project
|
||||
$<INSTALL_INTERFACE:include> # Use this path when the project is installed
|
||||
@@ -48,21 +125,21 @@ target_include_directories(omath
|
||||
# Installation rules
|
||||
|
||||
# Install the library
|
||||
install(TARGETS omath
|
||||
EXPORT omathTargets
|
||||
ARCHIVE DESTINATION lib COMPONENT omath # For static libraries
|
||||
LIBRARY DESTINATION lib COMPONENT omath # For shared libraries
|
||||
RUNTIME DESTINATION bin COMPONENT omath # For executables (on Windows)
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
EXPORT ${PROJECT_NAME}Targets
|
||||
ARCHIVE DESTINATION lib COMPONENT ${PROJECT_NAME} # For static libraries
|
||||
LIBRARY DESTINATION lib COMPONENT ${PROJECT_NAME} # For shared libraries
|
||||
RUNTIME DESTINATION bin COMPONENT ${PROJECT_NAME} # For executables (on Windows)
|
||||
)
|
||||
|
||||
# Install headers as part of omath_component
|
||||
install(DIRECTORY include/ DESTINATION include COMPONENT omath)
|
||||
install(DIRECTORY include/ DESTINATION include COMPONENT ${PROJECT_NAME})
|
||||
|
||||
# Export omath target for CMake find_package support, also under omath_component
|
||||
install(EXPORT omathTargets
|
||||
FILE omathTargets.cmake
|
||||
NAMESPACE omath::
|
||||
DESTINATION lib/cmake/omath COMPONENT omath
|
||||
install(EXPORT ${PROJECT_NAME}Targets
|
||||
FILE ${PROJECT_NAME}Targets.cmake
|
||||
NAMESPACE ${PROJECT_NAME}::
|
||||
DESTINATION lib/cmake/${PROJECT_NAME} COMPONENT ${PROJECT_NAME}
|
||||
)
|
||||
|
||||
|
||||
@@ -77,12 +154,12 @@ write_basic_package_version_file(
|
||||
configure_package_config_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/omathConfig.cmake.in" # Path to the .in file
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/omathConfig.cmake" # Output path for the generated file
|
||||
INSTALL_DESTINATION lib/cmake/omath
|
||||
INSTALL_DESTINATION lib/cmake/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
# Install the generated config files
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/omathConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/omathConfigVersion.cmake"
|
||||
DESTINATION lib/cmake/omath
|
||||
DESTINATION lib/cmake/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
||||
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER": "gcc",
|
||||
"CMAKE_CXX_COMPILER": "g++"
|
||||
"CMAKE_C_COMPILER": "clang",
|
||||
"CMAKE_CXX_COMPILER": "clang++"
|
||||
},
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
@@ -64,6 +64,38 @@
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "darwin-base",
|
||||
"hidden": true,
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
||||
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER": "clang",
|
||||
"CMAKE_CXX_COMPILER": "clang++"
|
||||
},
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Darwin"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "darwin-debug",
|
||||
"displayName": "Darwin Debug",
|
||||
"inherits": "darwin-base",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "darwin-release",
|
||||
"displayName": "Darwin Release",
|
||||
"inherits": "darwin-debug",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
32
CONTRIBUTING.md
Normal file
32
CONTRIBUTING.md
Normal file
@@ -0,0 +1,32 @@
|
||||
## 🤝 Contributing to OMath or other Orange's Projects
|
||||
|
||||
### ❕ Prerequisites
|
||||
|
||||
- A working up-to-date OMath installation
|
||||
- C++ knowledge
|
||||
- Git knowledge
|
||||
- Ability to ask for help (Feel free to create empty pull-request or PM a maintainer
|
||||
in [Telegram](https://t.me/orange_cpp))
|
||||
|
||||
### ⏬ Setting up OMath
|
||||
|
||||
Please read INSTALL.md file in repository
|
||||
|
||||
### 🔀 Pull requests and Branches
|
||||
|
||||
In order to send code back to the official OMath repository, you must first create a copy of OMath on your github
|
||||
account ([fork](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)) and
|
||||
then [create a pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) back to OMath.
|
||||
|
||||
OMath developement is performed on multiple branches. Changes are then pull requested into master. By default, changes
|
||||
merged into master will not roll out to stable build users unless the `stable` tag is updated.
|
||||
|
||||
### 📜 Code-Style
|
||||
|
||||
The orange code-style can be found in `.clang-format`.
|
||||
|
||||
### 📦 Building
|
||||
|
||||
OMath has already created the `cmake-build` and `out` directories where cmake/bin files are located. By default, you
|
||||
can build OMath by running `cmake --build cmake-build/build/windows-release --target omath -j 6` in the source
|
||||
directory.
|
||||
11
CREDITS.md
Normal file
11
CREDITS.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# OMATH CREDITS
|
||||
|
||||
Thanks to everyone who made this possible, including:
|
||||
|
||||
- Saikari aka luadebug for VCPKG port.
|
||||
|
||||
And a big hand to everyone else who has contributed over the past!
|
||||
|
||||
THANKS! <3
|
||||
|
||||
-- Orange++ <orange-cpp@yandex.ru>
|
||||
68
INSTALL.md
Normal file
68
INSTALL.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# 📥Installation Guide
|
||||
|
||||
## <img width="28px" src="https://vcpkg.io/assets/mark/mark.svg" /> Using vcpkg
|
||||
**Note**: Support vcpkg for package management
|
||||
1. Install [vcpkg](https://github.com/microsoft/vcpkg)
|
||||
2. Run the following command to install the orange-math package:
|
||||
```
|
||||
vcpkg install orange-math
|
||||
```
|
||||
CMakeLists.txt
|
||||
```cmake
|
||||
find_package(omath CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE omath::omath)
|
||||
```
|
||||
For detailed commands on installing different versions and more information, please refer to Microsoft's [official instructions](https://learn.microsoft.com/en-us/vcpkg/get_started/overview).
|
||||
|
||||
## <img width="28px" src="https://xmake.io/assets/img/logo.svg" /> Using xrepo
|
||||
**Note**: Support xrepo for package management
|
||||
1. Install [xmake](https://xmake.io/)
|
||||
2. Run the following command to install the omath package:
|
||||
```
|
||||
xrepo install omath
|
||||
```
|
||||
xmake.lua
|
||||
```xmake
|
||||
add_requires("omath")
|
||||
target("...")
|
||||
add_packages("omath")
|
||||
```
|
||||
|
||||
## <img width="28px" src="https://upload.wikimedia.org/wikipedia/commons/e/ef/CMake_logo.svg?" /> Build from source using CMake
|
||||
1. **Preparation**
|
||||
|
||||
Install needed tools: cmake, clang, git, msvc (windows only).
|
||||
|
||||
1. **Linux:**
|
||||
```bash
|
||||
sudo pacman -Sy cmake ninja clang git
|
||||
```
|
||||
2. **MacOS:**
|
||||
```bash
|
||||
brew install llvm git cmake ninja
|
||||
```
|
||||
3. **Windows:**
|
||||
|
||||
Install Visual Studio from [here](https://visualstudio.microsoft.com/downloads/) and Git from [here](https://git-scm.com/downloads).
|
||||
|
||||
Use x64 Native Tools shell to execute needed commands down below.
|
||||
2. **Clone the repository:**
|
||||
```bash
|
||||
git clone https://github.com/orange-cpp/omath.git
|
||||
```
|
||||
3. **Navigate to the project directory:**
|
||||
```bash
|
||||
cd omath
|
||||
```
|
||||
4. **Build the project using CMake:**
|
||||
```bash
|
||||
cmake --preset windows-release -S .
|
||||
cmake --build cmake-build/build/windows-release --target omath -j 6
|
||||
```
|
||||
Use **\<platform\>-\<build configuration\>** preset to build siutable version for yourself. Like **windows-release** or **linux-release**.
|
||||
|
||||
| Platform Name | Build Config |
|
||||
|---------------|---------------|
|
||||
| windows | release/debug |
|
||||
| linux | release/debug |
|
||||
| darwin | release/debug |
|
||||
20
LICENSE
20
LICENSE
@@ -1,9 +1,17 @@
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2024-2025 Orange++ <orange-cpp@yandex.ru>
|
||||
|
||||
Copyright (c) 2024 Orange++
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
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:
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
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.
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
106
README.md
106
README.md
@@ -1,72 +1,102 @@
|
||||
<div align = center>
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||

|
||||
[](https://www.codefactor.io/repository/github/orange-cpp/omath)
|
||||

|
||||
[](https://repology.org/project/orange-math/versions)
|
||||

|
||||
[](https://discord.gg/eDgdaWbqwZ)
|
||||
[](https://t.me/orangennotes)
|
||||
|
||||
</div>
|
||||
|
||||
Oranges's Math Library (omath) is a comprehensive, open-source library aimed at providing efficient, reliable, and versatile mathematical functions and algorithms. Developed primarily in C++, this library is designed to cater to a wide range of mathematical operations essential in scientific computing, engineering, and academic research.
|
||||
|
||||
## Features
|
||||
- **Efficiency**: Optimized for performance, ensuring quick computations.
|
||||
<div align = center>
|
||||
<a href="https://www.star-history.com/#orange-cpp/omath&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=orange-cpp/omath&type=Date&theme=dark" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=orange-cpp/omath&type=Date" />
|
||||
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=orange-cpp/omath&type=Date" />
|
||||
</picture>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
## 👁🗨 Features
|
||||
- **Efficiency**: Optimized for performance, ensuring quick computations using AVX2.
|
||||
- **Versatility**: Includes a wide array of mathematical functions and algorithms.
|
||||
- **Ease of Use**: Simplified interface for convenient integration into various projects.
|
||||
- **Projectile Prediction**: Projectile prediction engine with O(N) algo complexity, that can power you projectile aim-bot.
|
||||
- **3D Projection**: No need to find view-projection matrix anymore you can make your own projection pipeline.
|
||||
- **Collision Detection**: Production ready code to handle collision detection by using simple interfaces.
|
||||
- **No Additional Dependencies**: No additional dependencies need to use OMath except unit test execution
|
||||
- **Ready for meta-programming**: Omath use templates for common types like Vectors, Matrixes etc, to handle all types!
|
||||
|
||||
## Getting Started
|
||||
### Prerequisites
|
||||
- C++ Compiler
|
||||
- CMake (for building the project)
|
||||
## Supported Render Pipelines
|
||||
| ENGINE | SUPPORT |
|
||||
|----------|---------|
|
||||
| Source | ✅YES |
|
||||
| Unity | ✅YES |
|
||||
| IWEngine | ✅YES |
|
||||
| OpenGL | ✅YES |
|
||||
| Unreal | ✅YES |
|
||||
|
||||
### Installation
|
||||
1. Clone the repository:
|
||||
```
|
||||
git clone https://github.com/orange-cpp/omath.git
|
||||
```
|
||||
2. Navigate to the project directory:
|
||||
```
|
||||
cd omath
|
||||
```
|
||||
3. Build the project using CMake:
|
||||
```
|
||||
cmake --preset windows-release -S .
|
||||
cmake --build cmake-build/build/windows-release --target server -j 6
|
||||
```
|
||||
Use **\<platform\>-\<build configuration\>** preset to build siutable version for yourself. Like **windows-release** or **linux-release**.
|
||||
## Usage
|
||||
Simple world to screen function
|
||||
## Supported Operating Systems
|
||||
|
||||
| OS | SUPPORT |
|
||||
|----------------|---------|
|
||||
| Windows 10/11 | ✅YES |
|
||||
| Linux | ✅YES |
|
||||
| Darwin (MacOS) | ✅YES |
|
||||
|
||||
## ⏬ Installation
|
||||
Please read our [installation guide](https://github.com/orange-cpp/omath/blob/main/INSTALL.md). If this link doesn't work check out INSTALL.md file.
|
||||
|
||||
## ❔ Usage
|
||||
ESP example
|
||||
```c++
|
||||
TEST(UnitTestProjection, IsPointOnScreen)
|
||||
{
|
||||
const omath::projection::Camera camera({0.f, 0.f, 0.f}, {0, 0.f, 0.f} , {1920.f, 1080.f}, 110.f, 0.1f, 500.f);
|
||||
omath::source_engine::Camera cam{localPlayer.GetCameraOrigin(),
|
||||
localPlayer.GetAimPunch(),
|
||||
{1920.f, 1080.f},
|
||||
localPlayer.GetFieldOfView(),
|
||||
0.01.f, 30000.f};
|
||||
|
||||
const auto proj = camera.WorldToScreen({100, 0, 15});
|
||||
EXPECT_TRUE(proj.has_value());
|
||||
for (auto ent: apex_sdk::EntityList::GetAllEntities())
|
||||
{
|
||||
const auto bottom = cam.world_to_screen(ent.GetOrigin());
|
||||
const auto top = cam.world_to_screen(ent.GetBonePosition(8) + omath::Vector3<float>{0, 0, 10});
|
||||
|
||||
const auto ent_health = ent.GetHealth();
|
||||
|
||||
if (!top || !bottom || ent_health <= 0)
|
||||
continue;
|
||||
// esp rendering...
|
||||
}
|
||||
```
|
||||
|
||||
## Showcase
|
||||
<details>
|
||||
<summary>OMATH for making cheats</summary>
|
||||
<summary>OMATH for making cheats (click to open)</summary>
|
||||
|
||||
With `omath/projection` module you can achieve simple ESP hack for powered by Source/Unreal/Unity engine games, like [Apex Legends](https://store.steampowered.com/app/1172470/Apex_Legends/).
|
||||
|
||||

|
||||

|
||||
|
||||
Or for InfinityWard Engine based games. Like Call of Duty Black Ops 2!
|
||||

|
||||
Or create simple trigger bot with embeded traceline from omath::collision::LineTrace
|
||||

|
||||
Or even advanced projectile aimbot
|
||||
[Watch Video](https://youtu.be/lM_NJ1yCunw?si=5E87OrQMeypxSJ3E)
|
||||
</details>
|
||||
|
||||
## Contributing
|
||||
## 🫵🏻 Contributing
|
||||
Contributions to `omath` are welcome! Please read `CONTRIBUTING.md` for details on our code of conduct and the process for submitting pull requests.
|
||||
|
||||
## License
|
||||
This project is licensed under the MIT - see the `LICENSE` file for details.
|
||||
## 📜 License
|
||||
This project is licensed under the ZLIB - see the `LICENSE` file for details.
|
||||
|
||||
## Acknowledgments
|
||||
- Orange | [Telegram](https://t.me/orange_cpp)
|
||||
## 💘 Acknowledgments
|
||||
- [All contributors](https://github.com/orange-cpp/omath/graphs/contributors)
|
||||
|
||||
@@ -2,5 +2,10 @@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
if (@OMATH_IMGUI_INTEGRATION@)
|
||||
find_dependency(imgui CONFIG)
|
||||
endif()
|
||||
|
||||
# Load the targets for the omath library
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/omathTargets.cmake")
|
||||
check_required_components(omath)
|
||||
|
||||
4
examples/CMakeLists.txt
Normal file
4
examples/CMakeLists.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
project(examples)
|
||||
|
||||
add_executable(ExampleProjectionMatrixBuilder example_proj_mat_builder.cpp)
|
||||
target_link_libraries(ExampleProjectionMatrixBuilder PRIVATE omath::omath)
|
||||
40
examples/example_proj_mat_builder.cpp
Normal file
40
examples/example_proj_mat_builder.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// Created by Vlad on 3/19/2025.
|
||||
//
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <print>
|
||||
#include <omath/engines/opengl_engine/formulas.hpp>
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
std::println("OMATH Projection Matrix Builder");
|
||||
|
||||
float fov = 0;
|
||||
float near = 0;
|
||||
float far = 0;
|
||||
float view_port_width = 0;
|
||||
float view_port_height = 0;
|
||||
|
||||
std::print("Enter camera fov: ");
|
||||
std::cin >> fov;
|
||||
|
||||
std::print("Enter camera z near: ");
|
||||
std::cin >> near;
|
||||
|
||||
std::print("Enter camera z far: ");
|
||||
std::cin >> far;
|
||||
|
||||
std::print("Enter camera screen width: ");
|
||||
std::cin >> view_port_width;
|
||||
|
||||
std::print("Enter camera screen height: ");
|
||||
std::cin >> view_port_height;
|
||||
|
||||
const auto mat =
|
||||
omath::opengl_engine::calc_perspective_projection_matrix(fov, view_port_width / view_port_height, near, far);
|
||||
|
||||
std::print("{}", mat.to_string());
|
||||
};
|
||||
Submodule extlibs/googletest updated: d83fee138a...52eb8108c5
17
include/omath/3d_primitives/box.hpp
Normal file
17
include/omath/3d_primitives/box.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Created by Vlad on 4/18/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include <array>
|
||||
#include "omath/triangle.hpp"
|
||||
#include "omath/vector3.hpp"
|
||||
|
||||
|
||||
namespace omath::primitives
|
||||
{
|
||||
[[nodiscard]]
|
||||
std::array<Triangle<Vector3<float>>, 12> create_box(const Vector3<float>& top, const Vector3<float>& bottom,
|
||||
const Vector3<float>& dir_forward, const Vector3<float>& dir_right,
|
||||
float ratio = 4.f) noexcept;
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
//
|
||||
// Created by vlad on 11/6/23.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include <numbers>
|
||||
#include <cmath>
|
||||
|
||||
namespace omath::angles
|
||||
{
|
||||
template<class Type>
|
||||
requires std::is_floating_point_v<Type>
|
||||
[[nodiscard]] constexpr Type RadiansToDegrees(const Type& radians)
|
||||
{
|
||||
return radians * (Type(180) / std::numbers::pi_v<Type>);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
requires std::is_floating_point_v<Type>
|
||||
[[nodiscard]] constexpr Type DegreesToRadians(const Type& degrees)
|
||||
{
|
||||
return degrees * (std::numbers::pi_v<Type> / Type(180));
|
||||
}
|
||||
|
||||
template<class type>
|
||||
requires std::is_floating_point_v<type>
|
||||
[[nodiscard]] type HorizontalFovToVertical(const type& horFov, const type& aspect)
|
||||
{
|
||||
const auto fovRad = DegreesToRadians(horFov);
|
||||
|
||||
const auto vertFov = type(2) * std::atan(std::tan(fovRad / type(2)) / aspect);
|
||||
|
||||
return RadiansToDegrees(vertFov);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
requires std::is_floating_point_v<Type>
|
||||
[[nodiscard]] Type VerticalFovToHorizontal(const Type& vertFov, const Type& aspect)
|
||||
{
|
||||
const auto fovRad = DegreesToRadians(vertFov);
|
||||
|
||||
const auto horFov = Type(2) * std::atan(std::tan(fovRad / Type(2)) * aspect);
|
||||
|
||||
return RadiansToDegrees(horFov);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
requires std::is_arithmetic_v<Type>
|
||||
[[nodiscard]] Type WrapAngle(const Type& angle, const Type& min, const Type& max)
|
||||
{
|
||||
if (angle <= max && angle >= min)
|
||||
return angle;
|
||||
|
||||
const Type range = max - min;
|
||||
|
||||
Type wrappedAngle = std::fmod(angle - min, range);
|
||||
|
||||
if (wrappedAngle < 0)
|
||||
wrappedAngle += range;
|
||||
|
||||
return wrappedAngle + min;
|
||||
}
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
//
|
||||
// Created by vlad on 2/4/24.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "omath/Vector3.hpp"
|
||||
#include <cstdint>
|
||||
#include "omath/Vector4.hpp"
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath
|
||||
{
|
||||
struct OMATH_API HSV
|
||||
{
|
||||
float m_hue{};
|
||||
float m_saturation{};
|
||||
float m_value{};
|
||||
};
|
||||
|
||||
|
||||
class OMATH_API Color final : public Vector4
|
||||
{
|
||||
public:
|
||||
constexpr Color(float r, float g, float b, float a) : Vector4(r,g,b,a)
|
||||
{
|
||||
Clamp(0.f, 1.f);
|
||||
}
|
||||
|
||||
constexpr explicit Color() : Vector4()
|
||||
{
|
||||
|
||||
}
|
||||
[[nodiscard]]
|
||||
constexpr static Color FromRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
|
||||
{
|
||||
return Color{Vector4(r, g, b, a) / 255.f};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr static Color FromHSV(float hue, float saturation, float value)
|
||||
{
|
||||
float r{}, g{}, b{};
|
||||
|
||||
hue = std::clamp(hue, 0.f, 1.f);
|
||||
|
||||
const int i = static_cast<int>(hue * 6.f);
|
||||
const float f = hue * 6 - i;
|
||||
const float p = value * (1 - saturation);
|
||||
const float q = value * (1 - f * saturation);
|
||||
const float t = value * (1 - (1 - f) * saturation);
|
||||
|
||||
switch (i % 6)
|
||||
{
|
||||
case 0: r = value, g = t, b = p; break;
|
||||
case 1: r = q, g = value, b = p; break;
|
||||
case 2: r = p, g = value, b = t; break;
|
||||
case 3: r = p, g = q, b = value; break;
|
||||
case 4: r = t, g = p, b = value; break;
|
||||
case 5: r = value, g = p, b = q; break;
|
||||
|
||||
default: return {0.f, 0.f, 0.f, 0.f};
|
||||
}
|
||||
|
||||
return {r, g, b, 1.f};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr HSV ToHSV() const
|
||||
{
|
||||
HSV hsvData;
|
||||
|
||||
const float& red = x;
|
||||
const float& green = y;
|
||||
const float& blue = z;
|
||||
|
||||
const float max = std::max({red, green, blue});
|
||||
const float min = std::min({red, green, blue});
|
||||
const float delta = max - min;
|
||||
|
||||
|
||||
if (delta == 0.f)
|
||||
hsvData.m_hue = 0.f;
|
||||
|
||||
else if (max == red)
|
||||
hsvData.m_hue = 60.f * (std::fmodf(((green - blue) / delta), 6.f));
|
||||
else if (max == green)
|
||||
hsvData.m_hue = 60.f * (((blue - red) / delta) + 2.f);
|
||||
else if (max == blue)
|
||||
hsvData.m_hue = 60.f * (((red - green) / delta) + 4.f);
|
||||
|
||||
if (hsvData.m_hue < 0.f)
|
||||
hsvData.m_hue += 360.f;
|
||||
|
||||
hsvData.m_hue /= 360.f;
|
||||
hsvData.m_saturation = max == 0.f ? 0.f : delta / max;
|
||||
hsvData.m_value = max;
|
||||
|
||||
return hsvData;
|
||||
}
|
||||
|
||||
constexpr explicit Color(const Vector4& vec) : Vector4(vec)
|
||||
{
|
||||
Clamp(0.f, 1.f);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Color Blend(const Color& other, float ratio) const
|
||||
{
|
||||
return Color( (*this * (1.f - ratio)) + (other * ratio) );
|
||||
}
|
||||
|
||||
[[nodiscard]] static constexpr Color Red() {return {1.f, 0.f, 0.f, 1.f};}
|
||||
[[nodiscard]] static constexpr Color Green() {return {0.f, 1.f, 0.f, 1.f};}
|
||||
[[nodiscard]] static constexpr Color Blue() {return {0.f, 0.f, 1.f, 1.f};}
|
||||
};
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Color Blend(const Color& first, const Color& second, float ratio)
|
||||
{
|
||||
return Color{first * (1.f - std::clamp(ratio, 0.f, 1.f)) + second * ratio};
|
||||
}
|
||||
}
|
||||
@@ -1,410 +0,0 @@
|
||||
//
|
||||
// Created by vlad on 9/29/2024.
|
||||
//
|
||||
#pragma once
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
#include "Vector3.hpp"
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath
|
||||
{
|
||||
struct OMATH_API MatSize
|
||||
{
|
||||
size_t rows, columns;
|
||||
};
|
||||
|
||||
enum class MatStoreType : uint8_t
|
||||
{
|
||||
ROW_MAJOR = 0,
|
||||
COLUMN_MAJOR
|
||||
};
|
||||
|
||||
template<size_t Rows = 0, size_t Columns = 0, class Type = float, MatStoreType StoreType = MatStoreType::ROW_MAJOR>
|
||||
requires std::is_arithmetic_v<Type>
|
||||
class Mat final
|
||||
{
|
||||
public:
|
||||
OMATH_API constexpr Mat()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
OMATH_API constexpr static MatStoreType GetStoreOrdering()
|
||||
{
|
||||
return StoreType;
|
||||
}
|
||||
OMATH_API constexpr Mat(const std::initializer_list<std::initializer_list<Type>>& rows)
|
||||
{
|
||||
if (rows.size() != Rows)
|
||||
throw std::invalid_argument("Initializer list rows size does not match template parameter Rows");
|
||||
|
||||
auto rowIt = rows.begin();
|
||||
for (size_t i = 0; i < Rows; ++i, ++rowIt)
|
||||
{
|
||||
if (rowIt->size() != Columns)
|
||||
throw std::invalid_argument(
|
||||
"All rows must have the same number of columns as template parameter Columns");
|
||||
|
||||
auto colIt = rowIt->begin();
|
||||
for (size_t j = 0; j < Columns; ++j, ++colIt)
|
||||
{
|
||||
At(i, j) = std::move(*colIt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OMATH_API constexpr explicit Mat(const Type* rawData)
|
||||
{
|
||||
std::copy_n(rawData, Rows * Columns, m_data.begin());
|
||||
}
|
||||
|
||||
OMATH_API constexpr Mat(const Mat& other) noexcept
|
||||
{
|
||||
m_data = other.m_data;
|
||||
}
|
||||
|
||||
OMATH_API constexpr Mat(Mat&& other) noexcept
|
||||
{
|
||||
m_data = std::move(other.m_data);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API static constexpr size_t RowCount() noexcept
|
||||
{
|
||||
return Rows;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API static constexpr size_t ColumnsCount() noexcept
|
||||
{
|
||||
return Columns;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API static consteval MatSize Size() noexcept
|
||||
{
|
||||
return {Rows, Columns};
|
||||
}
|
||||
|
||||
[[nodiscard]] OMATH_API constexpr const Type& At(const size_t rowIndex, const size_t columnIndex) const
|
||||
{
|
||||
if (rowIndex >= Rows || columnIndex >= Columns)
|
||||
throw std::out_of_range("Index out of range");
|
||||
|
||||
if constexpr (StoreType == MatStoreType::ROW_MAJOR)
|
||||
return m_data[rowIndex * Columns + columnIndex];
|
||||
|
||||
else if constexpr (StoreType == MatStoreType::COLUMN_MAJOR)
|
||||
return m_data[rowIndex + columnIndex * Rows];
|
||||
|
||||
else
|
||||
{
|
||||
static_assert(false, "Invalid matrix access convention");
|
||||
std::unreachable();
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] OMATH_API constexpr Type& At(const size_t rowIndex, const size_t columnIndex)
|
||||
{
|
||||
return const_cast<Type&>(std::as_const(*this).At(rowIndex, columnIndex));
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API constexpr Type Sum() const noexcept
|
||||
{
|
||||
Type sum = 0;
|
||||
for (size_t i = 0; i < Rows; ++i)
|
||||
for (size_t j = 0; j < Columns; ++j)
|
||||
sum += At(i, j);
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
OMATH_API constexpr void Clear() noexcept
|
||||
{
|
||||
Set(0);
|
||||
}
|
||||
|
||||
OMATH_API constexpr void Set(const Type& value) noexcept
|
||||
{
|
||||
std::ranges::fill(m_data, value);
|
||||
}
|
||||
|
||||
// Operator overloading for multiplication with another Mat
|
||||
template<size_t OtherColumns>
|
||||
constexpr Mat<Rows, OtherColumns, Type, StoreType>
|
||||
OMATH_API operator*(const Mat<Columns, OtherColumns, Type, StoreType>& other) const
|
||||
{
|
||||
Mat<Rows, OtherColumns, Type, StoreType> result;
|
||||
|
||||
for (size_t i = 0; i < Rows; ++i)
|
||||
for (size_t j = 0; j < OtherColumns; ++j)
|
||||
{
|
||||
Type sum = 0;
|
||||
for (size_t k = 0; k < Columns; ++k)
|
||||
sum += At(i, k) * other.At(k, j);
|
||||
result.At(i, j) = sum;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
OMATH_API constexpr Mat& operator*=(const Type& f) noexcept
|
||||
{
|
||||
for (size_t i = 0; i < Rows; ++i)
|
||||
for (size_t j = 0; j < Columns; ++j)
|
||||
At(i, j) *= f;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<size_t OtherColumns>
|
||||
constexpr Mat<Rows, OtherColumns, Type, StoreType>
|
||||
OMATH_API operator*=(const Mat<Columns, OtherColumns, Type, StoreType>& other)
|
||||
{
|
||||
return *this = *this * other;
|
||||
}
|
||||
|
||||
OMATH_API constexpr Mat operator*(const Type& f) const noexcept
|
||||
{
|
||||
Mat result(*this);
|
||||
result *= f;
|
||||
return result;
|
||||
}
|
||||
|
||||
OMATH_API constexpr Mat& operator/=(const Type& f) noexcept
|
||||
{
|
||||
for (size_t i = 0; i < Rows; ++i)
|
||||
for (size_t j = 0; j < Columns; ++j)
|
||||
At(i, j) /= f;
|
||||
return *this;
|
||||
}
|
||||
|
||||
OMATH_API constexpr Mat operator/(const Type& f) const noexcept
|
||||
{
|
||||
Mat result(*this);
|
||||
result /= f;
|
||||
return result;
|
||||
}
|
||||
|
||||
OMATH_API constexpr Mat& operator=(const Mat& other) noexcept
|
||||
{
|
||||
if (this == &other)
|
||||
return *this;
|
||||
for (size_t i = 0; i < Rows; ++i)
|
||||
for (size_t j = 0; j < Columns; ++j)
|
||||
At(i, j) = other.At(i, j);
|
||||
return *this;
|
||||
}
|
||||
|
||||
OMATH_API constexpr Mat& operator=(Mat&& other) noexcept
|
||||
{
|
||||
if (this == &other)
|
||||
return *this;
|
||||
|
||||
for (size_t i = 0; i < Rows; ++i)
|
||||
for (size_t j = 0; j < Columns; ++j)
|
||||
At(i, j) = other.At(i, j);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API constexpr Mat<Columns, Rows, Type, StoreType> Transposed() const noexcept
|
||||
{
|
||||
Mat<Columns, Rows, Type, StoreType> transposed;
|
||||
for (size_t i = 0; i < Rows; ++i)
|
||||
for (size_t j = 0; j < Columns; ++j)
|
||||
transposed.At(j, i) = At(i, j);
|
||||
|
||||
return transposed;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API constexpr Type Determinant() const
|
||||
{
|
||||
static_assert(Rows == Columns, "Determinant is only defined for square matrices.");
|
||||
|
||||
if constexpr (Rows == 1)
|
||||
return At(0, 0);
|
||||
|
||||
else if constexpr (Rows == 2)
|
||||
return At(0, 0) * At(1, 1) - At(0, 1) * At(1, 0);
|
||||
else
|
||||
{
|
||||
Type det = 0;
|
||||
for (size_t i = 0; i < Columns; ++i)
|
||||
{
|
||||
const Type cofactor = (i % 2 == 0 ? 1 : -1) * At(0, i) * Minor(0, i).Determinant();
|
||||
det += cofactor;
|
||||
}
|
||||
return det;
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API constexpr Mat<Rows - 1, Columns - 1, Type, StoreType> Minor(const size_t row, const size_t column) const
|
||||
{
|
||||
Mat<Rows - 1, Columns - 1, Type, StoreType> result;
|
||||
for (size_t i = 0, m = 0; i < Rows; ++i)
|
||||
{
|
||||
if (i == row)
|
||||
continue;
|
||||
for (size_t j = 0, n = 0; j < Columns; ++j)
|
||||
{
|
||||
if (j == column)
|
||||
continue;
|
||||
result.At(m, n) = At(i, j);
|
||||
++n;
|
||||
}
|
||||
++m;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API constexpr const std::array<Type, Rows * Columns>& RawArray() const
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API constexpr std::array<Type, Rows * Columns>& RawArray()
|
||||
{
|
||||
return const_cast<std::array<Type, Rows * Columns>>(std::as_const(*this).RawArray());
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API std::string ToString() const noexcept
|
||||
{
|
||||
std::ostringstream oss;
|
||||
for (size_t i = 0; i < Rows; ++i)
|
||||
{
|
||||
for (size_t j = 0; j < Columns; ++j)
|
||||
{
|
||||
oss << At(i, j);
|
||||
if (j != Columns - 1)
|
||||
oss << ' ';
|
||||
}
|
||||
oss << '\n';
|
||||
}
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API bool operator==(const Mat& mat) const
|
||||
{
|
||||
return m_data == mat.m_data;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API bool operator!=(const Mat& mat) const
|
||||
{
|
||||
return !operator==(mat);
|
||||
}
|
||||
|
||||
// Static methods that return fixed-size matrices
|
||||
[[nodiscard]]
|
||||
OMATH_API constexpr static Mat<4, 4> ToScreenMat(const Type& screenWidth, const Type& screenHeight) noexcept
|
||||
{
|
||||
return {
|
||||
{screenWidth / 2, 0, 0, 0},
|
||||
{0, -screenHeight / 2, 0, 0},
|
||||
{0, 0, 1, 0},
|
||||
{screenWidth / 2, screenHeight / 2, 0, 1},
|
||||
};
|
||||
}
|
||||
|
||||
private:
|
||||
std::array<Type, Rows * Columns> m_data;
|
||||
};
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR>
|
||||
[[nodiscard]]
|
||||
constexpr static Mat<1, 4, Type, St> MatRowFromVector(const Vector3& vector) noexcept
|
||||
{
|
||||
return {{vector.x, vector.y, vector.z, 1}};
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR>
|
||||
[[nodiscard]]
|
||||
constexpr static Mat<4, 1, Type, St> MatColumnFromVector(const Vector3& vector) noexcept
|
||||
{
|
||||
return {{vector.x}, {vector.y}, {vector.z}, {1}};
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR>
|
||||
[[nodiscard]]
|
||||
OMATH_API constexpr Mat<4, 4, Type, St> MatTranslation(const Vector3& diff) noexcept
|
||||
{
|
||||
return
|
||||
{
|
||||
{1, 0, 0, diff.x},
|
||||
{0, 1, 0, diff.y},
|
||||
{0, 0, 1, diff.z},
|
||||
{0, 0, 0, 1},
|
||||
};
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR, class Angle>
|
||||
[[nodiscard]]
|
||||
OMATH_API Mat<4, 4, Type, St> MatRotationAxisX(const Angle& angle) noexcept
|
||||
{
|
||||
return
|
||||
{
|
||||
{1, 0, 0, 0},
|
||||
{0, angle.Cos(), -angle.Sin(), 0},
|
||||
{0, angle.Sin(), angle.Cos(), 0},
|
||||
{0, 0, 0, 1}
|
||||
};
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR, class Angle>
|
||||
[[nodiscard]]
|
||||
OMATH_API Mat<4, 4, Type, St> MatRotationAxisY(const Angle& angle) noexcept
|
||||
{
|
||||
return
|
||||
{
|
||||
{angle.Cos(), 0, angle.Sin(), 0},
|
||||
{0 , 1, 0, 0},
|
||||
{-angle.Sin(), 0, angle.Cos(), 0},
|
||||
{0 , 0, 0, 1}
|
||||
};
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR, class Angle>
|
||||
[[nodiscard]]
|
||||
OMATH_API Mat<4, 4, Type, St> MatRotationAxisZ(const Angle& angle) noexcept
|
||||
{
|
||||
return
|
||||
{
|
||||
{angle.Cos(), -angle.Sin(), 0, 0},
|
||||
{angle.Sin(), angle.Cos(), 0, 0},
|
||||
{ 0, 0, 1, 0},
|
||||
{ 0, 0, 0, 1},
|
||||
};
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR>
|
||||
[[nodiscard]]
|
||||
static Mat<4, 4, Type, St> MatCameraView(const Vector3& forward, const Vector3& right, const Vector3& up,
|
||||
const Vector3& cameraOrigin) noexcept
|
||||
{
|
||||
return Mat<4, 4, Type, St>
|
||||
{
|
||||
{right.x, right.y, right.z, 0},
|
||||
{up.x, up.y, up.z, 0},
|
||||
{forward.x, forward.y, forward.z, 0},
|
||||
{0, 0, 0, 1},
|
||||
|
||||
} * MatTranslation<Type, St>(-cameraOrigin);
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR, class ViewAngles>
|
||||
[[nodiscard]]
|
||||
OMATH_API Mat<4, 4, Type, St> MatRotation(const ViewAngles& angles) noexcept
|
||||
{
|
||||
return MatRotationAxisZ(angles.yaw) * MatRotationAxisY(angles.pitch) * MatRotationAxisX(angles.roll);
|
||||
}
|
||||
} // namespace omath
|
||||
@@ -1,105 +0,0 @@
|
||||
#pragma once
|
||||
#include <initializer_list>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath
|
||||
{
|
||||
class Vector3;
|
||||
|
||||
class Matrix final
|
||||
{
|
||||
public:
|
||||
OMATH_API Matrix();
|
||||
OMATH_API Matrix(size_t rows, size_t columns);
|
||||
|
||||
OMATH_API Matrix(const std::initializer_list<std::initializer_list<float>>& rows);
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API static Matrix ToScreenMatrix(float screenWidth, float screenHeight);
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API static Matrix TranslationMatrix(const Vector3& diff);
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API static Matrix OrientationMatrix(const Vector3& forward, const Vector3& right, const Vector3& up);
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API static Matrix ProjectionMatrix(float fieldOfView, float aspectRatio, float near, float far);
|
||||
|
||||
OMATH_API Matrix(const Matrix& other);
|
||||
|
||||
OMATH_API Matrix(size_t rows, size_t columns, const float* pRaw);
|
||||
|
||||
OMATH_API Matrix(Matrix&& other) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API size_t RowCount() const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API size_t ColumnsCount() const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API std::pair<size_t, size_t> Size() const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API float& At(size_t iRow, size_t iCol);
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API float Sum();
|
||||
|
||||
OMATH_API void SetDataFromRaw(const float* pRawMatrix);
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API Matrix Transpose() const;
|
||||
|
||||
OMATH_API void Set(float val);
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API const float& At(size_t iRow, size_t iCol) const;
|
||||
|
||||
OMATH_API Matrix operator*(const Matrix& other) const;
|
||||
|
||||
OMATH_API Matrix& operator*=(const Matrix& other);
|
||||
|
||||
OMATH_API Matrix operator*(float f) const;
|
||||
|
||||
OMATH_API Matrix& operator*=(float f);
|
||||
|
||||
OMATH_API Matrix& operator/=(float f);
|
||||
|
||||
OMATH_API void Clear();
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API Matrix Strip(size_t row, size_t column) const;
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API float Minor(size_t i, size_t j) const;
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API float AlgComplement(size_t i, size_t j) const;
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API float Determinant() const;
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API const float* Raw() const;
|
||||
|
||||
OMATH_API Matrix& operator=(const Matrix& other);
|
||||
|
||||
OMATH_API Matrix& operator=(Matrix&& other) noexcept;
|
||||
|
||||
OMATH_API Matrix operator/(float f) const;
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API std::string ToString() const;
|
||||
|
||||
OMATH_API ~Matrix();
|
||||
|
||||
private:
|
||||
size_t m_rows;
|
||||
size_t m_columns;
|
||||
std::unique_ptr<float[]> m_data;
|
||||
};
|
||||
} // namespace omath
|
||||
@@ -1,34 +0,0 @@
|
||||
//
|
||||
// Created by Orange on 11/13/2024.
|
||||
//
|
||||
#pragma once
|
||||
#include "omath/Vector3.hpp"
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath
|
||||
{
|
||||
class OMATH_API Triangle3d final
|
||||
{
|
||||
public:
|
||||
Triangle3d(const Vector3& vertex1, const Vector3& vertex2, const Vector3& vertex3);
|
||||
|
||||
Vector3 m_vertex1;
|
||||
Vector3 m_vertex2;
|
||||
Vector3 m_vertex3;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3 CalculateNormal() const;
|
||||
|
||||
[[nodiscard]]
|
||||
float SideALength() const;
|
||||
|
||||
[[nodiscard]]
|
||||
float SideBLength() const;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3 SideAVector() const;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3 SideBVector() const;
|
||||
};
|
||||
}
|
||||
@@ -1,202 +0,0 @@
|
||||
//
|
||||
// Created by Vlad on 02.09.2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include <tuple>
|
||||
#include <cmath>
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath
|
||||
{
|
||||
class OMATH_API Vector2
|
||||
{
|
||||
public:
|
||||
float x = 0.f;
|
||||
float y = 0.f;
|
||||
|
||||
// Constructors
|
||||
constexpr Vector2() = default;
|
||||
|
||||
constexpr Vector2(const float x, const float y) : x(x), y(y) {}
|
||||
|
||||
// Equality operators
|
||||
[[nodiscard]]
|
||||
constexpr bool operator==(const Vector2& src) const
|
||||
{
|
||||
return x == src.x && y == src.y;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr bool operator!=(const Vector2& src) const
|
||||
{
|
||||
return !(*this == src);
|
||||
}
|
||||
|
||||
// Compound assignment operators
|
||||
constexpr Vector2& operator+=(const Vector2& v)
|
||||
{
|
||||
x += v.x;
|
||||
y += v.y;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector2& operator-=(const Vector2& v)
|
||||
{
|
||||
x -= v.x;
|
||||
y -= v.y;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector2& operator*=(const Vector2& v)
|
||||
{
|
||||
x *= v.x;
|
||||
y *= v.y;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector2& operator/=(const Vector2& v)
|
||||
{
|
||||
x /= v.x;
|
||||
y /= v.y;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector2& operator*=(const float fl)
|
||||
{
|
||||
x *= fl;
|
||||
y *= fl;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector2& operator/=(const float fl)
|
||||
{
|
||||
x /= fl;
|
||||
y /= fl;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector2& operator+=(const float fl)
|
||||
{
|
||||
x += fl;
|
||||
y += fl;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector2& operator-=(const float fl)
|
||||
{
|
||||
x -= fl;
|
||||
y -= fl;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Basic vector operations
|
||||
[[nodiscard]] float DistTo(const Vector2& vOther) const
|
||||
{
|
||||
return std::sqrt(DistToSqr(vOther));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr float DistToSqr(const Vector2& vOther) const
|
||||
{
|
||||
return (x - vOther.x) * (x - vOther.x) + (y - vOther.y) * (y - vOther.y);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr float Dot(const Vector2& vOther) const
|
||||
{
|
||||
return x * vOther.x + y * vOther.y;
|
||||
}
|
||||
|
||||
#ifndef _MSC_VER
|
||||
[[nodiscard]] constexpr float Length() const
|
||||
{
|
||||
return std::hypot(x, y);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector2 Normalized() const
|
||||
{
|
||||
const float len = Length();
|
||||
return len > 0.f ? *this / len : *this;
|
||||
}
|
||||
#else
|
||||
[[nodiscard]] float Length() const
|
||||
{
|
||||
return std::hypot(x, y);
|
||||
}
|
||||
|
||||
[[nodiscard]] Vector2 Normalized() const
|
||||
{
|
||||
const float len = Length();
|
||||
return len > 0.f ? *this / len : *this;
|
||||
}
|
||||
#endif
|
||||
[[nodiscard]] constexpr float LengthSqr() const
|
||||
{
|
||||
return x * x + y * y;
|
||||
}
|
||||
|
||||
constexpr Vector2& Abs()
|
||||
{
|
||||
//FIXME: Replace with std::abs, if it will become constexprable
|
||||
x = x < 0 ? -x : x;
|
||||
y = y < 0 ? -y : y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<class type>
|
||||
[[nodiscard]] constexpr const type& As() const
|
||||
{
|
||||
return *reinterpret_cast<const type*>(this);
|
||||
}
|
||||
template<class type>
|
||||
[[nodiscard]] constexpr type& As()
|
||||
{
|
||||
return *reinterpret_cast<type*>(this);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector2 operator-() const
|
||||
{
|
||||
return {-x, -y};
|
||||
}
|
||||
|
||||
// Binary arithmetic operators
|
||||
[[nodiscard]] constexpr Vector2 operator+(const Vector2& v) const
|
||||
{
|
||||
return {x + v.x, y + v.y};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector2 operator-(const Vector2& v) const
|
||||
{
|
||||
return {x - v.x, y - v.y};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector2 operator*(const float fl) const
|
||||
{
|
||||
return {x * fl, y * fl};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector2 operator/(const float fl) const
|
||||
{
|
||||
return {x / fl, y / fl};
|
||||
}
|
||||
|
||||
// Sum of elements
|
||||
[[nodiscard]] constexpr float Sum() const
|
||||
{
|
||||
return x + y;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr std::tuple<float, float> AsTuple() const
|
||||
{
|
||||
return std::make_tuple(x, y);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,243 +0,0 @@
|
||||
//
|
||||
// Created by vlad on 10/28/23.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include "omath/Vector2.hpp"
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath
|
||||
{
|
||||
class OMATH_API Vector3 : public Vector2
|
||||
{
|
||||
public:
|
||||
float z = 0.f;
|
||||
constexpr Vector3(const float x, const float y, const float z) : Vector2(x, y), z(z) { }
|
||||
constexpr Vector3() : Vector2() {};
|
||||
|
||||
[[nodiscard]] constexpr bool operator==(const Vector3& src) const
|
||||
{
|
||||
return Vector2::operator==(src) && (src.z == z);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool operator!=(const Vector3& src) const
|
||||
{
|
||||
return !(*this == src);
|
||||
}
|
||||
|
||||
constexpr Vector3& operator+=(const Vector3& v)
|
||||
{
|
||||
Vector2::operator+=(v);
|
||||
z += v.z;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& operator-=(const Vector3& v)
|
||||
{
|
||||
Vector2::operator-=(v);
|
||||
z -= v.z;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& operator*=(const float fl)
|
||||
{
|
||||
Vector2::operator*=(fl);
|
||||
z *= fl;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& operator*=(const Vector3& v)
|
||||
{
|
||||
Vector2::operator*=(v);
|
||||
z *= v.z;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& operator/=(const Vector3& v)
|
||||
{
|
||||
Vector2::operator/=(v);
|
||||
z /= v.z;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& operator+=(const float fl)
|
||||
{
|
||||
Vector2::operator+=(fl);
|
||||
z += fl;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& operator/=(const float fl)
|
||||
{
|
||||
Vector2::operator/=(fl);
|
||||
z /= fl;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& operator-=(const float fl)
|
||||
{
|
||||
Vector2::operator-=(fl);
|
||||
z -= fl;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& Abs()
|
||||
{
|
||||
Vector2::Abs();
|
||||
z = z < 0.f ? -z : z;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr float DistToSqr(const Vector3& vOther) const
|
||||
{
|
||||
return (*this - vOther).LengthSqr();
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr float Dot(const Vector3& vOther) const
|
||||
{
|
||||
return Vector2::Dot(vOther) + z * vOther.z;
|
||||
}
|
||||
|
||||
#ifndef _MSC_VER
|
||||
[[nodiscard]] constexpr float Length() const
|
||||
{
|
||||
return std::hypot(x, y, z);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr float Length2D() const
|
||||
{
|
||||
return Vector2::Length();
|
||||
}
|
||||
[[nodiscard]] float DistTo(const Vector3& vOther) const
|
||||
{
|
||||
return (*this - vOther).Length();
|
||||
}
|
||||
[[nodiscard]] constexpr Vector3 Normalized() const
|
||||
{
|
||||
const float length = this->Length();
|
||||
|
||||
return length != 0 ? *this / length : *this;
|
||||
}
|
||||
#else
|
||||
[[nodiscard]] float Length() const
|
||||
{
|
||||
return std::hypot(x, y, z);
|
||||
}
|
||||
|
||||
[[nodiscard]] Vector3 Normalized() const
|
||||
{
|
||||
const float length = this->Length();
|
||||
|
||||
return length != 0 ? *this / length : *this;
|
||||
}
|
||||
|
||||
[[nodiscard]] float Length2D() const
|
||||
{
|
||||
return Vector2::Length();
|
||||
}
|
||||
|
||||
[[nodiscard]] float DistTo(const Vector3& vOther) const
|
||||
{
|
||||
return (*this - vOther).Length();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
[[nodiscard]] constexpr float LengthSqr() const
|
||||
{
|
||||
return Vector2::LengthSqr() + z * z;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 operator-() const
|
||||
{
|
||||
return {-x, -y, -z};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 operator+(const Vector3& v) const
|
||||
{
|
||||
return {x + v.x, y + v.y, z + v.z};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 operator-(const Vector3& v) const
|
||||
{
|
||||
return {x - v.x, y - v.y, z - v.z};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 operator*(const float fl) const
|
||||
{
|
||||
return {x * fl, y * fl, z * fl};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 operator*(const Vector3& v) const
|
||||
{
|
||||
return {x * v.x, y * v.y, z * v.z};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 operator/(const float fl) const
|
||||
{
|
||||
return {x / fl, y / fl, z / fl};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 operator/(const Vector3& v) const
|
||||
{
|
||||
return {x / v.x, y / v.y, z / v.z};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 Cross(const Vector3 &v) const
|
||||
{
|
||||
return
|
||||
{
|
||||
y * v.z - z * v.y,
|
||||
z * v.x - x * v.z,
|
||||
x * v.y - y * v.x
|
||||
};
|
||||
}
|
||||
[[nodiscard]] constexpr float Sum() const
|
||||
{
|
||||
return Sum2D() + z;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr float Sum2D() const
|
||||
{
|
||||
return Vector2::Sum();
|
||||
}
|
||||
|
||||
[[nodiscard]] Vector3 ViewAngleTo(const Vector3& other) const;
|
||||
|
||||
[[nodiscard]] std::tuple<float, float, float> AsTuple() const
|
||||
{
|
||||
return std::make_tuple(x, y, z);
|
||||
}
|
||||
};
|
||||
}
|
||||
// ReSharper disable once CppRedundantNamespaceDefinition
|
||||
namespace std
|
||||
{
|
||||
template<>
|
||||
struct hash<omath::Vector3>
|
||||
{
|
||||
std::size_t operator()(const omath::Vector3& vec) const noexcept
|
||||
{
|
||||
std::size_t hash = 0;
|
||||
constexpr std::hash<float> hasher;
|
||||
|
||||
hash ^= hasher(vec.x) + 0x9e3779b9 + (hash<<6) + (hash>>2);
|
||||
hash ^= hasher(vec.y) + 0x9e3779b9 + (hash<<6) + (hash>>2);
|
||||
hash ^= hasher(vec.z) + 0x9e3779b9 + (hash<<6) + (hash>>2);
|
||||
|
||||
return hash;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,155 +0,0 @@
|
||||
//
|
||||
// Vector4.h
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include <omath/Vector3.hpp>
|
||||
#include <algorithm>
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath
|
||||
{
|
||||
class OMATH_API Vector4 : public Vector3
|
||||
{
|
||||
public:
|
||||
float w;
|
||||
|
||||
constexpr Vector4(const float x, const float y, const float z, const float w) : Vector3(x, y, z), w(w) {}
|
||||
constexpr Vector4() : Vector3(), w(0.f) {};
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr bool operator==(const Vector4& src) const
|
||||
{
|
||||
return Vector3::operator==(src) && w == src.w;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr bool operator!=(const Vector4& src) const
|
||||
{
|
||||
return !(*this == src);
|
||||
}
|
||||
|
||||
constexpr Vector4& operator+=(const Vector4& v)
|
||||
{
|
||||
Vector3::operator+=(v);
|
||||
w += v.w;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector4& operator-=(const Vector4& v)
|
||||
{
|
||||
Vector3::operator-=(v);
|
||||
w -= v.w;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector4& operator*=(const float scalar)
|
||||
{
|
||||
Vector3::operator*=(scalar);
|
||||
w *= scalar;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector4& operator*=(const Vector4& v)
|
||||
{
|
||||
Vector3::operator*=(v);
|
||||
w *= v.w;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector4& operator/=(const float scalar)
|
||||
{
|
||||
Vector3::operator/=(scalar);
|
||||
w /= scalar;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector4& operator/=(const Vector4& v)
|
||||
{
|
||||
Vector3::operator/=(v);
|
||||
w /= v.w;
|
||||
return *this;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr float LengthSqr() const
|
||||
{
|
||||
return Vector3::LengthSqr() + w * w;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr float Dot(const Vector4& vOther) const
|
||||
{
|
||||
return Vector3::Dot(vOther) + w * vOther.w;
|
||||
}
|
||||
|
||||
[[nodiscard]] float Length() const;
|
||||
|
||||
constexpr Vector4& Abs()
|
||||
{
|
||||
Vector3::Abs();
|
||||
w = w < 0.f ? -w : w;
|
||||
|
||||
return *this;
|
||||
}
|
||||
constexpr Vector4& Clamp(const float min, const float max)
|
||||
{
|
||||
x = std::clamp(x, min, max);
|
||||
y = std::clamp(y, min, max);
|
||||
z = std::clamp(z, min, max);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector4 operator-() const
|
||||
{
|
||||
return {-x, -y, -z, -w};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector4 operator+(const Vector4& v) const
|
||||
{
|
||||
return {x + v.x, y + v.y, z + v.z, w + v.w};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector4 operator-(const Vector4& v) const
|
||||
{
|
||||
return {x - v.x, y - v.y, z - v.z, w - v.w};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector4 operator*(const float scalar) const
|
||||
{
|
||||
return {x * scalar, y * scalar, z * scalar, w * scalar};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector4 operator*(const Vector4& v) const
|
||||
{
|
||||
return {x * v.x, y * v.y, z * v.z, w * v.w};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector4 operator/(const float scalar) const
|
||||
{
|
||||
return {x / scalar, y / scalar, z / scalar, w / scalar};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector4 operator/(const Vector4& v) const
|
||||
{
|
||||
return {x / v.x, y / v.y, z / v.z, w / v.w};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr float Sum() const
|
||||
{
|
||||
return Vector3::Sum() + w;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -3,10 +3,10 @@
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/Angles.hpp"
|
||||
|
||||
#include "omath/angles.hpp"
|
||||
#include <algorithm>
|
||||
#include "omath/omath_export.hpp"
|
||||
#include <utility>
|
||||
#include <format>
|
||||
|
||||
namespace omath
|
||||
{
|
||||
@@ -18,13 +18,13 @@ namespace omath
|
||||
|
||||
template<class Type = float, Type min = Type(0), Type max = Type(360), AngleFlags flags = AngleFlags::Normalized>
|
||||
requires std::is_arithmetic_v<Type>
|
||||
class OMATH_API Angle
|
||||
class Angle
|
||||
{
|
||||
Type m_angle;
|
||||
constexpr Angle(const Type& degrees)
|
||||
constexpr explicit Angle(const Type& degrees) noexcept
|
||||
{
|
||||
if constexpr (flags == AngleFlags::Normalized)
|
||||
m_angle = angles::WrapAngle(degrees, min, max);
|
||||
m_angle = angles::wrap_angle(degrees, min, max);
|
||||
|
||||
else if constexpr (flags == AngleFlags::Clamped)
|
||||
m_angle = std::clamp(degrees, min, max);
|
||||
@@ -34,75 +34,74 @@ namespace omath
|
||||
std::unreachable();
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
[[nodiscard]]
|
||||
constexpr static Angle FromDegrees(const Type& degrees)
|
||||
constexpr static Angle from_degrees(const Type& degrees) noexcept
|
||||
{
|
||||
return {degrees};
|
||||
return Angle{degrees};
|
||||
}
|
||||
constexpr Angle() : m_angle(0)
|
||||
constexpr Angle() noexcept: m_angle(0)
|
||||
{
|
||||
|
||||
}
|
||||
[[nodiscard]]
|
||||
constexpr static Angle FromRadians(const Type& degrees)
|
||||
constexpr static Angle from_radians(const Type& degrees) noexcept
|
||||
{
|
||||
return {angles::RadiansToDegrees<Type>(degrees)};
|
||||
return Angle{angles::radians_to_degrees<Type>(degrees)};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr const Type& operator*() const
|
||||
constexpr const Type& operator*() const noexcept
|
||||
{
|
||||
return m_angle;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Type AsDegrees() const
|
||||
constexpr Type as_degrees() const noexcept
|
||||
{
|
||||
return m_angle;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Type AsRadians() const
|
||||
constexpr Type as_radians() const noexcept
|
||||
{
|
||||
return angles::DegreesToRadians(m_angle);
|
||||
return angles::degrees_to_radians(m_angle);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
Type Sin() const
|
||||
Type sin() const noexcept
|
||||
{
|
||||
return std::sin(AsRadians());
|
||||
return std::sin(as_radians());
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
Type Cos() const
|
||||
Type cos() const noexcept
|
||||
{
|
||||
return std::cos(AsRadians());
|
||||
return std::cos(as_radians());
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
Type Tan() const
|
||||
Type tan() const noexcept
|
||||
{
|
||||
return std::tan(AsRadians());
|
||||
return std::tan(as_radians());
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
Type Atan() const
|
||||
Type atan() const noexcept
|
||||
{
|
||||
return std::atan(AsRadians());
|
||||
return std::atan(as_radians());
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
Type Cot() const
|
||||
Type cot() const noexcept
|
||||
{
|
||||
return Cos() / Sin();
|
||||
return cos() / sin();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Angle& operator+=(const Angle& other)
|
||||
constexpr Angle& operator+=(const Angle& other) noexcept
|
||||
{
|
||||
if constexpr (flags == AngleFlags::Normalized)
|
||||
m_angle = angles::WrapAngle(m_angle + other.m_angle, min, max);
|
||||
m_angle = angles::wrap_angle(m_angle + other.m_angle, min, max);
|
||||
|
||||
else if constexpr (flags == AngleFlags::Clamped)
|
||||
m_angle = std::clamp(m_angle + other.m_angle, min, max);
|
||||
@@ -116,19 +115,18 @@ namespace omath
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr std::partial_ordering operator<=>(const Angle& other) const = default;
|
||||
constexpr std::partial_ordering operator<=>(const Angle& other) const noexcept = default;
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Angle& operator-=(const Angle& other)
|
||||
constexpr Angle& operator-=(const Angle& other) noexcept
|
||||
{
|
||||
return operator+=(-other);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Angle& operator+(const Angle& other)
|
||||
constexpr Angle& operator+(const Angle& other) noexcept
|
||||
{
|
||||
if constexpr (flags == AngleFlags::Normalized)
|
||||
return {angles::WrapAngle(m_angle + other.m_angle, min, max)};
|
||||
return {angles::wrap_angle(m_angle + other.m_angle, min, max)};
|
||||
|
||||
else if constexpr (flags == AngleFlags::Clamped)
|
||||
return {std::clamp(m_angle + other.m_angle, min, max)};
|
||||
@@ -140,15 +138,29 @@ namespace omath
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Angle& operator-(const Angle& other)
|
||||
constexpr Angle& operator-(const Angle& other) noexcept
|
||||
{
|
||||
return operator+(-other);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Angle operator-() const
|
||||
constexpr Angle operator-() const noexcept
|
||||
{
|
||||
return {-m_angle};
|
||||
return Angle{-m_angle};
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace omath
|
||||
template<class Type, Type min, Type max, omath::AngleFlags flags>
|
||||
struct std::formatter<omath::Angle<Type, min, max, flags>> // NOLINT(*-dcl58-cpp)
|
||||
{
|
||||
[[nodiscard]]
|
||||
static constexpr auto parse(std::format_parse_context& ctx)
|
||||
{
|
||||
return ctx.begin();
|
||||
}
|
||||
[[nodiscard]]
|
||||
static auto format(const omath::Angle<Type, min, max, flags>& deg, std::format_context& ctx)
|
||||
{
|
||||
return std::format_to(ctx.out(), "{}deg", deg.as_degrees());
|
||||
}
|
||||
};
|
||||
64
include/omath/angles.hpp
Normal file
64
include/omath/angles.hpp
Normal file
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// Created by vlad on 11/6/23.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include <cmath>
|
||||
#include <numbers>
|
||||
|
||||
namespace omath::angles
|
||||
{
|
||||
template<class Type>
|
||||
requires std::is_floating_point_v<Type>
|
||||
[[nodiscard]] constexpr Type radians_to_degrees(const Type& radians) noexcept
|
||||
{
|
||||
return radians * (static_cast<Type>(180) / std::numbers::pi_v<Type>);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
requires std::is_floating_point_v<Type>
|
||||
[[nodiscard]] constexpr Type degrees_to_radians(const Type& degrees) noexcept
|
||||
{
|
||||
return degrees * (std::numbers::pi_v<Type> / static_cast<Type>(180));
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
requires std::is_floating_point_v<Type>
|
||||
[[nodiscard]] Type horizontal_fov_to_vertical(const Type& horizontal_fov, const Type& aspect) noexcept
|
||||
{
|
||||
const auto fov_rad = degrees_to_radians(horizontal_fov);
|
||||
|
||||
const auto vert_fov = static_cast<Type>(2) * std::atan(std::tan(fov_rad / static_cast<Type>(2)) / aspect);
|
||||
|
||||
return radians_to_degrees(vert_fov);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
requires std::is_floating_point_v<Type>
|
||||
[[nodiscard]] Type vertical_fov_to_horizontal(const Type& vertical_fov, const Type& aspect) noexcept
|
||||
{
|
||||
const auto fov_as_radians = degrees_to_radians(vertical_fov);
|
||||
|
||||
const auto horizontal_fov =
|
||||
static_cast<Type>(2) * std::atan(std::tan(fov_as_radians / static_cast<Type>(2)) * aspect);
|
||||
|
||||
return radians_to_degrees(horizontal_fov);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
requires std::is_arithmetic_v<Type>
|
||||
[[nodiscard]] Type wrap_angle(const Type& angle, const Type& min, const Type& max) noexcept
|
||||
{
|
||||
if (angle <= max && angle >= min)
|
||||
return angle;
|
||||
|
||||
const Type range = max - min;
|
||||
|
||||
Type wrapped_angle = std::fmod(angle - min, range);
|
||||
|
||||
if (wrapped_angle < 0)
|
||||
wrapped_angle += range;
|
||||
|
||||
return wrapped_angle + min;
|
||||
}
|
||||
} // namespace omath::angles
|
||||
@@ -1,39 +0,0 @@
|
||||
//
|
||||
// Created by Orange on 11/13/2024.
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include "omath/Vector3.hpp"
|
||||
#include "omath/Triangle3d.hpp"
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath::collision
|
||||
{
|
||||
class OMATH_API Ray
|
||||
{
|
||||
public:
|
||||
Vector3 start;
|
||||
Vector3 end;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3 DirectionVector() const;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3 DirectionVectorNormalized() const;
|
||||
};
|
||||
class OMATH_API LineTracer
|
||||
{
|
||||
public:
|
||||
LineTracer() = delete;
|
||||
|
||||
|
||||
[[nodiscard]]
|
||||
static bool CanTraceLine(const Ray& ray, const Triangle3d& triangle);
|
||||
|
||||
|
||||
// Realization of Möller–Trumbore intersection algorithm
|
||||
// https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm
|
||||
[[nodiscard]]
|
||||
static Vector3 GetRayHitPoint(const Ray& ray, const Triangle3d& triangle);
|
||||
};
|
||||
}
|
||||
37
include/omath/collision/line_tracer.hpp
Normal file
37
include/omath/collision/line_tracer.hpp
Normal file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// Created by Orange on 11/13/2024.
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include "omath/triangle.hpp"
|
||||
#include "omath/vector3.hpp"
|
||||
|
||||
namespace omath::collision
|
||||
{
|
||||
class Ray
|
||||
{
|
||||
public:
|
||||
Vector3<float> start;
|
||||
Vector3<float> end;
|
||||
bool infinite_length = false;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3<float> direction_vector() const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3<float> direction_vector_normalized() const noexcept;
|
||||
};
|
||||
class LineTracer
|
||||
{
|
||||
public:
|
||||
LineTracer() = delete;
|
||||
|
||||
[[nodiscard]]
|
||||
static bool can_trace_line(const Ray& ray, const Triangle<Vector3<float>>& triangle) noexcept;
|
||||
|
||||
// Realization of Möller–Trumbore intersection algorithm
|
||||
// https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm
|
||||
[[nodiscard]]
|
||||
static Vector3<float> get_ray_hit_point(const Ray& ray, const Triangle<Vector3<float>>& triangle) noexcept;
|
||||
};
|
||||
} // namespace omath::collision
|
||||
187
include/omath/color.hpp
Normal file
187
include/omath/color.hpp
Normal file
@@ -0,0 +1,187 @@
|
||||
//
|
||||
// Created by vlad on 2/4/24.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "omath/vector3.hpp"
|
||||
#include "omath/vector4.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
namespace omath
|
||||
{
|
||||
struct Hsv
|
||||
{
|
||||
float hue{};
|
||||
float saturation{};
|
||||
float value{};
|
||||
};
|
||||
|
||||
class Color final : public Vector4<float>
|
||||
{
|
||||
public:
|
||||
constexpr Color(const float r, const float g, const float b, const float a) noexcept: Vector4(r, g, b, a)
|
||||
{
|
||||
clamp(0.f, 1.f);
|
||||
}
|
||||
|
||||
constexpr explicit Color() noexcept = default;
|
||||
[[nodiscard]]
|
||||
constexpr static Color from_rgba(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t a) noexcept
|
||||
{
|
||||
return Color{Vector4(r, g, b, a) / 255.f};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr static Color from_hsv(float hue, const float saturation, const float value) noexcept
|
||||
{
|
||||
float r{}, g{}, b{};
|
||||
|
||||
hue = std::clamp(hue, 0.f, 1.f);
|
||||
|
||||
const int i = static_cast<int>(hue * 6.f);
|
||||
const float f = hue * 6.f - static_cast<float>(i);
|
||||
const float p = value * (1 - saturation);
|
||||
const float q = value * (1 - f * saturation);
|
||||
const float t = value * (1 - (1 - f) * saturation);
|
||||
|
||||
switch (i % 6)
|
||||
{
|
||||
case 0:
|
||||
r = value, g = t, b = p;
|
||||
break;
|
||||
case 1:
|
||||
r = q, g = value, b = p;
|
||||
break;
|
||||
case 2:
|
||||
r = p, g = value, b = t;
|
||||
break;
|
||||
case 3:
|
||||
r = p, g = q, b = value;
|
||||
break;
|
||||
case 4:
|
||||
r = t, g = p, b = value;
|
||||
break;
|
||||
case 5:
|
||||
r = value, g = p, b = q;
|
||||
break;
|
||||
|
||||
default:
|
||||
return {0.f, 0.f, 0.f, 0.f};
|
||||
}
|
||||
|
||||
return {r, g, b, 1.f};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr static Color from_hsv(const Hsv& hsv) noexcept
|
||||
{
|
||||
return from_hsv(hsv.hue, hsv.saturation, hsv.value);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Hsv to_hsv() const noexcept
|
||||
{
|
||||
Hsv hsv_data;
|
||||
|
||||
const float& red = x;
|
||||
const float& green = y;
|
||||
const float& blue = z;
|
||||
|
||||
const float max = std::max({red, green, blue});
|
||||
const float min = std::min({red, green, blue});
|
||||
const float delta = max - min;
|
||||
|
||||
if (delta == 0.f)
|
||||
hsv_data.hue = 0.f;
|
||||
|
||||
else if (max == red)
|
||||
hsv_data.hue = 60.f * (std::fmodf(((green - blue) / delta), 6.f));
|
||||
else if (max == green)
|
||||
hsv_data.hue = 60.f * (((blue - red) / delta) + 2.f);
|
||||
else if (max == blue)
|
||||
hsv_data.hue = 60.f * (((red - green) / delta) + 4.f);
|
||||
|
||||
if (hsv_data.hue < 0.f)
|
||||
hsv_data.hue += 360.f;
|
||||
|
||||
hsv_data.hue /= 360.f;
|
||||
hsv_data.saturation = max == 0.f ? 0.f : delta / max;
|
||||
hsv_data.value = max;
|
||||
|
||||
return hsv_data;
|
||||
}
|
||||
|
||||
constexpr explicit Color(const Vector4& vec) noexcept: Vector4(vec)
|
||||
{
|
||||
clamp(0.f, 1.f);
|
||||
}
|
||||
constexpr void set_hue(const float hue) noexcept
|
||||
{
|
||||
auto hsv = to_hsv();
|
||||
hsv.hue = hue;
|
||||
|
||||
*this = from_hsv(hsv);
|
||||
}
|
||||
|
||||
constexpr void set_saturation(const float saturation) noexcept
|
||||
{
|
||||
auto hsv = to_hsv();
|
||||
hsv.saturation = saturation;
|
||||
|
||||
*this = from_hsv(hsv);
|
||||
}
|
||||
|
||||
constexpr void set_value(const float value) noexcept
|
||||
{
|
||||
auto hsv = to_hsv();
|
||||
hsv.value = value;
|
||||
|
||||
*this = from_hsv(hsv);
|
||||
}
|
||||
[[nodiscard]]
|
||||
constexpr Color blend(const Color& other, float ratio) const noexcept
|
||||
{
|
||||
ratio = std::clamp(ratio, 0.f, 1.f);
|
||||
return Color(*this * (1.f - ratio) + other * ratio);
|
||||
}
|
||||
|
||||
[[nodiscard]] static constexpr Color red()
|
||||
{
|
||||
return {1.f, 0.f, 0.f, 1.f};
|
||||
}
|
||||
[[nodiscard]] static constexpr Color green()
|
||||
{
|
||||
return {0.f, 1.f, 0.f, 1.f};
|
||||
}
|
||||
[[nodiscard]] static constexpr Color blue()
|
||||
{
|
||||
return {0.f, 0.f, 1.f, 1.f};
|
||||
}
|
||||
#ifdef OMATH_IMGUI_INTEGRATION
|
||||
[[nodiscard]]
|
||||
ImColor to_im_color() const noexcept
|
||||
{
|
||||
return {to_im_vec4()};
|
||||
}
|
||||
#endif
|
||||
};
|
||||
} // namespace omath
|
||||
template<>
|
||||
struct std::formatter<omath::Color> // NOLINT(*-dcl58-cpp)
|
||||
{
|
||||
[[nodiscard]]
|
||||
static constexpr auto parse(std::format_parse_context& ctx)
|
||||
{
|
||||
return ctx.begin();
|
||||
}
|
||||
[[nodiscard]]
|
||||
static auto format(const omath::Color& col, std::format_context& ctx)
|
||||
{
|
||||
return std::format_to(ctx.out(), "[r:{}, g:{}, b:{}, a:{}]",
|
||||
static_cast<int>(col.x * 255.f),
|
||||
static_cast<int>(col.y * 255.f),
|
||||
static_cast<int>(col.z * 255.f),
|
||||
static_cast<int>(col.w * 255.f));
|
||||
}
|
||||
};
|
||||
@@ -1,20 +0,0 @@
|
||||
//
|
||||
// Created by Orange on 12/4/2024.
|
||||
//
|
||||
#pragma once
|
||||
#include "Constants.h"
|
||||
#include "omath/projection/Camera.hpp"
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath::source
|
||||
{
|
||||
class OMATH_API Camera final : public projection::Camera<Mat4x4, ViewAngles>
|
||||
{
|
||||
public:
|
||||
Camera(const Vector3& position, const ViewAngles& viewAngles, const projection::ViewPort& viewPort,
|
||||
const Angle<float, 0.f, 180.f, AngleFlags::Clamped>& fov, float near, float far);
|
||||
void LookAt(const Vector3& target) override;
|
||||
[[nodiscard]] Mat4x4 GetViewMatrix() const override;
|
||||
[[nodiscard]] Mat4x4 GetProjectionMatrix() const override;
|
||||
};
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
//
|
||||
// Created by Orange on 12/4/2024.
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include <omath/Vector3.hpp>
|
||||
#include <omath/Mat.hpp>
|
||||
#include <omath/Angle.hpp>
|
||||
#include <omath/ViewAngles.hpp>
|
||||
namespace omath::source
|
||||
{
|
||||
constexpr Vector3 kAbsUp = {0, 0, 1};
|
||||
constexpr Vector3 kAbsRight = {0, -1, 0};
|
||||
constexpr Vector3 kAbsForward = {1, 0, 0};
|
||||
|
||||
using Mat4x4 = Mat<4, 4, float, MatStoreType::ROW_MAJOR>;
|
||||
using Mat3x3 = Mat<4, 4, float, MatStoreType::ROW_MAJOR>;
|
||||
using Mat1x3 = Mat<1, 3, float, MatStoreType::ROW_MAJOR>;
|
||||
using PitchAngle = Angle<float, -89.f, 89.f, AngleFlags::Clamped>;
|
||||
using YawAngle = Angle<float, -180.f, 180.f, AngleFlags::Normalized>;
|
||||
using RollAngle = Angle<float, -180.f, 180.f, AngleFlags::Normalized>;
|
||||
|
||||
using ViewAngles = omath::ViewAngles<PitchAngle, YawAngle, RollAngle>;
|
||||
} // namespace omath::source
|
||||
@@ -1,57 +0,0 @@
|
||||
//
|
||||
// Created by Orange on 12/4/2024.
|
||||
//
|
||||
#pragma once
|
||||
#include "Constants.h"
|
||||
|
||||
namespace omath::source
|
||||
{
|
||||
[[nodiscard]]
|
||||
inline Vector3 ForwardVector(const ViewAngles& angles)
|
||||
{
|
||||
const auto vec = MatRotation(angles) * MatColumnFromVector(kAbsForward);
|
||||
|
||||
return {vec.At(0, 0), vec.At(1, 0), vec.At(2, 0)};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
inline Vector3 RightVector(const ViewAngles& angles)
|
||||
{
|
||||
const auto vec = MatRotation(angles) * MatColumnFromVector(kAbsRight);
|
||||
|
||||
return {vec.At(0, 0), vec.At(1, 0), vec.At(2, 0)};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
inline Vector3 UpVector(const ViewAngles& angles)
|
||||
{
|
||||
const auto vec = MatRotation(angles) * MatColumnFromVector(kAbsUp);
|
||||
|
||||
return {vec.At(0, 0), vec.At(1, 0), vec.At(2, 0)};
|
||||
}
|
||||
|
||||
[[nodiscard]] inline Mat4x4 CalcViewMatrix(const ViewAngles& angles, const Vector3& cam_origin)
|
||||
{
|
||||
return MatCameraView(ForwardVector(angles), RightVector(angles), UpVector(angles), cam_origin);
|
||||
}
|
||||
|
||||
|
||||
[[nodiscard]]
|
||||
inline Mat4x4 CalcPerspectiveProjectionMatrix(const float fieldOfView, const float aspectRatio, const float near,
|
||||
const float far)
|
||||
{
|
||||
// NOTE: Needed tp make thing draw normal, since source is wierd
|
||||
// and use tricky projection matrix formula.
|
||||
constexpr auto kMultiplyFactor = 0.75f;
|
||||
|
||||
const float fovHalfTan = std::tan(angles::DegreesToRadians(fieldOfView) / 2.f) * kMultiplyFactor;
|
||||
|
||||
return {
|
||||
{1.f / (aspectRatio * fovHalfTan), 0, 0, 0},
|
||||
{0, 1.f / (fovHalfTan), 0, 0},
|
||||
{0, 0, (far + near) / (far - near), -(2.f * far * near) / (far - near)},
|
||||
{0, 0, 1, 0},
|
||||
|
||||
};
|
||||
}
|
||||
} // namespace omath::source
|
||||
13
include/omath/engines/iw_engine/camera.hpp
Normal file
13
include/omath/engines/iw_engine/camera.hpp
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// Created by Vlad on 3/17/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/engines/iw_engine/constants.hpp"
|
||||
#include "omath/projection/camera.hpp"
|
||||
#include "traits/camera_trait.hpp"
|
||||
|
||||
namespace omath::iw_engine
|
||||
{
|
||||
using Camera = projection::Camera<Mat4X4, ViewAngles, CameraTrait>;
|
||||
} // namespace omath::iw_engine
|
||||
25
include/omath/engines/iw_engine/constants.hpp
Normal file
25
include/omath/engines/iw_engine/constants.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by Vlad on 3/17/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include <omath/angle.hpp>
|
||||
#include <omath/mat.hpp>
|
||||
#include <omath/vector3.hpp>
|
||||
#include <omath/view_angles.hpp>
|
||||
|
||||
namespace omath::iw_engine
|
||||
{
|
||||
constexpr Vector3<float> k_abs_up = {0, 0, 1};
|
||||
constexpr Vector3<float> k_abs_right = {0, -1, 0};
|
||||
constexpr Vector3<float> k_abs_forward = {1, 0, 0};
|
||||
|
||||
using Mat4X4 = Mat<4, 4, float, MatStoreType::ROW_MAJOR>;
|
||||
using Mat3X3 = Mat<4, 4, float, MatStoreType::ROW_MAJOR>;
|
||||
using Mat1X3 = Mat<1, 3, float, MatStoreType::ROW_MAJOR>;
|
||||
using PitchAngle = Angle<float, -89.f, 89.f, AngleFlags::Clamped>;
|
||||
using YawAngle = Angle<float, -180.f, 180.f, AngleFlags::Normalized>;
|
||||
using RollAngle = Angle<float, -180.f, 180.f, AngleFlags::Normalized>;
|
||||
|
||||
using ViewAngles = omath::ViewAngles<PitchAngle, YawAngle, RollAngle>;
|
||||
} // namespace omath::iw_engine
|
||||
26
include/omath/engines/iw_engine/formulas.hpp
Normal file
26
include/omath/engines/iw_engine/formulas.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Created by Vlad on 3/17/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/engines/iw_engine/constants.hpp"
|
||||
|
||||
namespace omath::iw_engine
|
||||
{
|
||||
[[nodiscard]]
|
||||
Vector3<float> forward_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3<float> right_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3<float> up_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Mat4X4 rotation_matrix(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]] Mat4X4 calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Mat4X4 calc_perspective_projection_matrix(float field_of_view, float aspect_ratio, float near, float far) noexcept;
|
||||
} // namespace omath::iw_engine
|
||||
24
include/omath/engines/iw_engine/traits/camera_trait.hpp
Normal file
24
include/omath/engines/iw_engine/traits/camera_trait.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Created by Vlad on 8/10/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/engines/iw_engine/constants.hpp"
|
||||
#include "omath/projection/camera.hpp"
|
||||
|
||||
namespace omath::iw_engine
|
||||
{
|
||||
class CameraTrait final
|
||||
{
|
||||
public:
|
||||
[[nodiscard]]
|
||||
static ViewAngles calc_look_at_angle(const Vector3<float>& cam_origin, const Vector3<float>& look_at) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
static Mat4X4 calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept;
|
||||
[[nodiscard]]
|
||||
static Mat4X4 calc_projection_matrix(const projection::FieldOfView& fov, const projection::ViewPort& view_port,
|
||||
float near, float far) noexcept;
|
||||
};
|
||||
|
||||
} // namespace omath::iw_engine
|
||||
79
include/omath/engines/iw_engine/traits/pred_engine_trait.hpp
Normal file
79
include/omath/engines/iw_engine/traits/pred_engine_trait.hpp
Normal file
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// Created by Vlad on 8/6/2025.
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include "omath/engines/iw_engine/formulas.hpp"
|
||||
#include "omath/projectile_prediction/projectile.hpp"
|
||||
#include "omath/projectile_prediction/target.hpp"
|
||||
#include <optional>
|
||||
|
||||
namespace omath::iw_engine
|
||||
{
|
||||
class PredEngineTrait final
|
||||
{
|
||||
public:
|
||||
constexpr static Vector3<float> predict_projectile_position(const projectile_prediction::Projectile& projectile,
|
||||
const float pitch, const float yaw,
|
||||
const float time, const float gravity) noexcept
|
||||
{
|
||||
auto current_pos = projectile.m_origin
|
||||
+ forward_vector({PitchAngle::from_degrees(-pitch), YawAngle::from_degrees(yaw),
|
||||
RollAngle::from_degrees(0)})
|
||||
* projectile.m_launch_speed * time;
|
||||
current_pos.z -= (gravity * projectile.m_gravity_scale) * (time * time) * 0.5f;
|
||||
|
||||
return current_pos;
|
||||
}
|
||||
[[nodiscard]]
|
||||
static constexpr Vector3<float> predict_target_position(const projectile_prediction::Target& target,
|
||||
const float time, const float gravity) noexcept
|
||||
{
|
||||
auto predicted = target.m_origin + target.m_velocity * time;
|
||||
|
||||
if (target.m_is_airborne)
|
||||
predicted.z -= gravity * (time * time) * 0.5f;
|
||||
|
||||
return predicted;
|
||||
}
|
||||
[[nodiscard]]
|
||||
static float calc_vector_2d_distance(const Vector3<float>& delta) noexcept
|
||||
{
|
||||
return std::sqrt(delta.x * delta.x + delta.y * delta.y);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr static float get_vector_height_coordinate(const Vector3<float>& vec) noexcept
|
||||
{
|
||||
return vec.z;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static Vector3<float> calc_viewpoint_from_angles(const projectile_prediction::Projectile& projectile,
|
||||
Vector3<float> predicted_target_position,
|
||||
const std::optional<float> projectile_pitch) noexcept
|
||||
{
|
||||
const auto delta2d = calc_vector_2d_distance(predicted_target_position - projectile.m_origin);
|
||||
const auto height = delta2d * std::tan(angles::degrees_to_radians(projectile_pitch.value()));
|
||||
|
||||
return {predicted_target_position.x, predicted_target_position.y, projectile.m_origin.z + height};
|
||||
}
|
||||
// Due to specification of maybe_calculate_projectile_launch_pitch_angle, pitch angle must be:
|
||||
// 89 look up, -89 look down
|
||||
[[nodiscard]]
|
||||
static float calc_direct_pitch_angle(const Vector3<float>& origin, const Vector3<float>& view_to) noexcept
|
||||
{
|
||||
const auto distance = origin.distance_to(view_to);
|
||||
const auto delta = view_to - origin;
|
||||
|
||||
return angles::radians_to_degrees(std::asin(delta.z / distance));
|
||||
}
|
||||
[[nodiscard]]
|
||||
static float calc_direct_yaw_angle(const Vector3<float>& origin, const Vector3<float>& view_to) noexcept
|
||||
{
|
||||
const auto delta = view_to - origin;
|
||||
|
||||
return angles::radians_to_degrees(std::atan2(delta.y, delta.x));
|
||||
};
|
||||
};
|
||||
} // namespace omath::iw_engine
|
||||
12
include/omath/engines/opengl_engine/camera.hpp
Normal file
12
include/omath/engines/opengl_engine/camera.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// Created by Orange on 12/23/2024.
|
||||
//
|
||||
#pragma once
|
||||
#include "omath/engines/opengl_engine/constants.hpp"
|
||||
#include "omath/projection/camera.hpp"
|
||||
#include "traits/camera_trait.hpp"
|
||||
|
||||
namespace omath::opengl_engine
|
||||
{
|
||||
using Camera = projection::Camera<Mat4X4, ViewAngles, CameraTrait>;
|
||||
} // namespace omath::opengl_engine
|
||||
25
include/omath/engines/opengl_engine/constants.hpp
Normal file
25
include/omath/engines/opengl_engine/constants.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by Orange on 12/23/2024.
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include <omath/angle.hpp>
|
||||
#include <omath/mat.hpp>
|
||||
#include <omath/vector3.hpp>
|
||||
#include <omath/view_angles.hpp>
|
||||
|
||||
namespace omath::opengl_engine
|
||||
{
|
||||
constexpr Vector3<float> k_abs_up = {0, 1, 0};
|
||||
constexpr Vector3<float> k_abs_right = {1, 0, 0};
|
||||
constexpr Vector3<float> k_abs_forward = {0, 0, -1};
|
||||
|
||||
using Mat4X4 = Mat<4, 4, float, MatStoreType::COLUMN_MAJOR>;
|
||||
using Mat3X3 = Mat<4, 4, float, MatStoreType::COLUMN_MAJOR>;
|
||||
using Mat1X3 = Mat<1, 3, float, MatStoreType::COLUMN_MAJOR>;
|
||||
using PitchAngle = Angle<float, -90.f, 90.f, AngleFlags::Clamped>;
|
||||
using YawAngle = Angle<float, -180.f, 180.f, AngleFlags::Normalized>;
|
||||
using RollAngle = Angle<float, -180.f, 180.f, AngleFlags::Normalized>;
|
||||
|
||||
using ViewAngles = omath::ViewAngles<PitchAngle, YawAngle, RollAngle>;
|
||||
} // namespace omath::opengl_engine
|
||||
26
include/omath/engines/opengl_engine/formulas.hpp
Normal file
26
include/omath/engines/opengl_engine/formulas.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Created by Orange on 12/23/2024.
|
||||
//
|
||||
#pragma once
|
||||
#include "omath/engines/opengl_engine/constants.hpp"
|
||||
|
||||
|
||||
namespace omath::opengl_engine
|
||||
{
|
||||
[[nodiscard]]
|
||||
Vector3<float> forward_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3<float> right_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3<float> up_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]] Mat4X4 calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Mat4X4 rotation_matrix(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Mat4X4 calc_perspective_projection_matrix(float field_of_view, float aspect_ratio, float near, float far) noexcept;
|
||||
} // namespace omath::opengl_engine
|
||||
24
include/omath/engines/opengl_engine/traits/camera_trait.hpp
Normal file
24
include/omath/engines/opengl_engine/traits/camera_trait.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Created by Vlad on 8/10/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/engines/opengl_engine/constants.hpp"
|
||||
#include "omath/projection/camera.hpp"
|
||||
|
||||
namespace omath::opengl_engine
|
||||
{
|
||||
class CameraTrait final
|
||||
{
|
||||
public:
|
||||
[[nodiscard]]
|
||||
static ViewAngles calc_look_at_angle(const Vector3<float>& cam_origin, const Vector3<float>& look_at) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
static Mat4X4 calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept;
|
||||
[[nodiscard]]
|
||||
static Mat4X4 calc_projection_matrix(const projection::FieldOfView& fov, const projection::ViewPort& view_port,
|
||||
float near, float far) noexcept;
|
||||
};
|
||||
|
||||
} // namespace omath::opengl_engine
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// Created by Vlad on 8/6/2025.
|
||||
//
|
||||
#pragma once
|
||||
#include "omath/engines/opengl_engine/formulas.hpp"
|
||||
#include "omath/projectile_prediction/projectile.hpp"
|
||||
#include "omath/projectile_prediction/target.hpp"
|
||||
#include <optional>
|
||||
|
||||
namespace omath::opengl_engine
|
||||
{
|
||||
class PredEngineTrait final
|
||||
{
|
||||
public:
|
||||
constexpr static Vector3<float> predict_projectile_position(const projectile_prediction::Projectile& projectile,
|
||||
const float pitch, const float yaw,
|
||||
const float time, const float gravity) noexcept
|
||||
{
|
||||
auto current_pos = projectile.m_origin
|
||||
+ forward_vector({PitchAngle::from_degrees(-pitch), YawAngle::from_degrees(yaw),
|
||||
RollAngle::from_degrees(0)})
|
||||
* projectile.m_launch_speed * time;
|
||||
current_pos.y -= (gravity * projectile.m_gravity_scale) * (time * time) * 0.5f;
|
||||
|
||||
return current_pos;
|
||||
}
|
||||
[[nodiscard]]
|
||||
static constexpr Vector3<float> predict_target_position(const projectile_prediction::Target& target,
|
||||
const float time, const float gravity) noexcept
|
||||
{
|
||||
auto predicted = target.m_origin + target.m_velocity * time;
|
||||
|
||||
if (target.m_is_airborne)
|
||||
predicted.y -= gravity * (time * time) * 0.5f;
|
||||
|
||||
return predicted;
|
||||
}
|
||||
[[nodiscard]]
|
||||
static float calc_vector_2d_distance(const Vector3<float>& delta) noexcept
|
||||
{
|
||||
return std::sqrt(delta.x * delta.x + delta.z * delta.z);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr static float get_vector_height_coordinate(const Vector3<float>& vec) noexcept
|
||||
{
|
||||
return vec.y;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static Vector3<float> calc_viewpoint_from_angles(const projectile_prediction::Projectile& projectile,
|
||||
Vector3<float> predicted_target_position,
|
||||
const std::optional<float> projectile_pitch) noexcept
|
||||
{
|
||||
const auto delta2d = calc_vector_2d_distance(predicted_target_position - projectile.m_origin);
|
||||
const auto height = delta2d * std::tan(angles::degrees_to_radians(projectile_pitch.value()));
|
||||
|
||||
return {predicted_target_position.x, predicted_target_position.y + height, projectile.m_origin.z};
|
||||
}
|
||||
// Due to specification of maybe_calculate_projectile_launch_pitch_angle, pitch angle must be:
|
||||
// 89 look up, -89 look down
|
||||
[[nodiscard]]
|
||||
static float calc_direct_pitch_angle(const Vector3<float>& origin, const Vector3<float>& view_to) noexcept
|
||||
{
|
||||
const auto distance = origin.distance_to(view_to);
|
||||
const auto delta = view_to - origin;
|
||||
|
||||
return angles::radians_to_degrees(std::asin(delta.y / distance));
|
||||
}
|
||||
[[nodiscard]]
|
||||
static float calc_direct_yaw_angle(const Vector3<float>& origin, const Vector3<float>& view_to) noexcept
|
||||
{
|
||||
const auto delta = view_to - origin;
|
||||
|
||||
return angles::radians_to_degrees(std::atan2(delta.z, delta.x));
|
||||
};
|
||||
};
|
||||
} // namespace omath::opengl_engine
|
||||
11
include/omath/engines/source_engine/camera.hpp
Normal file
11
include/omath/engines/source_engine/camera.hpp
Normal file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// Created by Orange on 12/4/2024.
|
||||
//
|
||||
#pragma once
|
||||
#include "omath/engines/source_engine/constants.hpp"
|
||||
#include "omath/projection/camera.hpp"
|
||||
#include "traits/camera_trait.hpp"
|
||||
namespace omath::source_engine
|
||||
{
|
||||
using Camera = projection::Camera<Mat4X4, ViewAngles, CameraTrait>;
|
||||
} // namespace omath::source_engine
|
||||
25
include/omath/engines/source_engine/constants.hpp
Normal file
25
include/omath/engines/source_engine/constants.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by Orange on 12/4/2024.
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include <omath/angle.hpp>
|
||||
#include <omath/mat.hpp>
|
||||
#include <omath/vector3.hpp>
|
||||
#include <omath/view_angles.hpp>
|
||||
|
||||
namespace omath::source_engine
|
||||
{
|
||||
constexpr Vector3<float> k_abs_up = {0, 0, 1};
|
||||
constexpr Vector3<float> k_abs_right = {0, -1, 0};
|
||||
constexpr Vector3<float> k_abs_forward = {1, 0, 0};
|
||||
|
||||
using Mat4X4 = Mat<4, 4, float, MatStoreType::ROW_MAJOR>;
|
||||
using Mat3X3 = Mat<4, 4, float, MatStoreType::ROW_MAJOR>;
|
||||
using Mat1X3 = Mat<1, 3, float, MatStoreType::ROW_MAJOR>;
|
||||
using PitchAngle = Angle<float, -89.f, 89.f, AngleFlags::Clamped>;
|
||||
using YawAngle = Angle<float, -180.f, 180.f, AngleFlags::Normalized>;
|
||||
using RollAngle = Angle<float, -180.f, 180.f, AngleFlags::Normalized>;
|
||||
|
||||
using ViewAngles = omath::ViewAngles<PitchAngle, YawAngle, RollAngle>;
|
||||
} // namespace omath::source_engine
|
||||
25
include/omath/engines/source_engine/formulas.hpp
Normal file
25
include/omath/engines/source_engine/formulas.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by Orange on 12/4/2024.
|
||||
//
|
||||
#pragma once
|
||||
#include "omath/engines/source_engine/constants.hpp"
|
||||
|
||||
namespace omath::source_engine
|
||||
{
|
||||
[[nodiscard]]
|
||||
Vector3<float> forward_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Mat4X4 rotation_matrix(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3<float> right_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3<float> up_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]] Mat4X4 calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Mat4X4 calc_perspective_projection_matrix(float field_of_view, float aspect_ratio, float near, float far) noexcept;
|
||||
} // namespace omath::source_engine
|
||||
24
include/omath/engines/source_engine/traits/camera_trait.hpp
Normal file
24
include/omath/engines/source_engine/traits/camera_trait.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Created by Vlad on 8/10/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/engines/source_engine/constants.hpp"
|
||||
#include "omath/projection/camera.hpp"
|
||||
|
||||
namespace omath::source_engine
|
||||
{
|
||||
class CameraTrait final
|
||||
{
|
||||
public:
|
||||
[[nodiscard]]
|
||||
static ViewAngles calc_look_at_angle(const Vector3<float>& cam_origin, const Vector3<float>& look_at) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
static Mat4X4 calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept;
|
||||
[[nodiscard]]
|
||||
static Mat4X4 calc_projection_matrix(const projection::FieldOfView& fov, const projection::ViewPort& view_port,
|
||||
float near, float far) noexcept;
|
||||
};
|
||||
|
||||
} // namespace omath::source_engine
|
||||
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// Created by Vlad on 8/3/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/engines/source_engine/formulas.hpp"
|
||||
#include "omath/projectile_prediction/projectile.hpp"
|
||||
#include "omath/projectile_prediction/target.hpp"
|
||||
#include <optional>
|
||||
|
||||
namespace omath::source_engine
|
||||
{
|
||||
class PredEngineTrait final
|
||||
{
|
||||
public:
|
||||
constexpr static Vector3<float> predict_projectile_position(const projectile_prediction::Projectile& projectile,
|
||||
const float pitch, const float yaw,
|
||||
const float time, const float gravity) noexcept
|
||||
{
|
||||
auto current_pos = projectile.m_origin
|
||||
+ forward_vector({PitchAngle::from_degrees(-pitch), YawAngle::from_degrees(yaw),
|
||||
RollAngle::from_degrees(0)})
|
||||
* projectile.m_launch_speed * time;
|
||||
current_pos.z -= (gravity * projectile.m_gravity_scale) * (time * time) * 0.5f;
|
||||
|
||||
return current_pos;
|
||||
}
|
||||
[[nodiscard]]
|
||||
static constexpr Vector3<float> predict_target_position(const projectile_prediction::Target& target,
|
||||
const float time, const float gravity) noexcept
|
||||
{
|
||||
auto predicted = target.m_origin + target.m_velocity * time;
|
||||
|
||||
if (target.m_is_airborne)
|
||||
predicted.z -= gravity * (time * time) * 0.5f;
|
||||
|
||||
return predicted;
|
||||
}
|
||||
[[nodiscard]]
|
||||
static float calc_vector_2d_distance(const Vector3<float>& delta) noexcept
|
||||
{
|
||||
return std::sqrt(delta.x * delta.x + delta.y * delta.y);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr static float get_vector_height_coordinate(const Vector3<float>& vec) noexcept
|
||||
{
|
||||
return vec.z;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static Vector3<float> calc_viewpoint_from_angles(const projectile_prediction::Projectile& projectile,
|
||||
Vector3<float> predicted_target_position,
|
||||
const std::optional<float> projectile_pitch) noexcept
|
||||
{
|
||||
const auto delta2d = calc_vector_2d_distance(predicted_target_position - projectile.m_origin);
|
||||
const auto height = delta2d * std::tan(angles::degrees_to_radians(projectile_pitch.value()));
|
||||
|
||||
return {predicted_target_position.x, predicted_target_position.y, projectile.m_origin.z + height};
|
||||
}
|
||||
// Due to specification of maybe_calculate_projectile_launch_pitch_angle, pitch angle must be:
|
||||
// 89 look up, -89 look down
|
||||
[[nodiscard]]
|
||||
static float calc_direct_pitch_angle(const Vector3<float>& origin, const Vector3<float>& view_to) noexcept
|
||||
{
|
||||
const auto distance = origin.distance_to(view_to);
|
||||
const auto delta = view_to - origin;
|
||||
|
||||
return angles::radians_to_degrees(std::asin(delta.z / distance));
|
||||
}
|
||||
[[nodiscard]]
|
||||
static float calc_direct_yaw_angle(const Vector3<float>& origin, const Vector3<float>& view_to) noexcept
|
||||
{
|
||||
const auto delta = view_to - origin;
|
||||
|
||||
return angles::radians_to_degrees(std::atan2(delta.y, delta.x));
|
||||
};
|
||||
};
|
||||
} // namespace omath::source_engine
|
||||
13
include/omath/engines/unity_engine/camera.hpp
Normal file
13
include/omath/engines/unity_engine/camera.hpp
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// Created by Vlad on 3/22/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/engines/unity_engine/constants.hpp"
|
||||
#include "omath/projection/camera.hpp"
|
||||
#include "traits/camera_trait.hpp"
|
||||
|
||||
namespace omath::unity_engine
|
||||
{
|
||||
using Camera = projection::Camera<Mat4X4, ViewAngles, CameraTrait>;
|
||||
} // namespace omath::unity_engine
|
||||
26
include/omath/engines/unity_engine/constants.hpp
Normal file
26
include/omath/engines/unity_engine/constants.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Created by Vlad on 3/22/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <omath/angle.hpp>
|
||||
#include <omath/mat.hpp>
|
||||
#include <omath/vector3.hpp>
|
||||
#include <omath/view_angles.hpp>
|
||||
|
||||
namespace omath::unity_engine
|
||||
{
|
||||
constexpr Vector3<float> k_abs_up = {0, 1, 0};
|
||||
constexpr Vector3<float> k_abs_right = {1, 0, 0};
|
||||
constexpr Vector3<float> k_abs_forward = {0, 0, 1};
|
||||
|
||||
using Mat4X4 = Mat<4, 4, float, MatStoreType::ROW_MAJOR>;
|
||||
using Mat3X3 = Mat<4, 4, float, MatStoreType::ROW_MAJOR>;
|
||||
using Mat1X3 = Mat<1, 3, float, MatStoreType::ROW_MAJOR>;
|
||||
using PitchAngle = Angle<float, -90.f, 90.f, AngleFlags::Clamped>;
|
||||
using YawAngle = Angle<float, -180.f, 180.f, AngleFlags::Normalized>;
|
||||
using RollAngle = Angle<float, -180.f, 180.f, AngleFlags::Normalized>;
|
||||
|
||||
using ViewAngles = omath::ViewAngles<PitchAngle, YawAngle, RollAngle>;
|
||||
} // namespace omath::unity_engine
|
||||
26
include/omath/engines/unity_engine/formulas.hpp
Normal file
26
include/omath/engines/unity_engine/formulas.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Created by Vlad on 3/22/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/engines/unity_engine/constants.hpp"
|
||||
|
||||
namespace omath::unity_engine
|
||||
{
|
||||
[[nodiscard]]
|
||||
Vector3<float> forward_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3<float> right_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3<float> up_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]] Mat4X4 calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Mat4X4 rotation_matrix(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Mat4X4 calc_perspective_projection_matrix(float field_of_view, float aspect_ratio, float near, float far) noexcept;
|
||||
} // namespace omath::unity_engine
|
||||
24
include/omath/engines/unity_engine/traits/camera_trait.hpp
Normal file
24
include/omath/engines/unity_engine/traits/camera_trait.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Created by Vlad on 8/10/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/engines/unity_engine/formulas.hpp"
|
||||
#include "omath/projection/camera.hpp"
|
||||
|
||||
namespace omath::unity_engine
|
||||
{
|
||||
class CameraTrait final
|
||||
{
|
||||
public:
|
||||
[[nodiscard]]
|
||||
static ViewAngles calc_look_at_angle(const Vector3<float>& cam_origin, const Vector3<float>& look_at) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
static Mat4X4 calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept;
|
||||
[[nodiscard]]
|
||||
static Mat4X4 calc_projection_matrix(const projection::FieldOfView& fov, const projection::ViewPort& view_port,
|
||||
float near, float far) noexcept;
|
||||
};
|
||||
|
||||
} // namespace omath::unity_engine
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// Created by Vlad on 8/6/2025.
|
||||
//
|
||||
#pragma once
|
||||
#include "omath/engines/unity_engine/formulas.hpp"
|
||||
#include "omath/projectile_prediction/projectile.hpp"
|
||||
#include "omath/projectile_prediction/target.hpp"
|
||||
#include <optional>
|
||||
|
||||
namespace omath::unity_engine
|
||||
{
|
||||
class PredEngineTrait final
|
||||
{
|
||||
public:
|
||||
constexpr static Vector3<float> predict_projectile_position(const projectile_prediction::Projectile& projectile,
|
||||
const float pitch, const float yaw,
|
||||
const float time, const float gravity) noexcept
|
||||
{
|
||||
auto current_pos = projectile.m_origin
|
||||
+ forward_vector({PitchAngle::from_degrees(-pitch), YawAngle::from_degrees(yaw),
|
||||
RollAngle::from_degrees(0)})
|
||||
* projectile.m_launch_speed * time;
|
||||
current_pos.y -= (gravity * projectile.m_gravity_scale) * (time * time) * 0.5f;
|
||||
|
||||
return current_pos;
|
||||
}
|
||||
[[nodiscard]]
|
||||
static constexpr Vector3<float> predict_target_position(const projectile_prediction::Target& target,
|
||||
const float time, const float gravity) noexcept
|
||||
{
|
||||
auto predicted = target.m_origin + target.m_velocity * time;
|
||||
|
||||
if (target.m_is_airborne)
|
||||
predicted.y -= gravity * (time * time) * 0.5f;
|
||||
|
||||
return predicted;
|
||||
}
|
||||
[[nodiscard]]
|
||||
static float calc_vector_2d_distance(const Vector3<float>& delta) noexcept
|
||||
{
|
||||
return std::sqrt(delta.x * delta.x + delta.z * delta.z);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr static float get_vector_height_coordinate(const Vector3<float>& vec) noexcept
|
||||
{
|
||||
return vec.y;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static Vector3<float> calc_viewpoint_from_angles(const projectile_prediction::Projectile& projectile,
|
||||
Vector3<float> predicted_target_position,
|
||||
const std::optional<float> projectile_pitch) noexcept
|
||||
{
|
||||
const auto delta2d = calc_vector_2d_distance(predicted_target_position - projectile.m_origin);
|
||||
const auto height = delta2d * std::tan(angles::degrees_to_radians(projectile_pitch.value()));
|
||||
|
||||
return {predicted_target_position.x, predicted_target_position.y + height, projectile.m_origin.z};
|
||||
}
|
||||
// Due to specification of maybe_calculate_projectile_launch_pitch_angle, pitch angle must be:
|
||||
// 89 look up, -89 look down
|
||||
[[nodiscard]]
|
||||
static float calc_direct_pitch_angle(const Vector3<float>& origin, const Vector3<float>& view_to) noexcept
|
||||
{
|
||||
const auto distance = origin.distance_to(view_to);
|
||||
const auto delta = view_to - origin;
|
||||
|
||||
return angles::radians_to_degrees(std::asin(delta.y / distance));
|
||||
}
|
||||
[[nodiscard]]
|
||||
static float calc_direct_yaw_angle(const Vector3<float>& origin, const Vector3<float>& view_to) noexcept
|
||||
{
|
||||
const auto delta = view_to - origin;
|
||||
|
||||
return angles::radians_to_degrees(std::atan2(delta.z, delta.x));
|
||||
};
|
||||
};
|
||||
} // namespace omath::unity_engine
|
||||
13
include/omath/engines/unreal_engine/camera.hpp
Normal file
13
include/omath/engines/unreal_engine/camera.hpp
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// Created by Vlad on 3/22/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/engines/unreal_engine/constants.hpp"
|
||||
#include "omath/projection/camera.hpp"
|
||||
#include "traits/camera_trait.hpp"
|
||||
|
||||
namespace omath::unreal_engine
|
||||
{
|
||||
using Camera = projection::Camera<Mat4X4, ViewAngles, CameraTrait>;
|
||||
} // namespace omath::unreal_engine
|
||||
26
include/omath/engines/unreal_engine/constants.hpp
Normal file
26
include/omath/engines/unreal_engine/constants.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Created by Vlad on 3/22/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <omath/angle.hpp>
|
||||
#include <omath/mat.hpp>
|
||||
#include <omath/vector3.hpp>
|
||||
#include <omath/view_angles.hpp>
|
||||
|
||||
namespace omath::unreal_engine
|
||||
{
|
||||
constexpr Vector3<float> k_abs_up = {0, 0, 1};
|
||||
constexpr Vector3<float> k_abs_right = {0, 1, 0};
|
||||
constexpr Vector3<float> k_abs_forward = {1, 0, 0};
|
||||
|
||||
using Mat4X4 = Mat<4, 4, float, MatStoreType::ROW_MAJOR>;
|
||||
using Mat3X3 = Mat<4, 4, float, MatStoreType::ROW_MAJOR>;
|
||||
using Mat1X3 = Mat<1, 3, float, MatStoreType::ROW_MAJOR>;
|
||||
using PitchAngle = Angle<float, -90.f, 90.f, AngleFlags::Clamped>;
|
||||
using YawAngle = Angle<float, -180.f, 180.f, AngleFlags::Normalized>;
|
||||
using RollAngle = Angle<float, -180.f, 180.f, AngleFlags::Normalized>;
|
||||
|
||||
using ViewAngles = omath::ViewAngles<PitchAngle, YawAngle, RollAngle>;
|
||||
} // namespace omath::unreal_engine
|
||||
26
include/omath/engines/unreal_engine/formulas.hpp
Normal file
26
include/omath/engines/unreal_engine/formulas.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Created by Vlad on 3/22/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/engines/unreal_engine/constants.hpp"
|
||||
|
||||
namespace omath::unreal_engine
|
||||
{
|
||||
[[nodiscard]]
|
||||
Vector3<float> forward_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3<float> right_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3<float> up_vector(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]] Mat4X4 calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Mat4X4 rotation_matrix(const ViewAngles& angles) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Mat4X4 calc_perspective_projection_matrix(float field_of_view, float aspect_ratio, float near, float far) noexcept;
|
||||
} // namespace omath::unreal_engine
|
||||
24
include/omath/engines/unreal_engine/traits/camera_trait.hpp
Normal file
24
include/omath/engines/unreal_engine/traits/camera_trait.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Created by Vlad on 8/10/2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/engines/unreal_engine/formulas.hpp"
|
||||
#include "omath/projection/camera.hpp"
|
||||
|
||||
namespace omath::unreal_engine
|
||||
{
|
||||
class CameraTrait final
|
||||
{
|
||||
public:
|
||||
[[nodiscard]]
|
||||
static ViewAngles calc_look_at_angle(const Vector3<float>& cam_origin, const Vector3<float>& look_at) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
static Mat4X4 calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept;
|
||||
[[nodiscard]]
|
||||
static Mat4X4 calc_projection_matrix(const projection::FieldOfView& fov, const projection::ViewPort& view_port,
|
||||
float near, float far) noexcept;
|
||||
};
|
||||
|
||||
} // namespace omath::unreal_engine
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// Created by Vlad on 8/6/2025.
|
||||
//
|
||||
#pragma once
|
||||
#include "omath/engines/unreal_engine/formulas.hpp"
|
||||
#include "omath/projectile_prediction/projectile.hpp"
|
||||
#include "omath/projectile_prediction/target.hpp"
|
||||
#include <optional>
|
||||
|
||||
namespace omath::unreal_engine
|
||||
{
|
||||
class PredEngineTrait final
|
||||
{
|
||||
public:
|
||||
constexpr static Vector3<float> predict_projectile_position(const projectile_prediction::Projectile& projectile,
|
||||
const float pitch, const float yaw,
|
||||
const float time, const float gravity) noexcept
|
||||
{
|
||||
auto current_pos = projectile.m_origin
|
||||
+ forward_vector({PitchAngle::from_degrees(-pitch), YawAngle::from_degrees(yaw),
|
||||
RollAngle::from_degrees(0)})
|
||||
* projectile.m_launch_speed * time;
|
||||
current_pos.y -= (gravity * projectile.m_gravity_scale) * (time * time) * 0.5f;
|
||||
|
||||
return current_pos;
|
||||
}
|
||||
[[nodiscard]]
|
||||
static constexpr Vector3<float> predict_target_position(const projectile_prediction::Target& target,
|
||||
const float time, const float gravity) noexcept
|
||||
{
|
||||
auto predicted = target.m_origin + target.m_velocity * time;
|
||||
|
||||
if (target.m_is_airborne)
|
||||
predicted.y -= gravity * (time * time) * 0.5f;
|
||||
|
||||
return predicted;
|
||||
}
|
||||
[[nodiscard]]
|
||||
static float calc_vector_2d_distance(const Vector3<float>& delta) noexcept
|
||||
{
|
||||
return std::sqrt(delta.x * delta.x + delta.z * delta.z);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr static float get_vector_height_coordinate(const Vector3<float>& vec) noexcept
|
||||
{
|
||||
return vec.y;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static Vector3<float> calc_viewpoint_from_angles(const projectile_prediction::Projectile& projectile,
|
||||
Vector3<float> predicted_target_position,
|
||||
const std::optional<float> projectile_pitch) noexcept
|
||||
{
|
||||
const auto delta2d = calc_vector_2d_distance(predicted_target_position - projectile.m_origin);
|
||||
const auto height = delta2d * std::tan(angles::degrees_to_radians(projectile_pitch.value()));
|
||||
|
||||
return {predicted_target_position.x, predicted_target_position.y, projectile.m_origin.z + height};
|
||||
}
|
||||
// Due to specification of maybe_calculate_projectile_launch_pitch_angle, pitch angle must be:
|
||||
// 89 look up, -89 look down
|
||||
[[nodiscard]]
|
||||
static float calc_direct_pitch_angle(const Vector3<float>& origin, const Vector3<float>& view_to) noexcept
|
||||
{
|
||||
const auto distance = origin.distance_to(view_to);
|
||||
const auto delta = view_to - origin;
|
||||
|
||||
return angles::radians_to_degrees(std::asin(delta.z / distance));
|
||||
}
|
||||
[[nodiscard]]
|
||||
static float calc_direct_yaw_angle(const Vector3<float>& origin, const Vector3<float>& view_to) noexcept
|
||||
{
|
||||
const auto delta = view_to - origin;
|
||||
|
||||
return angles::radians_to_degrees(std::atan2(delta.y, delta.x));
|
||||
};
|
||||
};
|
||||
} // namespace omath::unreal_engine
|
||||
498
include/omath/mat.hpp
Normal file
498
include/omath/mat.hpp
Normal file
@@ -0,0 +1,498 @@
|
||||
//
|
||||
// Created by vlad on 9/29/2024.
|
||||
//
|
||||
#pragma once
|
||||
#include "omath/vector3.hpp"
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <iomanip>
|
||||
#include <numeric>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
|
||||
#ifdef near
|
||||
#undef near
|
||||
#endif
|
||||
|
||||
#ifdef far
|
||||
#undef far
|
||||
#endif
|
||||
|
||||
namespace omath
|
||||
{
|
||||
struct MatSize
|
||||
{
|
||||
size_t rows, columns;
|
||||
};
|
||||
|
||||
enum class MatStoreType : uint8_t
|
||||
{
|
||||
ROW_MAJOR = 0,
|
||||
COLUMN_MAJOR
|
||||
};
|
||||
|
||||
template<typename M1, typename M2> concept MatTemplateEqual
|
||||
= (M1::rows == M2::rows) && (M1::columns == M2::columns)
|
||||
&& std::is_same_v<typename M1::value_type, typename M2::value_type> && (M1::store_type == M2::store_type);
|
||||
|
||||
template<size_t Rows = 0, size_t Columns = 0, class Type = float, MatStoreType StoreType = MatStoreType::ROW_MAJOR>
|
||||
requires std::is_arithmetic_v<Type>
|
||||
class Mat final
|
||||
{
|
||||
public:
|
||||
constexpr Mat() noexcept
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr static MatStoreType get_store_ordering() noexcept
|
||||
{
|
||||
return StoreType;
|
||||
}
|
||||
constexpr Mat(const std::initializer_list<std::initializer_list<Type>>& rows)
|
||||
{
|
||||
if (rows.size() != Rows)
|
||||
throw std::invalid_argument("Initializer list rows size does not match template parameter Rows");
|
||||
|
||||
auto row_it = rows.begin();
|
||||
for (size_t i = 0; i < Rows; ++i, ++row_it)
|
||||
{
|
||||
if (row_it->size() != Columns)
|
||||
throw std::invalid_argument(
|
||||
"All rows must have the same number of columns as template parameter Columns");
|
||||
|
||||
auto col_it = row_it->begin();
|
||||
for (size_t j = 0; j < Columns; ++j, ++col_it)
|
||||
{
|
||||
at(i, j) = std::move(*col_it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
constexpr explicit Mat(const Type* raw_data)
|
||||
{
|
||||
std::copy_n(raw_data, Rows * Columns, m_data.begin());
|
||||
}
|
||||
|
||||
constexpr Mat(const Mat& other) noexcept
|
||||
{
|
||||
m_data = other.m_data;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Type& operator[](const size_t row, const size_t col)
|
||||
{
|
||||
return at(row, col);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Type& operator[](const size_t row, const size_t col) const
|
||||
{
|
||||
return at(row, col);
|
||||
}
|
||||
|
||||
constexpr Mat(Mat&& other) noexcept
|
||||
{
|
||||
m_data = std::move(other.m_data);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static constexpr size_t row_count() noexcept
|
||||
{
|
||||
return Rows;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static constexpr size_t columns_count() noexcept
|
||||
{
|
||||
return Columns;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static consteval MatSize size() noexcept
|
||||
{
|
||||
return {Rows, Columns};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr const Type& at(const size_t row_index, const size_t column_index) const
|
||||
{
|
||||
#if !defined(NDEBUG) && defined(OMATH_SUPRESS_SAFETY_CHECKS)
|
||||
if (row_index >= Rows || column_index >= Columns)
|
||||
throw std::out_of_range("Index out of range");
|
||||
#endif
|
||||
if constexpr (StoreType == MatStoreType::ROW_MAJOR)
|
||||
return m_data[row_index * Columns + column_index];
|
||||
|
||||
else if constexpr (StoreType == MatStoreType::COLUMN_MAJOR)
|
||||
return m_data[row_index + column_index * Rows];
|
||||
|
||||
else
|
||||
{
|
||||
static_assert(false, "Invalid matrix access convention");
|
||||
std::unreachable();
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Type& at(const size_t row_index, const size_t column_index)
|
||||
{
|
||||
return const_cast<Type&>(std::as_const(*this).at(row_index, column_index));
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Type sum() const noexcept
|
||||
{
|
||||
return std::accumulate(m_data.begin(), m_data.end(), static_cast<Type>(0));
|
||||
}
|
||||
|
||||
constexpr void clear() noexcept
|
||||
{
|
||||
set(static_cast<Type>(0));
|
||||
}
|
||||
|
||||
constexpr void set(const Type& value) noexcept
|
||||
{
|
||||
std::ranges::fill(m_data, value);
|
||||
}
|
||||
|
||||
// Operator overloading for multiplication with another Mat
|
||||
template<size_t OtherColumns> [[nodiscard]]
|
||||
constexpr Mat<Rows, OtherColumns, Type, StoreType>
|
||||
operator*(const Mat<Columns, OtherColumns, Type, StoreType>& other) const
|
||||
{
|
||||
Mat<Rows, OtherColumns, Type, StoreType> result;
|
||||
|
||||
for (size_t i = 0; i < Rows; ++i)
|
||||
for (size_t j = 0; j < OtherColumns; ++j)
|
||||
{
|
||||
Type sum = 0;
|
||||
for (size_t k = 0; k < Columns; ++k)
|
||||
sum += at(i, k) * other.at(k, j);
|
||||
result.at(i, j) = sum;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
constexpr Mat& operator*=(const Type& f) noexcept
|
||||
{
|
||||
std::ranges::for_each(m_data, [&f](auto& val) { val *= f; });
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<size_t OtherColumns> constexpr Mat<Rows, OtherColumns, Type, StoreType>
|
||||
operator*=(const Mat<Columns, OtherColumns, Type, StoreType>& other)
|
||||
{
|
||||
return *this = *this * other;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Mat operator*(const Type& value) const noexcept
|
||||
{
|
||||
Mat result(*this);
|
||||
result *= value;
|
||||
return result;
|
||||
}
|
||||
|
||||
constexpr Mat& operator/=(const Type& value) noexcept
|
||||
{
|
||||
std::ranges::for_each(m_data, [&value](auto& val) { val /= value; });
|
||||
return *this;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Mat operator/(const Type& value) const noexcept
|
||||
{
|
||||
Mat result(*this);
|
||||
result /= value;
|
||||
return result;
|
||||
}
|
||||
|
||||
constexpr Mat& operator=(const Mat& other) noexcept
|
||||
{
|
||||
if (this != &other)
|
||||
m_data = other.m_data;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Mat& operator=(Mat&& other) noexcept
|
||||
{
|
||||
if (this != &other)
|
||||
m_data = std::move(other.m_data);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Mat<Columns, Rows, Type, StoreType> transposed() const noexcept
|
||||
{
|
||||
Mat<Columns, Rows, Type, StoreType> transposed;
|
||||
for (size_t i = 0; i < Rows; ++i)
|
||||
for (size_t j = 0; j < Columns; ++j)
|
||||
transposed.at(j, i) = at(i, j);
|
||||
|
||||
return transposed;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Type determinant() const
|
||||
{
|
||||
static_assert(Rows == Columns, "Determinant is only defined for square matrices.");
|
||||
|
||||
if constexpr (Rows == 1)
|
||||
return at(0, 0);
|
||||
|
||||
if constexpr (Rows == 2)
|
||||
return at(0, 0) * at(1, 1) - at(0, 1) * at(1, 0);
|
||||
|
||||
if constexpr (Rows > 2)
|
||||
{
|
||||
Type det = 0;
|
||||
for (size_t column = 0; column < Columns; ++column)
|
||||
{
|
||||
const Type cofactor = at(0, column) * alg_complement(0, column);
|
||||
det += cofactor;
|
||||
}
|
||||
return det;
|
||||
}
|
||||
std::unreachable();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Mat<Rows - 1, Columns - 1, Type, StoreType> strip(const size_t row, const size_t column) const
|
||||
{
|
||||
static_assert(Rows - 1 > 0 && Columns - 1 > 0);
|
||||
Mat<Rows - 1, Columns - 1, Type, StoreType> result;
|
||||
for (size_t i = 0, m = 0; i < Rows; ++i)
|
||||
{
|
||||
if (i == row)
|
||||
continue;
|
||||
for (size_t j = 0, n = 0; j < Columns; ++j)
|
||||
{
|
||||
if (j == column)
|
||||
continue;
|
||||
result.at(m, n) = at(i, j);
|
||||
++n;
|
||||
}
|
||||
++m;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Type minor(const size_t row, const size_t column) const
|
||||
{
|
||||
return strip(row, column).determinant();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Type alg_complement(const size_t row, const size_t column) const
|
||||
{
|
||||
const auto minor_value = minor(row, column);
|
||||
return (row + column + 2) % 2 == 0 ? minor_value : -minor_value;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr const std::array<Type, Rows * Columns>& raw_array() const
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr std::array<Type, Rows * Columns>& raw_array()
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
std::string to_string() const noexcept
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "[[";
|
||||
|
||||
for (size_t i = 0; i < Rows; ++i)
|
||||
{
|
||||
if (i > 0)
|
||||
oss << " [";
|
||||
|
||||
for (size_t j = 0; j < Columns; ++j)
|
||||
{
|
||||
oss << std::setw(9) << std::fixed << std::setprecision(3) << at(i, j);
|
||||
if (j != Columns - 1)
|
||||
oss << ", ";
|
||||
}
|
||||
oss << (i == Rows - 1 ? "]]" : "]\n");
|
||||
}
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
bool operator==(const Mat& mat) const
|
||||
{
|
||||
return m_data == mat.m_data;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
bool operator!=(const Mat& mat) const
|
||||
{
|
||||
return !operator==(mat);
|
||||
}
|
||||
|
||||
// Static methods that return fixed-size matrices
|
||||
[[nodiscard]]
|
||||
constexpr static Mat<4, 4> to_screen_mat(const Type& screen_width, const Type& screen_height) noexcept
|
||||
{
|
||||
return {
|
||||
{screen_width / 2, 0, 0, 0},
|
||||
{0, -screen_height / 2, 0, 0},
|
||||
{0, 0, 1, 0},
|
||||
{screen_width / 2, screen_height / 2, 0, 1},
|
||||
};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr std::optional<Mat> inverted() const
|
||||
{
|
||||
const auto det = determinant();
|
||||
|
||||
if (det == 0)
|
||||
return std::nullopt;
|
||||
|
||||
const auto transposed_mat = transposed();
|
||||
Mat result;
|
||||
|
||||
for (std::size_t row = 0; row < Rows; row++)
|
||||
for (std::size_t column = 0; column < Rows; column++)
|
||||
result.at(row, column) = transposed_mat.alg_complement(row, column);
|
||||
|
||||
result /= det;
|
||||
|
||||
return {result};
|
||||
}
|
||||
|
||||
private:
|
||||
std::array<Type, Rows * Columns> m_data;
|
||||
};
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR> [[nodiscard]]
|
||||
constexpr static Mat<1, 4, Type, St> mat_row_from_vector(const Vector3<Type>& vector) noexcept
|
||||
{
|
||||
return {{vector.x, vector.y, vector.z, 1}};
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR> [[nodiscard]]
|
||||
constexpr static Mat<4, 1, Type, St> mat_column_from_vector(const Vector3<Type>& vector) noexcept
|
||||
{
|
||||
return {{vector.x}, {vector.y}, {vector.z}, {1}};
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR>
|
||||
[[nodiscard]]
|
||||
constexpr Mat<4, 4, Type, St> mat_translation(const Vector3<Type>& diff) noexcept
|
||||
{
|
||||
return
|
||||
{
|
||||
{1, 0, 0, diff.x},
|
||||
{0, 1, 0, diff.y},
|
||||
{0, 0, 1, diff.z},
|
||||
{0, 0, 0, 1},
|
||||
};
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR, class Angle>
|
||||
[[nodiscard]]
|
||||
Mat<4, 4, Type, St> mat_rotation_axis_x(const Angle& angle) noexcept
|
||||
{
|
||||
return
|
||||
{
|
||||
{1, 0, 0, 0},
|
||||
{0, angle.cos(), -angle.sin(), 0},
|
||||
{0, angle.sin(), angle.cos(), 0},
|
||||
{0, 0, 0, 1}
|
||||
};
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR, class Angle>
|
||||
[[nodiscard]]
|
||||
Mat<4, 4, Type, St> mat_rotation_axis_y(const Angle& angle) noexcept
|
||||
{
|
||||
return
|
||||
{
|
||||
{angle.cos(), 0, angle.sin(), 0},
|
||||
{0 , 1, 0, 0},
|
||||
{-angle.sin(), 0, angle.cos(), 0},
|
||||
{0 , 0, 0, 1}
|
||||
};
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR, class Angle>
|
||||
[[nodiscard]]
|
||||
Mat<4, 4, Type, St> mat_rotation_axis_z(const Angle& angle) noexcept
|
||||
{
|
||||
return
|
||||
{
|
||||
{angle.cos(), -angle.sin(), 0, 0},
|
||||
{angle.sin(), angle.cos(), 0, 0},
|
||||
{ 0, 0, 1, 0},
|
||||
{ 0, 0, 0, 1},
|
||||
};
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR>
|
||||
[[nodiscard]]
|
||||
static Mat<4, 4, Type, St> mat_camera_view(const Vector3<Type>& forward, const Vector3<Type>& right,
|
||||
const Vector3<Type>& up, const Vector3<Type>& camera_origin) noexcept
|
||||
{
|
||||
return Mat<4, 4, Type, St>
|
||||
{
|
||||
{right.x, right.y, right.z, 0},
|
||||
{up.x, up.y, up.z, 0},
|
||||
{forward.x, forward.y, forward.z, 0},
|
||||
{0, 0, 0, 1},
|
||||
} * mat_translation<Type, St>(-camera_origin);
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR>
|
||||
[[nodiscard]]
|
||||
Mat<4, 4, Type, St> mat_perspective_left_handed(const float field_of_view, const float aspect_ratio,
|
||||
const float near, const float far) noexcept
|
||||
{
|
||||
const float fov_half_tan = std::tan(angles::degrees_to_radians(field_of_view) / 2.f);
|
||||
|
||||
return {{1.f / (aspect_ratio * fov_half_tan), 0.f, 0.f, 0.f},
|
||||
{0.f, 1.f / fov_half_tan, 0.f, 0.f},
|
||||
{0.f, 0.f, (far + near) / (far - near), -(2.f * near * far) / (far - near)},
|
||||
{0.f, 0.f, 1.f, 0.f}};
|
||||
}
|
||||
|
||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR>
|
||||
[[nodiscard]]
|
||||
Mat<4, 4, Type, St> mat_perspective_right_handed(const float field_of_view, const float aspect_ratio,
|
||||
const float near, const float far) noexcept
|
||||
{
|
||||
const float fov_half_tan = std::tan(angles::degrees_to_radians(field_of_view) / 2.f);
|
||||
|
||||
return {{1.f / (aspect_ratio * fov_half_tan), 0.f, 0.f, 0.f},
|
||||
{0.f, 1.f / fov_half_tan, 0.f, 0.f},
|
||||
{0.f, 0.f, -(far + near) / (far - near), -(2.f * near * far) / (far - near)},
|
||||
{0.f, 0.f, -1.f, 0.f}};
|
||||
}
|
||||
} // namespace omath
|
||||
|
||||
template<size_t Rows, size_t Columns, class Type, omath::MatStoreType StoreType>
|
||||
struct std::formatter<omath::Mat<Rows, Columns, Type, StoreType>> // NOLINT(*-dcl58-cpp)
|
||||
{
|
||||
using MatType = omath::Mat<Rows, Columns, Type, StoreType>;
|
||||
[[nodiscard]]
|
||||
static constexpr auto parse(std::format_parse_context& ctx)
|
||||
{
|
||||
return ctx.begin();
|
||||
}
|
||||
[[nodiscard]]
|
||||
static auto format(const MatType& mat, std::format_context& ctx)
|
||||
{
|
||||
return std::format_to(ctx.out(), "{}", mat.to_string());
|
||||
}
|
||||
};
|
||||
112
include/omath/matrix.hpp
Normal file
112
include/omath/matrix.hpp
Normal file
@@ -0,0 +1,112 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef OMATH_ENABLE_LEGACY
|
||||
|
||||
#include "omath/vector3.hpp"
|
||||
#include <initializer_list>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace omath
|
||||
{
|
||||
|
||||
class Matrix final
|
||||
{
|
||||
public:
|
||||
Matrix();
|
||||
Matrix(size_t rows, size_t columns);
|
||||
|
||||
Matrix(const std::initializer_list<std::initializer_list<float>>& rows);
|
||||
|
||||
[[nodiscard]]
|
||||
static Matrix to_screen_matrix(float screen_width, float screen_height);
|
||||
|
||||
[[nodiscard]]
|
||||
static Matrix translation_matrix(const Vector3<float>& diff);
|
||||
|
||||
[[nodiscard]]
|
||||
static Matrix orientation_matrix(const Vector3<float>& forward, const Vector3<float>& right,
|
||||
const Vector3<float>& up);
|
||||
|
||||
[[nodiscard]]
|
||||
static Matrix projection_matrix(float field_of_view, float aspect_ratio, float near, float far);
|
||||
|
||||
Matrix(const Matrix& other);
|
||||
|
||||
Matrix(size_t rows, size_t columns, const float* raw_data);
|
||||
|
||||
Matrix(Matrix&& other) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
size_t row_count() const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
float& operator[](size_t row, size_t column);
|
||||
|
||||
[[nodiscard]]
|
||||
size_t columns_count() const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
std::pair<size_t, size_t> size() const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
float& at(size_t row, size_t col);
|
||||
|
||||
[[nodiscard]]
|
||||
float sum();
|
||||
|
||||
void set_data_from_raw(const float* raw_matrix);
|
||||
|
||||
[[nodiscard]]
|
||||
Matrix transpose() const;
|
||||
|
||||
void set(float val);
|
||||
|
||||
[[nodiscard]]
|
||||
const float& at(size_t row, size_t col) const;
|
||||
|
||||
Matrix operator*(const Matrix& other) const;
|
||||
|
||||
Matrix& operator*=(const Matrix& other);
|
||||
|
||||
Matrix operator*(float f) const;
|
||||
|
||||
Matrix& operator*=(float f);
|
||||
|
||||
Matrix& operator/=(float f);
|
||||
|
||||
void clear();
|
||||
|
||||
[[nodiscard]]
|
||||
Matrix strip(size_t row, size_t column) const;
|
||||
|
||||
[[nodiscard]]
|
||||
float minor(size_t i, size_t j) const;
|
||||
|
||||
[[nodiscard]]
|
||||
float alg_complement(size_t i, size_t j) const;
|
||||
|
||||
[[nodiscard]]
|
||||
float determinant() const;
|
||||
|
||||
[[nodiscard]]
|
||||
const float* raw() const;
|
||||
|
||||
Matrix& operator=(const Matrix& other);
|
||||
|
||||
Matrix& operator=(Matrix&& other) noexcept;
|
||||
|
||||
Matrix operator/(float f) const;
|
||||
|
||||
[[nodiscard]]
|
||||
std::string to_string() const;
|
||||
|
||||
~Matrix();
|
||||
|
||||
private:
|
||||
size_t m_rows;
|
||||
size_t m_columns;
|
||||
std::unique_ptr<float[]> m_data;
|
||||
};
|
||||
} // namespace omath
|
||||
#endif
|
||||
84
include/omath/omath.hpp
Normal file
84
include/omath/omath.hpp
Normal file
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// omath.hpp - Main header file that includes all omath library components
|
||||
// Created for the omath library
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
// Basic math utilities
|
||||
#include "omath/angles.hpp"
|
||||
#include "omath/angle.hpp"
|
||||
|
||||
// Vector classes (in dependency order)
|
||||
#include "omath/vector2.hpp"
|
||||
#include "omath/vector3.hpp"
|
||||
#include "omath/vector4.hpp"
|
||||
|
||||
// Matrix classes
|
||||
#include "omath/mat.hpp"
|
||||
#include "omath/matrix.hpp"
|
||||
|
||||
// Color functionality
|
||||
#include "omath/color.hpp"
|
||||
|
||||
// Geometric primitives
|
||||
#include "omath/triangle.hpp"
|
||||
#include "omath/view_angles.hpp"
|
||||
|
||||
// 3D primitives
|
||||
#include "omath/3d_primitives/box.hpp"
|
||||
|
||||
// Collision detection
|
||||
#include "omath/collision/line_tracer.hpp"
|
||||
|
||||
// Pathfinding algorithms
|
||||
#include "omath/pathfinding/a_star.hpp"
|
||||
#include "omath/pathfinding/navigation_mesh.hpp"
|
||||
|
||||
// Projectile prediction
|
||||
#include "omath/projectile_prediction/projectile.hpp"
|
||||
#include "omath/projectile_prediction/target.hpp"
|
||||
#include "omath/projectile_prediction/proj_pred_engine.hpp"
|
||||
#include "omath/projectile_prediction/proj_pred_engine_legacy.hpp"
|
||||
#include "omath/projectile_prediction/proj_pred_engine_avx2.hpp"
|
||||
|
||||
// Projection functionality
|
||||
#include "omath/projection/error_codes.hpp"
|
||||
#include "omath/projection/camera.hpp"
|
||||
|
||||
// Engine-specific implementations
|
||||
|
||||
// IW Engine
|
||||
#include "omath/engines/iw_engine/constants.hpp"
|
||||
#include "omath/engines/iw_engine/formulas.hpp"
|
||||
#include "omath/engines/iw_engine/camera.hpp"
|
||||
#include "omath/engines/iw_engine/traits/camera_trait.hpp"
|
||||
#include "omath/engines/iw_engine/traits/pred_engine_trait.hpp"
|
||||
|
||||
// OpenGL Engine
|
||||
#include "omath/engines/opengl_engine/constants.hpp"
|
||||
#include "omath/engines/opengl_engine/formulas.hpp"
|
||||
#include "omath/engines/opengl_engine/camera.hpp"
|
||||
#include "omath/engines/opengl_engine/traits/camera_trait.hpp"
|
||||
#include "omath/engines/opengl_engine/traits/pred_engine_trait.hpp"
|
||||
|
||||
// Source Engine
|
||||
#include "omath/engines/source_engine/constants.hpp"
|
||||
#include "omath/engines/source_engine/formulas.hpp"
|
||||
#include "omath/engines/source_engine/camera.hpp"
|
||||
#include "omath/engines/source_engine/traits/camera_trait.hpp"
|
||||
#include "omath/engines/source_engine/traits/pred_engine_trait.hpp"
|
||||
|
||||
// Unity Engine
|
||||
#include "omath/engines/unity_engine/constants.hpp"
|
||||
#include "omath/engines/unity_engine/formulas.hpp"
|
||||
#include "omath/engines/unity_engine/camera.hpp"
|
||||
#include "omath/engines/unity_engine/traits/camera_trait.hpp"
|
||||
#include "omath/engines/unity_engine/traits/pred_engine_trait.hpp"
|
||||
|
||||
// Unreal Engine
|
||||
#include "omath/engines/unreal_engine/constants.hpp"
|
||||
#include "omath/engines/unreal_engine/formulas.hpp"
|
||||
#include "omath/engines/unreal_engine/camera.hpp"
|
||||
#include "omath/engines/unreal_engine/traits/camera_trait.hpp"
|
||||
#include "omath/engines/unreal_engine/traits/pred_engine_trait.hpp"
|
||||
@@ -1,24 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
/* Export prefix for functions */
|
||||
#ifdef _MSC_VER
|
||||
/* MSVC */
|
||||
# define OMATH_API_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
/* GCC/Clang */
|
||||
# define OMATH_API_EXPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
|
||||
/* Import prefix for functions */
|
||||
#ifdef _MSC_VER
|
||||
# define OMATH_API_IMPORT __declspec(dllimport)
|
||||
#else
|
||||
# define OMATH_API_IMPORT extern
|
||||
#endif
|
||||
|
||||
/* Resolve import/export */
|
||||
#ifdef OMATH_EXPORT
|
||||
# define OMATH_API OMATH_API_EXPORT
|
||||
#else
|
||||
# define OMATH_API OMATH_API_IMPORT
|
||||
#endif
|
||||
@@ -1,20 +0,0 @@
|
||||
//
|
||||
// Created by Vlad on 28.07.2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include "NavigationMesh.hpp"
|
||||
#include "omath/Vector3.hpp"
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath::pathfinding
|
||||
{
|
||||
class OMATH_API Astar final
|
||||
{
|
||||
public:
|
||||
[[nodiscard]]
|
||||
static std::vector<Vector3> FindPath(const Vector3& start, const Vector3& end, const NavigationMesh& navMesh);
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
//
|
||||
// Created by Vlad on 28.07.2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "omath/Vector3.hpp"
|
||||
#include <expected>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath::pathfinding
|
||||
{
|
||||
|
||||
enum Error
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class NavigationMesh final
|
||||
{
|
||||
public:
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API std::expected<Vector3, std::string> GetClosestVertex(const Vector3& point) const;
|
||||
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API const std::vector<Vector3>& GetNeighbors(const Vector3& vertex) const;
|
||||
|
||||
[[nodiscard]]
|
||||
OMATH_API bool Empty() const;
|
||||
[[nodiscard]] std::vector<uint8_t> Serialize() const;
|
||||
OMATH_API void Deserialize(const std::vector<uint8_t>& raw);
|
||||
|
||||
std::unordered_map<Vector3, std::vector<Vector3>> m_verTextMap;
|
||||
};
|
||||
}
|
||||
30
include/omath/pathfinding/a_star.hpp
Normal file
30
include/omath/pathfinding/a_star.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// Created by Vlad on 28.07.2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/pathfinding/navigation_mesh.hpp"
|
||||
#include "omath/vector3.hpp"
|
||||
#include <vector>
|
||||
|
||||
namespace omath::pathfinding
|
||||
{
|
||||
struct PathNode;
|
||||
class Astar final
|
||||
{
|
||||
public:
|
||||
[[nodiscard]]
|
||||
static std::vector<Vector3<float>> find_path(const Vector3<float>& start, const Vector3<float>& end,
|
||||
const NavigationMesh& nav_mesh) noexcept;
|
||||
|
||||
private:
|
||||
[[nodiscard]]
|
||||
static std::vector<Vector3<float>>
|
||||
reconstruct_final_path(const std::unordered_map<Vector3<float>, PathNode>& closed_list,
|
||||
const Vector3<float>& current) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
static auto get_perfect_node(const std::unordered_map<Vector3<float>, PathNode>& open_list,
|
||||
const Vector3<float>& end_vertex) noexcept;
|
||||
};
|
||||
} // namespace omath::pathfinding
|
||||
37
include/omath/pathfinding/navigation_mesh.hpp
Normal file
37
include/omath/pathfinding/navigation_mesh.hpp
Normal file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// Created by Vlad on 28.07.2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "omath/vector3.hpp"
|
||||
#include <expected>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace omath::pathfinding
|
||||
{
|
||||
|
||||
enum Error
|
||||
{
|
||||
};
|
||||
|
||||
class NavigationMesh final
|
||||
{
|
||||
public:
|
||||
[[nodiscard]]
|
||||
std::expected<Vector3<float>, std::string> get_closest_vertex(const Vector3<float>& point) const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
const std::vector<Vector3<float>>& get_neighbors(const Vector3<float>& vertex) const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
bool empty() const;
|
||||
|
||||
[[nodiscard]] std::vector<uint8_t> serialize() const noexcept;
|
||||
|
||||
void deserialize(const std::vector<uint8_t>& raw) noexcept;
|
||||
|
||||
std::unordered_map<Vector3<float>, std::vector<Vector3<float>>> m_vertex_map;
|
||||
};
|
||||
} // namespace omath::pathfinding
|
||||
@@ -1,39 +0,0 @@
|
||||
//
|
||||
// Created by Vlad on 6/9/2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include "omath/Vector3.hpp"
|
||||
#include "omath/prediction/Projectile.hpp"
|
||||
#include "omath/prediction/Target.hpp"
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath::prediction
|
||||
{
|
||||
class OMATH_API Engine final
|
||||
{
|
||||
public:
|
||||
explicit Engine(float gravityConstant, float simulationTimeStep,
|
||||
float maximumSimulationTime, float distanceTolerance);
|
||||
|
||||
[[nodiscard]]
|
||||
std::optional<Vector3> MaybeCalculateAimPoint(const Projectile& projectile, const Target& target) const;
|
||||
|
||||
private:
|
||||
const float m_gravityConstant;
|
||||
const float m_simulationTimeStep;
|
||||
const float m_maximumSimulationTime;
|
||||
const float m_distanceTolerance;
|
||||
|
||||
[[nodiscard]]
|
||||
std::optional<float> MaybeCalculateProjectileLaunchPitchAngle(const Projectile& projectile,
|
||||
const Vector3& targetPosition) const;
|
||||
|
||||
|
||||
[[nodiscard]]
|
||||
bool IsProjectileReachedTarget(const Vector3& targetPosition, const Projectile& projectile, float pitch, float time) const;
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
//
|
||||
// Created by Vlad on 6/9/2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/Vector3.hpp"
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath::prediction
|
||||
{
|
||||
class OMATH_API Projectile final
|
||||
{
|
||||
public:
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3 PredictPosition(float pitch, float yaw, float time, float gravity) const;
|
||||
|
||||
Vector3 m_origin;
|
||||
float m_launchSpeed{};
|
||||
float m_gravityScale{};
|
||||
};
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
//
|
||||
// Created by Vlad on 6/9/2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/Vector3.hpp"
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath::prediction
|
||||
{
|
||||
class OMATH_API Target final
|
||||
{
|
||||
public:
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector3 PredictPosition(const float time, const float gravity) const
|
||||
{
|
||||
auto predicted = m_origin + m_velocity * time;
|
||||
|
||||
if (m_isAirborne)
|
||||
predicted.z -= gravity * std::pow(time, 2.f) * 0.5f;
|
||||
|
||||
return predicted;
|
||||
}
|
||||
|
||||
Vector3 m_origin;
|
||||
Vector3 m_velocity;
|
||||
bool m_isAirborne{};
|
||||
};
|
||||
}
|
||||
19
include/omath/projectile_prediction/proj_pred_engine.hpp
Normal file
19
include/omath/projectile_prediction/proj_pred_engine.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Created by Vlad on 2/23/2025.
|
||||
//
|
||||
#pragma once
|
||||
#include "omath/projectile_prediction/projectile.hpp"
|
||||
#include "omath/projectile_prediction/target.hpp"
|
||||
#include "omath/vector3.hpp"
|
||||
|
||||
namespace omath::projectile_prediction
|
||||
{
|
||||
class ProjPredEngineInterface
|
||||
{
|
||||
public:
|
||||
[[nodiscard]]
|
||||
virtual std::optional<Vector3<float>> maybe_calculate_aim_point(const Projectile& projectile,
|
||||
const Target& target) const = 0;
|
||||
virtual ~ProjPredEngineInterface() = default;
|
||||
};
|
||||
} // namespace omath::projectile_prediction
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Created by Vlad on 2/23/2025.
|
||||
//
|
||||
#pragma once
|
||||
#include "omath/projectile_prediction/proj_pred_engine.hpp"
|
||||
|
||||
namespace omath::projectile_prediction
|
||||
{
|
||||
class ProjPredEngineAvx2 final : public ProjPredEngineInterface
|
||||
{
|
||||
public:
|
||||
[[nodiscard]] std::optional<Vector3<float>>
|
||||
maybe_calculate_aim_point(const Projectile& projectile, const Target& target) const override;
|
||||
|
||||
ProjPredEngineAvx2(float gravity_constant, float simulation_time_step, float maximum_simulation_time);
|
||||
~ProjPredEngineAvx2() override = default;
|
||||
|
||||
private:
|
||||
[[nodiscard]] static std::optional<float> calculate_pitch(const Vector3<float>& proj_origin,
|
||||
const Vector3<float>& target_pos,
|
||||
float bullet_gravity, float v0, float time) ;
|
||||
|
||||
// We use [[maybe_unused]] here since AVX2 is not available for ARM and ARM64 CPU
|
||||
[[maybe_unused]] const float m_gravity_constant;
|
||||
[[maybe_unused]] const float m_simulation_time_step;
|
||||
[[maybe_unused]] const float m_maximum_simulation_time;
|
||||
};
|
||||
} // namespace omath::projectile_prediction
|
||||
134
include/omath/projectile_prediction/proj_pred_engine_legacy.hpp
Normal file
134
include/omath/projectile_prediction/proj_pred_engine_legacy.hpp
Normal file
@@ -0,0 +1,134 @@
|
||||
//
|
||||
// Created by Vlad on 6/9/2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "omath/engines/source_engine/traits/pred_engine_trait.hpp"
|
||||
#include "omath/projectile_prediction/proj_pred_engine.hpp"
|
||||
#include "omath/projectile_prediction/projectile.hpp"
|
||||
#include "omath/projectile_prediction/target.hpp"
|
||||
#include "omath/vector3.hpp"
|
||||
#include <optional>
|
||||
|
||||
namespace omath::projectile_prediction
|
||||
{
|
||||
template<class T>
|
||||
concept PredEngineConcept =
|
||||
requires(const Projectile& projectile, const Target& target, const Vector3<float>& vec_a,
|
||||
const Vector3<float>& vec_b,
|
||||
Vector3<float> v3, // by-value for calc_viewpoint_from_angles
|
||||
float pitch, float yaw, float time, float gravity, std::optional<float> maybe_pitch) {
|
||||
// Presence + return types
|
||||
{ T::predict_projectile_position(projectile, pitch, yaw, time, gravity) } -> std::same_as<Vector3<float>>;
|
||||
{ T::predict_target_position(target, time, gravity) } -> std::same_as<Vector3<float>>;
|
||||
{ T::calc_vector_2d_distance(vec_a) } -> std::same_as<float>;
|
||||
{ T::get_vector_height_coordinate(vec_b) } -> std::same_as<float>;
|
||||
{ T::calc_viewpoint_from_angles(projectile, v3, maybe_pitch) } -> std::same_as<Vector3<float>>;
|
||||
{ T::calc_direct_pitch_angle(vec_a, vec_b) } -> std::same_as<float>;
|
||||
{ T::calc_direct_yaw_angle(vec_a, vec_b) } -> std::same_as<float>;
|
||||
|
||||
// Enforce noexcept as in PredEngineTrait
|
||||
requires noexcept(T::predict_projectile_position(projectile, pitch, yaw, time, gravity));
|
||||
requires noexcept(T::predict_target_position(target, time, gravity));
|
||||
requires noexcept(T::calc_vector_2d_distance(vec_a));
|
||||
requires noexcept(T::get_vector_height_coordinate(vec_b));
|
||||
requires noexcept(T::calc_viewpoint_from_angles(projectile, v3, maybe_pitch));
|
||||
requires noexcept(T::calc_direct_pitch_angle(vec_a, vec_b));
|
||||
requires noexcept(T::calc_direct_yaw_angle(vec_a, vec_b));
|
||||
};
|
||||
template<class EngineTrait = source_engine::PredEngineTrait>
|
||||
requires PredEngineConcept<EngineTrait>
|
||||
class ProjPredEngineLegacy final : public ProjPredEngineInterface
|
||||
{
|
||||
public:
|
||||
explicit ProjPredEngineLegacy(const float gravity_constant, const float simulation_time_step,
|
||||
const float maximum_simulation_time, const float distance_tolerance)
|
||||
: m_gravity_constant(gravity_constant), m_simulation_time_step(simulation_time_step),
|
||||
m_maximum_simulation_time(maximum_simulation_time), m_distance_tolerance(distance_tolerance)
|
||||
{
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
std::optional<Vector3<float>> maybe_calculate_aim_point(const Projectile& projectile,
|
||||
const Target& target) const override
|
||||
{
|
||||
for (float time = 0.f; time < m_maximum_simulation_time; time += m_simulation_time_step)
|
||||
{
|
||||
const auto predicted_target_position =
|
||||
EngineTrait::predict_target_position(target, time, m_gravity_constant);
|
||||
|
||||
const auto projectile_pitch =
|
||||
maybe_calculate_projectile_launch_pitch_angle(projectile, predicted_target_position);
|
||||
|
||||
if (!projectile_pitch.has_value()) [[unlikely]]
|
||||
continue;
|
||||
|
||||
if (!is_projectile_reached_target(predicted_target_position, projectile, projectile_pitch.value(),
|
||||
time))
|
||||
continue;
|
||||
|
||||
return EngineTrait::calc_viewpoint_from_angles(projectile, predicted_target_position, projectile_pitch);
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
private:
|
||||
const float m_gravity_constant;
|
||||
const float m_simulation_time_step;
|
||||
const float m_maximum_simulation_time;
|
||||
const float m_distance_tolerance;
|
||||
|
||||
// Realization of this formula:
|
||||
// https://stackoverflow.com/questions/54917375/how-to-calculate-the-angle-to-shoot-a-bullet-in-order-to-hit-a-moving-target
|
||||
/*
|
||||
\[
|
||||
\theta \;=\; \arctan\!\Biggl(
|
||||
\frac{%
|
||||
v^{2}\;\pm\;\sqrt{\,v^{4}-g\!\left(gx^{2}+2yv^{2}\right)\,}
|
||||
}{%
|
||||
gx
|
||||
}\Biggr)
|
||||
\]
|
||||
*/
|
||||
[[nodiscard]]
|
||||
std::optional<float>
|
||||
maybe_calculate_projectile_launch_pitch_angle(const Projectile& projectile,
|
||||
const Vector3<float>& target_position) const noexcept
|
||||
{
|
||||
const auto bullet_gravity = m_gravity_constant * projectile.m_gravity_scale;
|
||||
|
||||
if (bullet_gravity == 0.f)
|
||||
return EngineTrait::calc_direct_pitch_angle(projectile.m_origin, target_position);
|
||||
|
||||
const auto delta = target_position - projectile.m_origin;
|
||||
|
||||
const auto distance2d = EngineTrait::calc_vector_2d_distance(delta);
|
||||
const auto distance2d_sqr = distance2d * distance2d;
|
||||
const auto launch_speed_sqr = projectile.m_launch_speed * projectile.m_launch_speed;
|
||||
|
||||
float root = launch_speed_sqr * launch_speed_sqr
|
||||
- bullet_gravity
|
||||
* (bullet_gravity * distance2d_sqr
|
||||
+ 2.0f * EngineTrait::get_vector_height_coordinate(delta) * launch_speed_sqr);
|
||||
|
||||
if (root < 0.0f) [[unlikely]]
|
||||
return std::nullopt;
|
||||
|
||||
root = std::sqrt(root);
|
||||
const float angle = std::atan((launch_speed_sqr - root) / (bullet_gravity * distance2d));
|
||||
|
||||
return angles::radians_to_degrees(angle);
|
||||
}
|
||||
[[nodiscard]]
|
||||
bool is_projectile_reached_target(const Vector3<float>& target_position, const Projectile& projectile,
|
||||
const float pitch, const float time) const noexcept
|
||||
{
|
||||
const auto yaw = EngineTrait::calc_direct_yaw_angle(projectile.m_origin, target_position);
|
||||
const auto projectile_position =
|
||||
EngineTrait::predict_projectile_position(projectile, pitch, yaw, time, m_gravity_constant);
|
||||
|
||||
return projectile_position.distance_to(target_position) <= m_distance_tolerance;
|
||||
}
|
||||
};
|
||||
} // namespace omath::projectile_prediction
|
||||
17
include/omath/projectile_prediction/projectile.hpp
Normal file
17
include/omath/projectile_prediction/projectile.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Created by Vlad on 6/9/2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/vector3.hpp"
|
||||
|
||||
namespace omath::projectile_prediction
|
||||
{
|
||||
class Projectile final
|
||||
{
|
||||
public:
|
||||
Vector3<float> m_origin;
|
||||
float m_launch_speed{};
|
||||
float m_gravity_scale{};
|
||||
};
|
||||
} // namespace omath::projectile_prediction
|
||||
17
include/omath/projectile_prediction/target.hpp
Normal file
17
include/omath/projectile_prediction/target.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Created by Vlad on 6/9/2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "omath/vector3.hpp"
|
||||
|
||||
namespace omath::projectile_prediction
|
||||
{
|
||||
class Target final
|
||||
{
|
||||
public:
|
||||
Vector3<float> m_origin;
|
||||
Vector3<float> m_velocity;
|
||||
bool m_is_airborne{};
|
||||
};
|
||||
} // namespace omath::projectile_prediction
|
||||
@@ -1,89 +0,0 @@
|
||||
//
|
||||
// Created by Vlad on 27.08.2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <expected>
|
||||
#include <omath/Mat.hpp>
|
||||
#include <omath/Vector3.hpp>
|
||||
#include "ErrorCodes.hpp"
|
||||
#include <omath/Angle.hpp>
|
||||
#include <type_traits>
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath::projection
|
||||
{
|
||||
class OMATH_API ViewPort final
|
||||
{
|
||||
public:
|
||||
float m_width;
|
||||
float m_height;
|
||||
|
||||
[[nodiscard]] constexpr float AspectRatio() const
|
||||
{
|
||||
return m_width / m_height;
|
||||
}
|
||||
};
|
||||
using FieldOfView = const Angle<float, 0.f, 180.f, AngleFlags::Clamped>;
|
||||
|
||||
template<class Mat4x4Type, class ViewAnglesType>
|
||||
class OMATH_API Camera
|
||||
{
|
||||
|
||||
public:
|
||||
virtual ~Camera() = default;
|
||||
Camera(const Vector3& position, const ViewAnglesType& viewAngles, const ViewPort& viewPort,
|
||||
const FieldOfView& fov, const float near, const float far) :
|
||||
m_viewPort(viewPort), m_fieldOfView(fov), m_farPlaneDistance(far), m_nearPlaneDistance(near),
|
||||
m_viewAngles(viewAngles), m_origin(position)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
virtual void LookAt(const Vector3& target) = 0;
|
||||
|
||||
[[nodiscard]] virtual Mat4x4Type GetViewMatrix() const = 0;
|
||||
|
||||
[[nodiscard]] virtual Mat4x4Type GetProjectionMatrix() const = 0;
|
||||
|
||||
[[nodiscard]] Mat4x4Type GetViewProjectionMatrix()
|
||||
{
|
||||
return GetProjectionMatrix() * GetViewMatrix();
|
||||
}
|
||||
|
||||
[[nodiscard]] std::expected<Vector3, Error> WorldToScreen(const Mat4x4Type& viewProj, const Vector3& worldPosition) const
|
||||
{
|
||||
auto projected = viewProj * MatColumnFromVector<float, Mat4x4Type::GetStoreOrdering()>(worldPosition);
|
||||
|
||||
if (projected.At(3, 0) == 0.0f)
|
||||
return std::unexpected(Error::WORLD_POSITION_IS_OUT_OF_SCREEN_BOUNDS);
|
||||
|
||||
projected /= projected.At(3, 0);
|
||||
|
||||
if (IsNdcOutOfBounds(projected))
|
||||
return std::unexpected(Error::WORLD_POSITION_IS_OUT_OF_SCREEN_BOUNDS);
|
||||
|
||||
return Vector3{(projected.At(0,0)+1) / 2 * m_viewPort.m_width , (-projected.At(1,0)+1) / 2 * m_viewPort.m_height, projected.At(2,0)};
|
||||
}
|
||||
|
||||
protected:
|
||||
ViewPort m_viewPort{};
|
||||
Angle<float, 0.f, 180.f, AngleFlags::Clamped> m_fieldOfView;
|
||||
|
||||
float m_farPlaneDistance;
|
||||
float m_nearPlaneDistance;
|
||||
|
||||
|
||||
ViewAnglesType m_viewAngles;
|
||||
Vector3 m_origin;
|
||||
|
||||
private:
|
||||
template<class Type>
|
||||
[[nodiscard]]
|
||||
constexpr static bool IsNdcOutOfBounds(const Type& ndc)
|
||||
{
|
||||
return std::ranges::any_of( ndc.RawArray(), [](const auto& val) { return val < -1 || val > 1; });
|
||||
}
|
||||
};
|
||||
} // namespace omath::projection
|
||||
204
include/omath/projection/camera.hpp
Normal file
204
include/omath/projection/camera.hpp
Normal file
@@ -0,0 +1,204 @@
|
||||
//
|
||||
// Created by Vlad on 27.08.2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "omath/projection/error_codes.hpp"
|
||||
#include <expected>
|
||||
#include <omath/angle.hpp>
|
||||
#include <omath/mat.hpp>
|
||||
#include <omath/vector3.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
namespace omath::projection
|
||||
{
|
||||
class ViewPort final
|
||||
{
|
||||
public:
|
||||
float m_width;
|
||||
float m_height;
|
||||
|
||||
[[nodiscard]] constexpr float aspect_ratio() const
|
||||
{
|
||||
return m_width / m_height;
|
||||
}
|
||||
};
|
||||
using FieldOfView = Angle<float, 0.f, 180.f, AngleFlags::Clamped>;
|
||||
|
||||
template<class T, class MatType, class ViewAnglesType>
|
||||
concept CameraEngineConcept =
|
||||
requires(const Vector3<float>& cam_origin, const Vector3<float>& look_at, const ViewAnglesType& angles,
|
||||
const FieldOfView& fov, const ViewPort& viewport, float znear, float zfar) {
|
||||
// Presence + return types
|
||||
{ T::calc_look_at_angle(cam_origin, look_at) } -> std::same_as<ViewAnglesType>;
|
||||
{ T::calc_view_matrix(angles, cam_origin) } -> std::same_as<MatType>;
|
||||
{ T::calc_projection_matrix(fov, viewport, znear, zfar) } -> std::same_as<MatType>;
|
||||
|
||||
// Enforce noexcept as in the trait declaration
|
||||
requires noexcept(T::calc_look_at_angle(cam_origin, look_at));
|
||||
requires noexcept(T::calc_view_matrix(angles, cam_origin));
|
||||
requires noexcept(T::calc_projection_matrix(fov, viewport, znear, zfar));
|
||||
};
|
||||
|
||||
template<class Mat4X4Type, class ViewAnglesType, class TraitClass>
|
||||
requires CameraEngineConcept<TraitClass, Mat4X4Type, ViewAnglesType>
|
||||
class Camera final
|
||||
{
|
||||
public:
|
||||
~Camera() = default;
|
||||
Camera(const Vector3<float>& position, const ViewAnglesType& view_angles, const ViewPort& view_port,
|
||||
const FieldOfView& fov, const float near, const float far) noexcept
|
||||
: m_view_port(view_port), m_field_of_view(fov), m_far_plane_distance(far), m_near_plane_distance(near),
|
||||
m_view_angles(view_angles), m_origin(position)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
void look_at(const Vector3<float>& target)
|
||||
{
|
||||
m_view_angles = TraitClass::calc_look_at_angle(m_origin, target);
|
||||
}
|
||||
|
||||
[[nodiscard]] Mat4X4Type calc_view_projection_matrix() const noexcept
|
||||
{
|
||||
return TraitClass::calc_projection_matrix(m_field_of_view, m_view_port, m_near_plane_distance,
|
||||
m_far_plane_distance)
|
||||
* TraitClass::calc_view_matrix(m_view_angles, m_origin);
|
||||
}
|
||||
|
||||
public:
|
||||
[[nodiscard]] const Mat4X4Type& get_view_projection_matrix() const noexcept
|
||||
{
|
||||
if (!m_view_projection_matrix.has_value())
|
||||
m_view_projection_matrix = calc_view_projection_matrix();
|
||||
|
||||
return m_view_projection_matrix.value();
|
||||
}
|
||||
|
||||
void set_field_of_view(const FieldOfView& fov) noexcept
|
||||
{
|
||||
m_field_of_view = fov;
|
||||
m_view_projection_matrix = std::nullopt;
|
||||
}
|
||||
|
||||
void set_near_plane(const float near) noexcept
|
||||
{
|
||||
m_near_plane_distance = near;
|
||||
m_view_projection_matrix = std::nullopt;
|
||||
}
|
||||
|
||||
void set_far_plane(const float far) noexcept
|
||||
{
|
||||
m_far_plane_distance = far;
|
||||
m_view_projection_matrix = std::nullopt;
|
||||
}
|
||||
|
||||
void set_view_angles(const ViewAnglesType& view_angles) noexcept
|
||||
{
|
||||
m_view_angles = view_angles;
|
||||
m_view_projection_matrix = std::nullopt;
|
||||
}
|
||||
|
||||
void set_origin(const Vector3<float>& origin) noexcept
|
||||
{
|
||||
m_origin = origin;
|
||||
m_view_projection_matrix = std::nullopt;
|
||||
}
|
||||
|
||||
void set_view_port(const ViewPort& view_port) noexcept
|
||||
{
|
||||
m_view_port = view_port;
|
||||
m_view_projection_matrix = std::nullopt;
|
||||
}
|
||||
|
||||
[[nodiscard]] const FieldOfView& get_field_of_view() const noexcept
|
||||
{
|
||||
return m_field_of_view;
|
||||
}
|
||||
|
||||
[[nodiscard]] const float& get_near_plane() const noexcept
|
||||
{
|
||||
return m_near_plane_distance;
|
||||
}
|
||||
|
||||
[[nodiscard]] const float& get_far_plane() const noexcept
|
||||
{
|
||||
return m_far_plane_distance;
|
||||
}
|
||||
|
||||
[[nodiscard]] const ViewAnglesType& get_view_angles() const noexcept
|
||||
{
|
||||
return m_view_angles;
|
||||
}
|
||||
|
||||
[[nodiscard]] const Vector3<float>& get_origin() const noexcept
|
||||
{
|
||||
return m_origin;
|
||||
}
|
||||
|
||||
[[nodiscard]] std::expected<Vector3<float>, Error>
|
||||
world_to_screen(const Vector3<float>& world_position) const noexcept
|
||||
{
|
||||
auto normalized_cords = world_to_view_port(world_position);
|
||||
|
||||
if (!normalized_cords.has_value())
|
||||
return std::unexpected{normalized_cords.error()};
|
||||
|
||||
return ndc_to_screen_position(*normalized_cords);
|
||||
}
|
||||
|
||||
[[nodiscard]] std::expected<Vector3<float>, Error>
|
||||
world_to_view_port(const Vector3<float>& world_position) const noexcept
|
||||
{
|
||||
auto projected = get_view_projection_matrix()
|
||||
* mat_column_from_vector<float, Mat4X4Type::get_store_ordering()>(world_position);
|
||||
|
||||
if (projected.at(3, 0) == 0.0f)
|
||||
return std::unexpected(Error::WORLD_POSITION_IS_OUT_OF_SCREEN_BOUNDS);
|
||||
|
||||
projected /= projected.at(3, 0);
|
||||
|
||||
if (is_ndc_out_of_bounds(projected))
|
||||
return std::unexpected(Error::WORLD_POSITION_IS_OUT_OF_SCREEN_BOUNDS);
|
||||
|
||||
return Vector3<float>{projected.at(0, 0), projected.at(1, 0), projected.at(2, 0)};
|
||||
}
|
||||
|
||||
protected:
|
||||
ViewPort m_view_port{};
|
||||
Angle<float, 0.f, 180.f, AngleFlags::Clamped> m_field_of_view;
|
||||
|
||||
mutable std::optional<Mat4X4Type> m_view_projection_matrix;
|
||||
|
||||
float m_far_plane_distance;
|
||||
float m_near_plane_distance;
|
||||
|
||||
ViewAnglesType m_view_angles;
|
||||
Vector3<float> m_origin;
|
||||
|
||||
private:
|
||||
template<class Type>
|
||||
[[nodiscard]] constexpr static bool is_ndc_out_of_bounds(const Type& ndc) noexcept
|
||||
{
|
||||
return std::ranges::any_of(ndc.raw_array(), [](const auto& val) { return val < -1 || val > 1; });
|
||||
}
|
||||
|
||||
[[nodiscard]] Vector3<float> ndc_to_screen_position(const Vector3<float>& ndc) const noexcept
|
||||
{
|
||||
/*
|
||||
^
|
||||
| y
|
||||
1 |
|
||||
|
|
||||
|
|
||||
-1 ---------0--------- 1 --> x
|
||||
|
|
||||
|
|
||||
-1 |
|
||||
v
|
||||
*/
|
||||
return {(ndc.x + 1.f) / 2.f * m_view_port.m_width, (1.f - ndc.y) / 2.f * m_view_port.m_height, ndc.z};
|
||||
}
|
||||
};
|
||||
} // namespace omath::projection
|
||||
@@ -5,7 +5,6 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
namespace omath::projection
|
||||
{
|
||||
enum class Error : uint16_t
|
||||
85
include/omath/triangle.hpp
Normal file
85
include/omath/triangle.hpp
Normal file
@@ -0,0 +1,85 @@
|
||||
//
|
||||
// Created by Orange on 11/13/2024.
|
||||
//
|
||||
#pragma once
|
||||
#include "omath/vector3.hpp"
|
||||
|
||||
namespace omath
|
||||
{
|
||||
/*
|
||||
v1
|
||||
|\
|
||||
| \
|
||||
a | \ hypot
|
||||
| \
|
||||
v2 ----- v3
|
||||
b
|
||||
*/
|
||||
|
||||
template<class Vector>
|
||||
class Triangle final
|
||||
{
|
||||
public:
|
||||
constexpr Triangle() = default;
|
||||
constexpr Triangle(const Vector& vertex1, const Vector& vertex2, const Vector& vertex3)
|
||||
: m_vertex1(vertex1), m_vertex2(vertex2), m_vertex3(vertex3)
|
||||
{
|
||||
}
|
||||
|
||||
Vector3<float> m_vertex1;
|
||||
Vector3<float> m_vertex2;
|
||||
Vector3<float> m_vertex3;
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector3<float> calculate_normal() const
|
||||
{
|
||||
const auto b = side_b_vector();
|
||||
const auto a = side_a_vector();
|
||||
|
||||
return b.cross(a).normalized();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
float side_a_length() const
|
||||
{
|
||||
return m_vertex1.distance_to(m_vertex2);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
float side_b_length() const
|
||||
{
|
||||
return m_vertex3.distance_to(m_vertex2);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector3<float> side_a_vector() const
|
||||
{
|
||||
return m_vertex1 - m_vertex2;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr float hypot() const
|
||||
{
|
||||
return m_vertex1.distance_to(m_vertex3);
|
||||
}
|
||||
[[nodiscard]]
|
||||
constexpr bool is_rectangular() const
|
||||
{
|
||||
const auto side_a = side_a_length();
|
||||
const auto side_b = side_b_length();
|
||||
const auto hypot_value = hypot();
|
||||
|
||||
return std::abs(side_a * side_a + side_b * side_b - hypot_value * hypot_value) <= 0.0001f;
|
||||
}
|
||||
[[nodiscard]]
|
||||
constexpr Vector3<float> side_b_vector() const
|
||||
{
|
||||
return m_vertex3 - m_vertex2;
|
||||
}
|
||||
[[nodiscard]]
|
||||
constexpr Vector3<float> mid_point() const
|
||||
{
|
||||
return (m_vertex1 + m_vertex2 + m_vertex3) / 3;
|
||||
}
|
||||
};
|
||||
} // namespace omath
|
||||
251
include/omath/vector2.hpp
Normal file
251
include/omath/vector2.hpp
Normal file
@@ -0,0 +1,251 @@
|
||||
//
|
||||
// Created by Vlad on 02.09.2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "vector3.hpp"
|
||||
#include <cmath>
|
||||
#include <format>
|
||||
#include <tuple>
|
||||
|
||||
#ifdef OMATH_IMGUI_INTEGRATION
|
||||
#include <imgui.h>
|
||||
#endif
|
||||
|
||||
namespace omath
|
||||
{
|
||||
|
||||
template<class Type>
|
||||
requires std::is_arithmetic_v<Type>
|
||||
class Vector2
|
||||
{
|
||||
public:
|
||||
Type x = static_cast<Type>(0);
|
||||
Type y = static_cast<Type>(0);
|
||||
|
||||
// Constructors
|
||||
constexpr Vector2() = default;
|
||||
|
||||
constexpr Vector2(const Type& x, const Type& y) noexcept: x(x), y(y)
|
||||
{
|
||||
}
|
||||
|
||||
// Equality operators
|
||||
[[nodiscard]]
|
||||
constexpr bool operator==(const Vector2& other) const noexcept
|
||||
{
|
||||
return x == other.x && y == other.y;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr bool operator!=(const Vector2& other) const noexcept
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
// Compound assignment operators
|
||||
constexpr Vector2& operator+=(const Vector2& other) noexcept
|
||||
{
|
||||
x += other.x;
|
||||
y += other.y;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector2& operator-=(const Vector2& other) noexcept
|
||||
{
|
||||
x -= other.x;
|
||||
y -= other.y;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector2& operator*=(const Vector2& other) noexcept
|
||||
{
|
||||
x *= other.x;
|
||||
y *= other.y;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector2& operator/=(const Vector2& other) noexcept
|
||||
{
|
||||
x /= other.x;
|
||||
y /= other.y;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector2& operator*=(const Type& value) noexcept
|
||||
{
|
||||
x *= value;
|
||||
y *= value;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector2& operator/=(const Type& value) noexcept
|
||||
{
|
||||
x /= value;
|
||||
y /= value;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector2& operator+=(const Type& value) noexcept
|
||||
{
|
||||
x += value;
|
||||
y += value;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector2& operator-=(const Type& value) noexcept
|
||||
{
|
||||
x -= value;
|
||||
y -= value;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Basic vector operations
|
||||
[[nodiscard]] Type distance_to(const Vector2& other) const noexcept
|
||||
{
|
||||
return std::sqrt(distance_to_sqr(other));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Type distance_to_sqr(const Vector2& other) const noexcept
|
||||
{
|
||||
return (x - other.x) * (x - other.x) + (y - other.y) * (y - other.y);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Type dot(const Vector2& other) const noexcept
|
||||
{
|
||||
return x * other.x + y * other.y;
|
||||
}
|
||||
|
||||
#ifndef _MSC_VER
|
||||
[[nodiscard]] constexpr Type length() const noexcept
|
||||
{
|
||||
return std::hypot(this->x, this->y);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector2 normalized() const noexcept
|
||||
{
|
||||
const Type len = length();
|
||||
return len > 0.f ? *this / len : *this;
|
||||
}
|
||||
#else
|
||||
[[nodiscard]] Type length() const noexcept
|
||||
{
|
||||
return std::hypot(x, y);
|
||||
}
|
||||
|
||||
[[nodiscard]] Vector2 normalized() const noexcept
|
||||
{
|
||||
const Type len = length();
|
||||
return len > static_cast<Type>(0) ? *this / len : *this;
|
||||
}
|
||||
#endif
|
||||
[[nodiscard]] constexpr Type length_sqr() const noexcept
|
||||
{
|
||||
return x * x + y * y;
|
||||
}
|
||||
|
||||
constexpr Vector2& abs() noexcept
|
||||
{
|
||||
// FIXME: Replace with std::abs, if it will become constexprable
|
||||
x = x < static_cast<Type>(0) ? -x : x;
|
||||
y = y < static_cast<Type>(0) ? -y : y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector2 operator-() const noexcept
|
||||
{
|
||||
return {-x, -y};
|
||||
}
|
||||
|
||||
// Binary arithmetic operators
|
||||
[[nodiscard]] constexpr Vector2 operator+(const Vector2& other) const noexcept
|
||||
{
|
||||
return {x + other.x, y + other.y};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector2 operator-(const Vector2& other) const noexcept
|
||||
{
|
||||
return {x - other.x, y - other.y};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector2 operator*(const Type& value) const noexcept
|
||||
{
|
||||
return {x * value, y * value};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector2 operator/(const Type& value) const noexcept
|
||||
{
|
||||
return {x / value, y / value};
|
||||
}
|
||||
|
||||
// Sum of elements
|
||||
[[nodiscard]] constexpr Type sum() const noexcept
|
||||
{
|
||||
return x + y;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
bool operator<(const Vector2& other) const noexcept
|
||||
{
|
||||
return length() < other.length();
|
||||
}
|
||||
[[nodiscard]]
|
||||
bool operator>(const Vector2& other) const noexcept
|
||||
{
|
||||
return length() > other.length();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
bool operator<=(const Vector2& other) const noexcept
|
||||
{
|
||||
return length() <= other.length();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
bool operator>=(const Vector2& other) const noexcept
|
||||
{
|
||||
return length() >= other.length();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr std::tuple<Type, Type> as_tuple() const noexcept
|
||||
{
|
||||
return std::make_tuple(x, y);
|
||||
}
|
||||
#ifdef OMATH_IMGUI_INTEGRATION
|
||||
[[nodiscard]]
|
||||
ImVec2 to_im_vec2() const noexcept
|
||||
{
|
||||
return {static_cast<float>(this->x), static_cast<float>(this->y)};
|
||||
}
|
||||
[[nodiscard]]
|
||||
static Vector2 from_im_vec2(const ImVec2& other) noexcept
|
||||
{
|
||||
return {static_cast<Type>(other.x), static_cast<Type>(other.y)};
|
||||
}
|
||||
#endif
|
||||
};
|
||||
} // namespace omath
|
||||
|
||||
template<class Type>
|
||||
struct std::formatter<omath::Vector2<Type>> // NOLINT(*-dcl58-cpp)
|
||||
{
|
||||
[[nodiscard]]
|
||||
static constexpr auto parse(std::format_parse_context& ctx)
|
||||
{
|
||||
return ctx.begin();
|
||||
}
|
||||
[[nodiscard]]
|
||||
static auto format(const omath::Vector2<Type>& vec, std::format_context& ctx)
|
||||
{
|
||||
return std::format_to(ctx.out(), "[{}, {}]", vec.x, vec.y);
|
||||
}
|
||||
};
|
||||
311
include/omath/vector3.hpp
Normal file
311
include/omath/vector3.hpp
Normal file
@@ -0,0 +1,311 @@
|
||||
//
|
||||
// Created by vlad on 10/28/23.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "omath/angle.hpp"
|
||||
#include "omath/vector2.hpp"
|
||||
#include <cstdint>
|
||||
#include <expected>
|
||||
#include <functional>
|
||||
|
||||
namespace omath
|
||||
{
|
||||
|
||||
enum class Vector3Error
|
||||
{
|
||||
IMPOSSIBLE_BETWEEN_ANGLE,
|
||||
};
|
||||
|
||||
template<class Type>
|
||||
requires std::is_arithmetic_v<Type>
|
||||
class Vector3 : public Vector2<Type>
|
||||
{
|
||||
public:
|
||||
Type z = static_cast<Type>(0);
|
||||
constexpr Vector3(const Type& x, const Type& y, const Type& z) noexcept: Vector2<Type>(x, y), z(z)
|
||||
{
|
||||
}
|
||||
constexpr Vector3() noexcept: Vector2<Type>() {};
|
||||
|
||||
[[nodiscard]] constexpr bool operator==(const Vector3& other) const noexcept
|
||||
{
|
||||
return Vector2<Type>::operator==(other) && (other.z == z);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool operator!=(const Vector3& other) const noexcept
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
constexpr Vector3& operator+=(const Vector3& other) noexcept
|
||||
{
|
||||
Vector2<Type>::operator+=(other);
|
||||
z += other.z;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& operator-=(const Vector3& other) noexcept
|
||||
{
|
||||
Vector2<Type>::operator-=(other);
|
||||
z -= other.z;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& operator*=(const Type& value) noexcept
|
||||
{
|
||||
Vector2<Type>::operator*=(value);
|
||||
z *= value;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& operator*=(const Vector3& other) noexcept
|
||||
{
|
||||
Vector2<Type>::operator*=(other);
|
||||
z *= other.z;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& operator/=(const Vector3& other) noexcept
|
||||
{
|
||||
Vector2<Type>::operator/=(other);
|
||||
z /= other.z;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& operator+=(const Type& value) noexcept
|
||||
{
|
||||
Vector2<Type>::operator+=(value);
|
||||
z += value;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& operator/=(const Type& value) noexcept
|
||||
{
|
||||
Vector2<Type>::operator/=(value);
|
||||
z /= value;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& operator-=(const Type& value) noexcept
|
||||
{
|
||||
Vector2<Type>::operator-=(value);
|
||||
z -= value;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector3& abs() noexcept
|
||||
{
|
||||
Vector2<Type>::abs();
|
||||
z = z < 0.f ? -z : z;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Type distance_to_sqr(const Vector3& other) const noexcept
|
||||
{
|
||||
return (*this - other).length_sqr();
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Type dot(const Vector3& other) const noexcept
|
||||
{
|
||||
return Vector2<Type>::dot(other) + z * other.z;
|
||||
}
|
||||
|
||||
#ifndef _MSC_VER
|
||||
[[nodiscard]] constexpr Type length() const
|
||||
{
|
||||
return std::hypot(this->x, this->y, z);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Type length_2d() const
|
||||
{
|
||||
return Vector2<Type>::length();
|
||||
}
|
||||
[[nodiscard]] Type distance_to(const Vector3& other) const
|
||||
{
|
||||
return (*this - other).length();
|
||||
}
|
||||
[[nodiscard]] constexpr Vector3 normalized() const
|
||||
{
|
||||
const Type length_value = this->length();
|
||||
|
||||
return length_value != 0 ? *this / length_value : *this;
|
||||
}
|
||||
#else
|
||||
[[nodiscard]] Type length() const noexcept
|
||||
{
|
||||
return std::hypot(this->x, this->y, z);
|
||||
}
|
||||
|
||||
[[nodiscard]] Vector3 normalized() const noexcept
|
||||
{
|
||||
const Type len = this->length();
|
||||
|
||||
return len != static_cast<Type>(0) ? *this / len : *this;
|
||||
}
|
||||
|
||||
[[nodiscard]] Type length_2d() const noexcept
|
||||
{
|
||||
return Vector2<Type>::length();
|
||||
}
|
||||
|
||||
[[nodiscard]] Type distance_to(const Vector3& v_other) const noexcept
|
||||
{
|
||||
return (*this - v_other).length();
|
||||
}
|
||||
#endif
|
||||
|
||||
[[nodiscard]] constexpr Type length_sqr() const noexcept
|
||||
{
|
||||
return Vector2<Type>::length_sqr() + z * z;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 operator-() const noexcept
|
||||
{
|
||||
return {-this->x, -this->y, -z};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 operator+(const Vector3& other) const noexcept
|
||||
{
|
||||
return {this->x + other.x, this->y + other.y, z + other.z};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 operator-(const Vector3& other) const noexcept
|
||||
{
|
||||
return {this->x - other.x, this->y - other.y, z - other.z};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 operator*(const Type& value) const noexcept
|
||||
{
|
||||
return {this->x * value, this->y * value, z * value};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 operator*(const Vector3& other) const noexcept
|
||||
{
|
||||
return {this->x * other.x, this->y * other.y, z * other.z};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 operator/(const Type& value) const noexcept
|
||||
{
|
||||
return {this->x / value, this->y / value, z / value};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 operator/(const Vector3& other) const noexcept
|
||||
{
|
||||
return {this->x / other.x, this->y / other.y, z / other.z};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Vector3 cross(const Vector3& other) const noexcept
|
||||
{
|
||||
return {this->y * other.z - z * other.y, z * other.x - this->x * other.z,
|
||||
this->x * other.y - this->y * other.x};
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Type sum() const noexcept
|
||||
{
|
||||
return sum_2d() + z;
|
||||
}
|
||||
|
||||
[[nodiscard]] std::expected<Angle<float, 0.f, 180.f, AngleFlags::Clamped>, Vector3Error>
|
||||
angle_between(const Vector3& other) const noexcept
|
||||
{
|
||||
const auto bottom = length() * other.length();
|
||||
|
||||
if (bottom == static_cast<Type>(0))
|
||||
return std::unexpected(Vector3Error::IMPOSSIBLE_BETWEEN_ANGLE);
|
||||
|
||||
return Angle<float, 0.f, 180.f, AngleFlags::Clamped>::from_radians(std::acos(dot(other) / bottom));
|
||||
}
|
||||
|
||||
[[nodiscard]] bool is_perpendicular(const Vector3& other) const noexcept
|
||||
{
|
||||
if (const auto angle = angle_between(other))
|
||||
return angle->as_degrees() == static_cast<Type>(90);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Type sum_2d() const noexcept
|
||||
{
|
||||
return Vector2<Type>::sum();
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr std::tuple<Type, Type, Type> as_tuple() const noexcept
|
||||
{
|
||||
return std::make_tuple(this->x, this->y, z);
|
||||
}
|
||||
|
||||
[[nodiscard]] Vector3 view_angle_to(const Vector3& other) const noexcept
|
||||
{
|
||||
const auto distance = distance_to(other);
|
||||
const auto delta = other - *this;
|
||||
|
||||
return {angles::radians_to_degrees(std::asin(delta.z / distance)),
|
||||
angles::radians_to_degrees(std::atan2(delta.y, delta.x)), 0};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
bool operator<(const Vector3& other) const noexcept
|
||||
{
|
||||
return length() < other.length();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
bool operator>(const Vector3& other) const noexcept
|
||||
{
|
||||
return length() > other.length();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
bool operator<=(const Vector3& other) const noexcept
|
||||
{
|
||||
return length() <= other.length();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
bool operator>=(const Vector3& other) const noexcept
|
||||
{
|
||||
return length() >= other.length();
|
||||
}
|
||||
};
|
||||
} // namespace omath
|
||||
|
||||
template<> struct std::hash<omath::Vector3<float>>
|
||||
{
|
||||
std::size_t operator()(const omath::Vector3<float>& vec) const noexcept
|
||||
{
|
||||
std::size_t hash = 0;
|
||||
constexpr std::hash<float> hasher;
|
||||
|
||||
hash ^= hasher(vec.x) + 0x9e3779b9 + (hash << 6) + (hash >> 2);
|
||||
hash ^= hasher(vec.y) + 0x9e3779b9 + (hash << 6) + (hash >> 2);
|
||||
hash ^= hasher(vec.z) + 0x9e3779b9 + (hash << 6) + (hash >> 2);
|
||||
|
||||
return hash;
|
||||
}
|
||||
};
|
||||
|
||||
template<class Type>
|
||||
struct std::formatter<omath::Vector3<Type>> // NOLINT(*-dcl58-cpp)
|
||||
{
|
||||
[[nodiscard]]
|
||||
static constexpr auto parse(std::format_parse_context& ctx)
|
||||
{
|
||||
return ctx.begin();
|
||||
}
|
||||
[[nodiscard]]
|
||||
static auto format(const omath::Vector3<Type>& vec, std::format_context& ctx)
|
||||
{
|
||||
return std::format_to(ctx.out(), "[{}, {}, {}]", vec.x, vec.y, vec.z);
|
||||
}
|
||||
};
|
||||
218
include/omath/vector4.hpp
Normal file
218
include/omath/vector4.hpp
Normal file
@@ -0,0 +1,218 @@
|
||||
//
|
||||
// Vector4.h
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <omath/vector3.hpp>
|
||||
|
||||
namespace omath
|
||||
{
|
||||
template<class Type>
|
||||
requires std::is_arithmetic_v<Type>
|
||||
class Vector4 : public Vector3<Type>
|
||||
{
|
||||
public:
|
||||
Type w;
|
||||
|
||||
constexpr Vector4(const Type& x, const Type& y, const Type& z, const Type& w): Vector3<Type>(x, y, z), w(w)
|
||||
{
|
||||
}
|
||||
constexpr Vector4() noexcept: Vector3<Type>(), w(static_cast<Type>(0)) {};
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr bool operator==(const Vector4& other) const noexcept
|
||||
{
|
||||
return Vector3<Type>::operator==(other) && w == other.w;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr bool operator!=(const Vector4& other) const noexcept
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
constexpr Vector4& operator+=(const Vector4& other) noexcept
|
||||
{
|
||||
Vector3<Type>::operator+=(other);
|
||||
w += other.w;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector4& operator-=(const Vector4& other) noexcept
|
||||
{
|
||||
Vector3<Type>::operator-=(other);
|
||||
w -= other.w;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector4& operator*=(const Type& value) noexcept
|
||||
{
|
||||
Vector3<Type>::operator*=(value);
|
||||
w *= value;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector4& operator*=(const Vector4& other) noexcept
|
||||
{
|
||||
Vector3<Type>::operator*=(other);
|
||||
w *= other.w;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector4& operator/=(const Type& value) noexcept
|
||||
{
|
||||
Vector3<Type>::operator/=(value);
|
||||
w /= value;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr Vector4& operator/=(const Vector4& other) noexcept
|
||||
{
|
||||
Vector3<Type>::operator/=(other);
|
||||
w /= other.w;
|
||||
return *this;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Type length_sqr() const noexcept
|
||||
{
|
||||
return Vector3<Type>::length_sqr() + w * w;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Type dot(const Vector4& other) const noexcept
|
||||
{
|
||||
return Vector3<Type>::dot(other) + w * other.w;
|
||||
}
|
||||
|
||||
[[nodiscard]] Type length() const noexcept
|
||||
{
|
||||
return std::sqrt(length_sqr());
|
||||
}
|
||||
|
||||
constexpr Vector4& abs() noexcept
|
||||
{
|
||||
Vector3<Type>::abs();
|
||||
w = w < 0.f ? -w : w;
|
||||
|
||||
return *this;
|
||||
}
|
||||
constexpr Vector4& clamp(const Type& min, const Type& max) noexcept
|
||||
{
|
||||
this->x = std::clamp(this->x, min, max);
|
||||
this->y = std::clamp(this->y, min, max);
|
||||
this->z = std::clamp(this->z, min, max);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector4 operator-() const noexcept
|
||||
{
|
||||
return {-this->x, -this->y, -this->z, -w};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector4 operator+(const Vector4& other) const noexcept
|
||||
{
|
||||
return {this->x + other.x, this->y + other.y, this->z + other.z, w + other.w};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector4 operator-(const Vector4& other) const noexcept
|
||||
{
|
||||
return {this->x - other.x, this->y - other.y, this->z - other.z, w - other.w};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector4 operator*(const Type& value) const noexcept
|
||||
{
|
||||
return {this->x * value, this->y * value, this->z * value, w * value};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector4 operator*(const Vector4& other) const noexcept
|
||||
{
|
||||
return {this->x * other.x, this->y * other.y, this->z * other.z, w * other.w};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector4 operator/(const Type& value) const noexcept
|
||||
{
|
||||
return {this->x / value, this->y / value, this->z / value, w / value};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector4 operator/(const Vector4& other) const noexcept
|
||||
{
|
||||
return {this->x / other.x, this->y / other.y, this->z / other.z, w / other.w};
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Type sum() const noexcept
|
||||
{
|
||||
return Vector3<Type>::sum() + w;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
bool operator<(const Vector4& other) const noexcept
|
||||
{
|
||||
return length() < other.length();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
bool operator>(const Vector4& other) const noexcept
|
||||
{
|
||||
return length() > other.length();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
bool operator<=(const Vector4& other) const noexcept
|
||||
{
|
||||
return length() <= other.length();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
bool operator>=(const Vector4& other) const noexcept
|
||||
{
|
||||
return length() >= other.length();
|
||||
}
|
||||
|
||||
#ifdef OMATH_IMGUI_INTEGRATION
|
||||
[[nodiscard]]
|
||||
ImVec4 to_im_vec4() const noexcept
|
||||
{
|
||||
return {
|
||||
static_cast<float>(this->x),
|
||||
static_cast<float>(this->y),
|
||||
static_cast<float>(this->z),
|
||||
static_cast<float>(w),
|
||||
};
|
||||
}
|
||||
[[nodiscard]]
|
||||
static Vector4<float> from_im_vec4(const ImVec4& other) noexcept
|
||||
{
|
||||
return {static_cast<Type>(other.x), static_cast<Type>(other.y), static_cast<Type>(other.z)};
|
||||
}
|
||||
#endif
|
||||
};
|
||||
} // namespace omath
|
||||
|
||||
template<class Type>
|
||||
struct std::formatter<omath::Vector4<Type>> // NOLINT(*-dcl58-cpp)
|
||||
{
|
||||
[[nodiscard]]
|
||||
static constexpr auto parse(std::format_parse_context& ctx)
|
||||
{
|
||||
return ctx.begin();
|
||||
}
|
||||
[[nodiscard]]
|
||||
static auto format(const omath::Vector4<Type>& vec, std::format_context& ctx)
|
||||
{
|
||||
return std::format_to(ctx.out(), "[{}, {}, {}, {}]", vec.x, vec.y, vec.z, vec.w);
|
||||
}
|
||||
};
|
||||
@@ -3,15 +3,13 @@
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include "omath/omath_export.hpp"
|
||||
|
||||
namespace omath
|
||||
{
|
||||
template<class PitchType, class YawType, class RollType>
|
||||
struct OMATH_API ViewAngles
|
||||
struct ViewAngles
|
||||
{
|
||||
PitchType pitch;
|
||||
YawType yaw;
|
||||
RollType roll;
|
||||
};
|
||||
}
|
||||
} // namespace omath
|
||||
54
source/3d_primitives/box.cpp
Normal file
54
source/3d_primitives/box.cpp
Normal file
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// Created by Vlad on 4/18/2025.
|
||||
//
|
||||
#include "omath/3d_primitives/box.hpp"
|
||||
|
||||
namespace omath::primitives
|
||||
{
|
||||
std::array<Triangle<Vector3<float>>, 12> create_box(const Vector3<float>& top, const Vector3<float>& bottom,
|
||||
const Vector3<float>& dir_forward,
|
||||
const Vector3<float>& dir_right, const float ratio) noexcept
|
||||
{
|
||||
const auto height = top.distance_to(bottom);
|
||||
const auto side_size = height / ratio;
|
||||
|
||||
// corner layout (0‑3 bottom, 4‑7 top)
|
||||
std::array<Vector3<float>, 8> p;
|
||||
p[0] = bottom + (dir_forward + dir_right) * side_size; // front‑right‑bottom
|
||||
p[1] = bottom + (dir_forward - dir_right) * side_size; // front‑left‑bottom
|
||||
p[2] = bottom + (-dir_forward + dir_right) * side_size; // back‑right‑bottom
|
||||
p[3] = bottom + (-dir_forward - dir_right) * side_size; // back‑left‑bottom
|
||||
p[4] = top + (dir_forward + dir_right) * side_size; // front‑right‑top
|
||||
p[5] = top + (dir_forward - dir_right) * side_size; // front‑left‑top
|
||||
p[6] = top + (-dir_forward + dir_right) * side_size; // back‑right‑top
|
||||
p[7] = top + (-dir_forward - dir_right) * side_size; // back‑left‑top
|
||||
|
||||
std::array<Triangle<Vector3<float>>, 12> poly;
|
||||
|
||||
// bottom face (+Y up ⇒ wind CW when viewed from above)
|
||||
poly[0] = {p[0], p[2], p[3]};
|
||||
poly[1] = {p[0], p[3], p[1]};
|
||||
|
||||
// top face
|
||||
poly[2] = {p[4], p[7], p[6]};
|
||||
poly[3] = {p[4], p[5], p[7]};
|
||||
|
||||
// front face
|
||||
poly[4] = {p[0], p[5], p[1]};
|
||||
poly[5] = {p[0], p[4], p[5]};
|
||||
|
||||
// right face
|
||||
poly[6] = {p[0], p[6], p[2]};
|
||||
poly[7] = {p[0], p[4], p[6]};
|
||||
|
||||
// back face
|
||||
poly[8] = {p[2], p[7], p[3]};
|
||||
poly[9] = {p[2], p[6], p[7]};
|
||||
|
||||
// left face
|
||||
poly[10] = {p[1], p[7], p[5]};
|
||||
poly[11] = {p[1], p[3], p[7]};
|
||||
|
||||
return poly;
|
||||
}
|
||||
} // namespace omath::primitives
|
||||
@@ -1,14 +0,0 @@
|
||||
target_sources(omath PRIVATE
|
||||
Vector3.cpp
|
||||
Matrix.cpp
|
||||
color.cpp
|
||||
Vector4.cpp
|
||||
Vector2.cpp
|
||||
Triangle3d.cpp
|
||||
)
|
||||
|
||||
add_subdirectory(prediction)
|
||||
add_subdirectory(pathfinding)
|
||||
add_subdirectory(projection)
|
||||
add_subdirectory(collision)
|
||||
add_subdirectory(engines)
|
||||
@@ -1,36 +0,0 @@
|
||||
#include "omath/Triangle3d.hpp"
|
||||
|
||||
|
||||
namespace omath
|
||||
{
|
||||
Triangle3d::Triangle3d(const Vector3 &vertex1, const Vector3 &vertex2, const Vector3 &vertex3)
|
||||
: m_vertex1(vertex1), m_vertex2(vertex2), m_vertex3(vertex3)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Vector3 Triangle3d::CalculateNormal() const
|
||||
{
|
||||
return (m_vertex1 - m_vertex2).Cross(m_vertex3 - m_vertex1).Normalized();
|
||||
}
|
||||
|
||||
float Triangle3d::SideALength() const
|
||||
{
|
||||
return m_vertex1.DistTo(m_vertex2);
|
||||
}
|
||||
|
||||
float Triangle3d::SideBLength() const
|
||||
{
|
||||
return m_vertex3.DistTo(m_vertex2);
|
||||
}
|
||||
|
||||
Vector3 Triangle3d::SideAVector() const
|
||||
{
|
||||
return m_vertex1 - m_vertex2;
|
||||
}
|
||||
|
||||
Vector3 Triangle3d::SideBVector() const
|
||||
{
|
||||
return m_vertex3 - m_vertex2;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
//
|
||||
// Created by Vlad on 02.09.2024.
|
||||
//
|
||||
#include "omath/Vector2.hpp"
|
||||
#include <cmath>
|
||||
|
||||
|
||||
namespace omath
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
//
|
||||
// Created by vlad on 10/28/23.
|
||||
//
|
||||
|
||||
#include <omath/Vector3.hpp>
|
||||
#include <cmath>
|
||||
#include <omath/Angles.hpp>
|
||||
|
||||
namespace omath
|
||||
{
|
||||
Vector3 Vector3::ViewAngleTo(const Vector3 &other) const
|
||||
{
|
||||
const float distance = DistTo(other);
|
||||
const auto delta = other - *this;
|
||||
|
||||
return
|
||||
{
|
||||
angles::RadiansToDegrees(std::asin(delta.z / distance)),
|
||||
angles::RadiansToDegrees(std::atan2(delta.y, delta.x)),
|
||||
0.f
|
||||
};
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user