mirror of
https://github.com/orange-cpp/omath.git
synced 2026-06-09 08:44:35 +00:00
Compare commits
115 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4f0cfd4cef | |||
| 8c03a07600 | |||
| 498df95e3e | |||
| 7ad0e3f10b | |||
| 4372f429ae | |||
| 077653e5ce | |||
| 5ec26f9def | |||
| f48232cc1d | |||
| 32b1b90414 | |||
| 0b18129eac | |||
| 8983cfc6d9 | |||
| 123184987f | |||
| ac7aeee9be | |||
| 1d8dba6487 | |||
| 18b0b210cf | |||
| 9e08f5bb5c | |||
| a61d3f20b7 | |||
| 4340e83914 | |||
| 1efa28d676 | |||
| f393d0c1c3 | |||
| 55c5bb92da | |||
| 6f203e3a20 | |||
| 038de53783 | |||
| fde3e1dcb9 | |||
| 6153478d6e | |||
| 4a6ddb230b | |||
| bb61e2303e | |||
| 522597c196 | |||
| 9709ba8f61 | |||
| 5111695d84 | |||
| 50bfc3e943 | |||
| 15f2a3917f | |||
| dede0a145d | |||
| 4238c94fc0 | |||
| 6a6c265501 | |||
| d061f67d13 | |||
| 1546d8a90f | |||
| 55c7922b24 | |||
| 1af9eccad9 | |||
| 1c58340404 | |||
| 860686cb92 | |||
| fbacfa10ec | |||
| 62ad7157ff | |||
| 92689fbf21 | |||
| fe1ff12f74 | |||
| b19a4de904 | |||
| 392a204dd1 | |||
| 7b99e1f296 | |||
| d5eb607900 | |||
| 2965ab1b25 | |||
| e1b1471935 | |||
| e8925af4c1 | |||
| abf068262d | |||
| 7107b9c28f | |||
| 6b7c28e2a8 | |||
| f517ce7b5b | |||
| 9cbf9b2e5e | |||
| 2a4ad1c73a | |||
| bd0410fcac | |||
| 1f54cf50d2 | |||
| ddafd24ea6 | |||
| bdbf596647 | |||
| 2d4843700d | |||
| 28b3aecf9d | |||
| 16d6a5d038 | |||
| 2aa907a1c3 | |||
| ffba73271b | |||
| e6627c7a06 | |||
| ef86da13ad | |||
| 07de3d27ec | |||
| 8e7e1dfc42 | |||
| 46ae5668ab | |||
| cdde09c70c | |||
| 5ccd3a454a | |||
| 330e1cbfb4 | |||
| 62c86fdc09 | |||
| 0bda75e346 | |||
| 24a80c4f14 | |||
| 94bc18ba18 | |||
| 7f2084969f | |||
| b4fbcba8f2 | |||
| c792c92192 | |||
| 1f4b10f336 | |||
| 741c4e5396 | |||
| 7556e9134b | |||
| db6159f8f1 | |||
| 7a9fa626e4 | |||
| 5be521ad2c | |||
| 9ad71be0da | |||
| a3b6435bac | |||
| 0abfeba109 | |||
| 5c9b36a03c | |||
| 628361aff8 | |||
| 0e403f916d | |||
| a6fc92dd3a | |||
| b16157e976 | |||
| d66ccf2f74 | |||
| 5b66a53f08 | |||
| 6c5c86b850 | |||
| da528d2884 | |||
| 095519e035 | |||
| 0fe5b6b7a1 | |||
| b82106a565 | |||
| 0cae66b9c7 | |||
| b621308346 | |||
| bd2b14c047 | |||
| 1ff591ff48 | |||
| f8f746bfbb | |||
| cadb2b6285 | |||
| 0ee4db4c5b | |||
| 5425b60f6e | |||
| 30d8db8b36 | |||
| 2bc23d42c0 | |||
| e68ca673c9 | |||
| 77bf19da2d |
@@ -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.
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
name: Custom issue template
|
||||||
|
about: Describe this issue template's purpose here.
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
@@ -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.
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
+3
-2
@@ -1,4 +1,5 @@
|
|||||||
/cmake-build/
|
/cmake-build/
|
||||||
/.idea
|
|
||||||
/out
|
/out
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
|
/extlibs/vcpkg
|
||||||
|
.idea/workspace.xml
|
||||||
Generated
+8
@@ -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
|
||||||
Generated
+209
@@ -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>
|
||||||
Generated
+6
@@ -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>
|
||||||
Generated
+6
@@ -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>
|
||||||
Generated
+435
@@ -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
@@ -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
@@ -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>
|
||||||
Generated
+12
@@ -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>
|
||||||
Generated
+8
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/omath.iml" filepath="$PROJECT_DIR$/.idea/omath.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+2
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
||||||
Generated
+7
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
<mapping directory="$PROJECT_DIR$/extlibs/googletest" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
+27
-5
@@ -1,11 +1,11 @@
|
|||||||
cmake_minimum_required(VERSION 3.26)
|
cmake_minimum_required(VERSION 3.26)
|
||||||
|
|
||||||
project(omath VERSION 3.0.2 LANGUAGES CXX)
|
project(omath VERSION 3.5.0 LANGUAGES CXX)
|
||||||
|
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
|
|
||||||
|
|
||||||
option(OMATH_BUILD_TESTS "Build unit tests" OFF)
|
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_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_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_USE_AVX2 "Omath will use AVX2 to boost performance" ON)
|
||||||
@@ -13,7 +13,19 @@ option(OMATH_IMGUI_INTEGRATION "Omath will define method to convert omath types
|
|||||||
option(OMATH_BUILD_EXAMPLES "Build example projects with you can learn & play" 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_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_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_USE_UNITY_BUILD "Will enable unity build to speed up compilation" OFF)
|
||||||
|
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_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp")
|
||||||
file(GLOB_RECURSE OMATH_HEADERS CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp")
|
file(GLOB_RECURSE OMATH_HEADERS CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp")
|
||||||
@@ -25,10 +37,10 @@ else ()
|
|||||||
add_library(${PROJECT_NAME} STATIC ${OMATH_SOURCES} ${OMATH_HEADERS})
|
add_library(${PROJECT_NAME} STATIC ${OMATH_SOURCES} ${OMATH_HEADERS})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
message(STATUS "[OMATH]: Building on ${CMAKE_HOST_SYSTEM_NAME}")
|
|
||||||
|
|
||||||
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
|
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
|
||||||
|
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PUBLIC OMATH_VERSION="${PROJECT_VERSION}")
|
||||||
|
|
||||||
if (OMATH_IMGUI_INTEGRATION)
|
if (OMATH_IMGUI_INTEGRATION)
|
||||||
target_compile_definitions(${PROJECT_NAME} PUBLIC OMATH_IMGUI_INTEGRATION)
|
target_compile_definitions(${PROJECT_NAME} PUBLIC OMATH_IMGUI_INTEGRATION)
|
||||||
|
|
||||||
@@ -56,6 +68,10 @@ if (OMATH_SUPRESS_SAFETY_CHECKS)
|
|||||||
target_compile_definitions(${PROJECT_NAME} PUBLIC OMATH_SUPRESS_SAFETY_CHECKS)
|
target_compile_definitions(${PROJECT_NAME} PUBLIC OMATH_SUPRESS_SAFETY_CHECKS)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if (OMATH_ENABLE_LEGACY)
|
||||||
|
target_compile_options(${PROJECT_NAME} PUBLIC OMATH_ENABLE_LEGACY)
|
||||||
|
endif ()
|
||||||
|
|
||||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
|
||||||
@@ -84,6 +100,7 @@ target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_23)
|
|||||||
if (OMATH_BUILD_TESTS)
|
if (OMATH_BUILD_TESTS)
|
||||||
add_subdirectory(extlibs)
|
add_subdirectory(extlibs)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PUBLIC OMATH_BUILD_TESTS)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (OMATH_BUILD_EXAMPLES)
|
if (OMATH_BUILD_EXAMPLES)
|
||||||
@@ -96,6 +113,11 @@ elseif (OMATH_THREAT_WARNING_AS_ERROR)
|
|||||||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# 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}
|
target_include_directories(${PROJECT_NAME}
|
||||||
PUBLIC
|
PUBLIC
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> # Use this path when building the project
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> # Use this path when building the project
|
||||||
|
|||||||
@@ -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.
|
||||||
+2
-2
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
Thanks to everyone who made this possible, including:
|
Thanks to everyone who made this possible, including:
|
||||||
|
|
||||||
- Saikari aka luadebug for VCPKG port.
|
- Saikari aka luadebug for VCPKG port and awesome new initial logo design.
|
||||||
|
|
||||||
And a big hand to everyone else who has contributed over the past!
|
And a big hand to everyone else who has contributed over the past!
|
||||||
|
|
||||||
THANKS! <3
|
THANKS! <3
|
||||||
|
|
||||||
-- Orange++ <orange-cpp@yandex.ru>
|
-- Orange++ <orange_github@proton.me>
|
||||||
|
|||||||
+14
@@ -14,6 +14,20 @@ 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).
|
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
|
## <img width="28px" src="https://upload.wikimedia.org/wikipedia/commons/e/ef/CMake_logo.svg?" /> Build from source using CMake
|
||||||
1. **Preparation**
|
1. **Preparation**
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Copyright (C) 2024-2025 Orange++ <orange-cpp@yandex.ru>
|
Copyright (C) 2024-2025 Orange++ <orange_github@proton.me>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -14,4 +14,15 @@ freely, subject to the following restrictions:
|
|||||||
appreciated but is not required.
|
appreciated but is not required.
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
2. Altered source versions must be plainly marked as such, and must not be
|
||||||
misrepresented as being the original software.
|
misrepresented as being the original software.
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
4. If you are an employee, contractor, volunteer, representative,
|
||||||
|
or have any other affiliation (past, present, or future)
|
||||||
|
with any of the following entities:
|
||||||
|
* "Yandex" LLC
|
||||||
|
* "Rutube" LLC
|
||||||
|
Or if you represent or are associated with any legal, organizational, or
|
||||||
|
professional entity providing services to or on behalf of the aforementioned entities:
|
||||||
|
You are expressly forbidden from accessing, using, modifying, distributing, or
|
||||||
|
interacting with the Software and its source code in any form. You must immediately
|
||||||
|
delete or destroy any physical or digital copies of the Software and/or
|
||||||
|
its source code, including any derivative works, tools, or information obtained from the Software.
|
||||||
|
|||||||
@@ -1,16 +1,45 @@
|
|||||||
<div align = center>
|
<div align = center>
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||

|

|
||||||

|

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

|

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

|

|
||||||
|
[](https://discord.gg/eDgdaWbqwZ)
|
||||||
|
[](https://t.me/orangennotes)
|
||||||
|
|
||||||
|
OMath is a 100% independent, constexpr template blazingly fast math library that doesn't have legacy C++ code.
|
||||||
|
|
||||||
|
It provides the latest features, is highly customizable, has all for cheat development, DirectX/OpenGL/Vulkan support, premade support for different game engines, much more constexpr stuff than in other libraries and more...
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**[<kbd> <br> Install <br> </kbd>][INSTALL]**
|
||||||
|
**[<kbd> <br> Examples <br> </kbd>][EXAMPLES]**
|
||||||
|
**[<kbd> <br> Contribute <br> </kbd>][CONTRIBUTING]**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
</div>
|
</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.
|
|
||||||
|
<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
|
## 👁🗨 Features
|
||||||
- **Efficiency**: Optimized for performance, ensuring quick computations using AVX2.
|
- **Efficiency**: Optimized for performance, ensuring quick computations using AVX2.
|
||||||
@@ -22,13 +51,37 @@ Oranges's Math Library (omath) is a comprehensive, open-source library aimed at
|
|||||||
- **No Additional Dependencies**: No additional dependencies need to use OMath except unit test execution
|
- **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!
|
- **Ready for meta-programming**: Omath use templates for common types like Vectors, Matrixes etc, to handle all types!
|
||||||
|
|
||||||
|
# Gallery
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
[](https://youtu.be/lM_NJ1yCunw?si=-Qf5yzDcWbaxAXGQ)
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
![APEX Preview]
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
![BO2 Preview]
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
![CS2 Preview]
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Supported Render Pipelines
|
## Supported Render Pipelines
|
||||||
| ENGINE | SUPPORT |
|
| ENGINE | SUPPORT |
|
||||||
|----------|---------|
|
|----------|---------|
|
||||||
| Source | ✅YES |
|
| Source | ✅YES |
|
||||||
| Unity | ✅YES |
|
| Unity | ✅YES |
|
||||||
| IWEngine | ✅YES |
|
| IWEngine | ✅YES |
|
||||||
| Unreal | ❌NO |
|
| OpenGL | ✅YES |
|
||||||
|
| Unreal | ✅YES |
|
||||||
|
|
||||||
## Supported Operating Systems
|
## Supported Operating Systems
|
||||||
|
|
||||||
@@ -38,40 +91,37 @@ Oranges's Math Library (omath) is a comprehensive, open-source library aimed at
|
|||||||
| Linux | ✅YES |
|
| Linux | ✅YES |
|
||||||
| Darwin (MacOS) | ✅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
|
## ❔ Usage
|
||||||
Simple world to screen function
|
ESP example
|
||||||
```c++
|
```c++
|
||||||
TEST(UnitTestProjection, IsPointOnScreen)
|
omath::source_engine::Camera cam{localPlayer.GetCameraOrigin(),
|
||||||
{
|
localPlayer.GetAimPunch(),
|
||||||
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);
|
{1920.f, 1080.f},
|
||||||
|
localPlayer.GetFieldOfView(),
|
||||||
|
0.01.f, 30000.f};
|
||||||
|
|
||||||
const auto proj = camera.WorldToScreen({100, 0, 15});
|
for (auto ent: apex_sdk::EntityList::GetAllEntities())
|
||||||
EXPECT_TRUE(proj.has_value());
|
{
|
||||||
|
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 (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
|
|
||||||
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.
|
|
||||||
|
|
||||||
## 💘 Acknowledgments
|
## 💘 Acknowledgments
|
||||||
- [All contributors](https://github.com/orange-cpp/omath/graphs/contributors)
|
- [All contributors](https://github.com/orange-cpp/omath/graphs/contributors)
|
||||||
|
|
||||||
|
<!----------------------------------{ Images }--------------------------------->
|
||||||
|
[APEX Preview]: .github/images/showcase/apex.png
|
||||||
|
[BO2 Preview]: .github/images/showcase/cod_bo2.png
|
||||||
|
[CS2 Preview]: .github/images/showcase/cs2.jpeg
|
||||||
|
|
||||||
|
<!----------------------------------{ Buttons }--------------------------------->
|
||||||
|
[INSTALL]: INSTALL.md
|
||||||
|
[CONTRIBUTING]: CONTRIBUTING.md
|
||||||
|
[EXAMPLES]: examples
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
Please report security issues to `orange-cpp@yandex.ru`
|
Please report security issues to `orange_github@proton.me`
|
||||||
|
|||||||
+1
-1
Submodule extlibs/googletest updated: d83fee138a...52eb8108c5
@@ -3,10 +3,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <array>
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
#include "omath/triangle.hpp"
|
#include "omath/triangle.hpp"
|
||||||
#include "omath/vector3.hpp"
|
#include <array>
|
||||||
|
|
||||||
|
|
||||||
namespace omath::primitives
|
namespace omath::primitives
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 8/28/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
|
#include "omath/triangle.hpp"
|
||||||
|
#include <array>
|
||||||
|
|
||||||
|
namespace omath::primitives
|
||||||
|
{
|
||||||
|
[[nodiscard]]
|
||||||
|
std::array<Triangle<Vector3<float>>, 2> create_plane(const Vector3<float>& vertex_a,
|
||||||
|
const Vector3<float>& vertex_b,
|
||||||
|
const Vector3<float>& direction, float size) noexcept;
|
||||||
|
}
|
||||||
+24
-4
@@ -5,6 +5,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "omath/angles.hpp"
|
#include "omath/angles.hpp"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <format>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
namespace omath
|
namespace omath
|
||||||
@@ -122,13 +123,13 @@ namespace omath
|
|||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr Angle& operator+(const Angle& other) noexcept
|
constexpr Angle operator+(const Angle& other) noexcept
|
||||||
{
|
{
|
||||||
if constexpr (flags == AngleFlags::Normalized)
|
if constexpr (flags == AngleFlags::Normalized)
|
||||||
return {angles::wrap_angle(m_angle + other.m_angle, min, max)};
|
return Angle{angles::wrap_angle(m_angle + other.m_angle, min, max)};
|
||||||
|
|
||||||
else if constexpr (flags == AngleFlags::Clamped)
|
else if constexpr (flags == AngleFlags::Clamped)
|
||||||
return {std::clamp(m_angle + other.m_angle, min, max)};
|
return Angle{std::clamp(m_angle + other.m_angle, min, max)};
|
||||||
|
|
||||||
else
|
else
|
||||||
static_assert(false);
|
static_assert(false);
|
||||||
@@ -137,7 +138,7 @@ namespace omath
|
|||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr Angle& operator-(const Angle& other) noexcept
|
constexpr Angle operator-(const Angle& other) noexcept
|
||||||
{
|
{
|
||||||
return operator+(-other);
|
return operator+(-other);
|
||||||
}
|
}
|
||||||
@@ -149,3 +150,22 @@ namespace omath
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace omath
|
} // namespace omath
|
||||||
|
|
||||||
|
template<class T, T MinV, T MaxV, omath::AngleFlags F, class CharT>
|
||||||
|
struct std::formatter<omath::Angle<T, MinV, MaxV, F>, CharT>
|
||||||
|
{
|
||||||
|
using AngleT = omath::Angle<T, MinV, MaxV, F>;
|
||||||
|
[[nodiscard]]
|
||||||
|
static constexpr auto parse(std::basic_format_parse_context<CharT>& ctx)
|
||||||
|
-> std::basic_format_parse_context<CharT>::iterator
|
||||||
|
{
|
||||||
|
return ctx.begin();
|
||||||
|
}
|
||||||
|
template<class FormatContext>
|
||||||
|
auto format(const AngleT& deg, FormatContext& ctx) const
|
||||||
|
{
|
||||||
|
if constexpr (std::is_same_v<typename FormatContext::char_type, char>)
|
||||||
|
return std::format_to(ctx.out(), "{}deg", deg.as_degrees());
|
||||||
|
return std::format_to(ctx.out(), L"{}deg", deg.as_degrees());
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
#include "omath/triangle.hpp"
|
#include "omath/triangle.hpp"
|
||||||
#include "omath/vector3.hpp"
|
|
||||||
|
|
||||||
namespace omath::collision
|
namespace omath::collision
|
||||||
{
|
{
|
||||||
|
|||||||
+19
-10
@@ -4,18 +4,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "omath/vector3.hpp"
|
#include "linear_algebra/vector4.hpp"
|
||||||
#include "omath/vector4.hpp"
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#ifdef max
|
|
||||||
#undef max
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef min
|
|
||||||
#undef min
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace omath
|
namespace omath
|
||||||
{
|
{
|
||||||
struct Hsv
|
struct Hsv
|
||||||
@@ -175,3 +166,21 @@ namespace omath
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
} // namespace omath
|
} // 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));
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -5,18 +5,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "omath/engines/iw_engine/constants.hpp"
|
#include "omath/engines/iw_engine/constants.hpp"
|
||||||
#include "omath/projection/camera.hpp"
|
#include "omath/projection/camera.hpp"
|
||||||
|
#include "traits/camera_trait.hpp"
|
||||||
|
|
||||||
namespace omath::iw_engine
|
namespace omath::iw_engine
|
||||||
{
|
{
|
||||||
class Camera final : public projection::Camera<Mat4X4, ViewAngles>
|
using Camera = projection::Camera<Mat4X4, ViewAngles, CameraTrait>;
|
||||||
{
|
|
||||||
public:
|
|
||||||
Camera(const Vector3<float>& position, const ViewAngles& view_angles, const projection::ViewPort& view_port,
|
|
||||||
const Angle<float, 0.f, 180.f, AngleFlags::Clamped>& fov, float near, float far);
|
|
||||||
void look_at(const Vector3<float>& target) override;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
[[nodiscard]] Mat4X4 calc_view_matrix() const noexcept override;
|
|
||||||
[[nodiscard]] Mat4X4 calc_projection_matrix() const noexcept override;
|
|
||||||
};
|
|
||||||
} // namespace omath::iw_engine
|
} // namespace omath::iw_engine
|
||||||
@@ -3,9 +3,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include "omath/linear_algebra/mat.hpp"
|
||||||
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
#include <omath/angle.hpp>
|
#include <omath/angle.hpp>
|
||||||
#include <omath/mat.hpp>
|
|
||||||
#include <omath/vector3.hpp>
|
|
||||||
#include <omath/view_angles.hpp>
|
#include <omath/view_angles.hpp>
|
||||||
|
|
||||||
namespace omath::iw_engine
|
namespace omath::iw_engine
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -4,16 +4,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "omath/engines/opengl_engine/constants.hpp"
|
#include "omath/engines/opengl_engine/constants.hpp"
|
||||||
#include "omath/projection/camera.hpp"
|
#include "omath/projection/camera.hpp"
|
||||||
|
#include "traits/camera_trait.hpp"
|
||||||
|
|
||||||
namespace omath::opengl_engine
|
namespace omath::opengl_engine
|
||||||
{
|
{
|
||||||
class Camera final : public projection::Camera<Mat4X4, ViewAngles>
|
using Camera = projection::Camera<Mat4X4, ViewAngles, CameraTrait>;
|
||||||
{
|
|
||||||
public:
|
|
||||||
Camera(const Vector3<float>& position, const ViewAngles& view_angles, const projection::ViewPort& view_port,
|
|
||||||
const Angle<float, 0.f, 180.f, AngleFlags::Clamped>& fov, float near, float far);
|
|
||||||
void look_at(const Vector3<float>& target) override;
|
|
||||||
[[nodiscard]] Mat4X4 calc_view_matrix() const noexcept override;
|
|
||||||
[[nodiscard]] Mat4X4 calc_projection_matrix() const noexcept override;
|
|
||||||
};
|
|
||||||
} // namespace omath::opengl_engine
|
} // namespace omath::opengl_engine
|
||||||
@@ -3,9 +3,9 @@
|
|||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "omath/linear_algebra/mat.hpp"
|
||||||
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
#include <omath/angle.hpp>
|
#include <omath/angle.hpp>
|
||||||
#include <omath/mat.hpp>
|
|
||||||
#include <omath/vector3.hpp>
|
|
||||||
#include <omath/view_angles.hpp>
|
#include <omath/view_angles.hpp>
|
||||||
|
|
||||||
namespace omath::opengl_engine
|
namespace omath::opengl_engine
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -4,18 +4,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "omath/engines/source_engine/constants.hpp"
|
#include "omath/engines/source_engine/constants.hpp"
|
||||||
#include "omath/projection/camera.hpp"
|
#include "omath/projection/camera.hpp"
|
||||||
|
#include "traits/camera_trait.hpp"
|
||||||
namespace omath::source_engine
|
namespace omath::source_engine
|
||||||
{
|
{
|
||||||
class Camera final : public projection::Camera<Mat4X4, ViewAngles>
|
using Camera = projection::Camera<Mat4X4, ViewAngles, CameraTrait>;
|
||||||
{
|
|
||||||
public:
|
|
||||||
Camera(const Vector3<float>& position, const ViewAngles& view_angles, const projection::ViewPort& view_port,
|
|
||||||
const Angle<float, 0.f, 180.f, AngleFlags::Clamped>& fov, float near, float far);
|
|
||||||
void look_at(const Vector3<float>& target) override;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
[[nodiscard]] Mat4X4 calc_view_matrix() const noexcept override;
|
|
||||||
[[nodiscard]] Mat4X4 calc_projection_matrix() const noexcept override;
|
|
||||||
};
|
|
||||||
} // namespace omath::source_engine
|
} // namespace omath::source_engine
|
||||||
@@ -3,9 +3,9 @@
|
|||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "omath/linear_algebra/mat.hpp"
|
||||||
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
#include <omath/angle.hpp>
|
#include <omath/angle.hpp>
|
||||||
#include <omath/mat.hpp>
|
|
||||||
#include <omath/vector3.hpp>
|
|
||||||
#include <omath/view_angles.hpp>
|
#include <omath/view_angles.hpp>
|
||||||
|
|
||||||
namespace omath::source_engine
|
namespace omath::source_engine
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -5,18 +5,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "omath/engines/unity_engine/constants.hpp"
|
#include "omath/engines/unity_engine/constants.hpp"
|
||||||
#include "omath/projection/camera.hpp"
|
#include "omath/projection/camera.hpp"
|
||||||
|
#include "traits/camera_trait.hpp"
|
||||||
|
|
||||||
namespace omath::unity_engine
|
namespace omath::unity_engine
|
||||||
{
|
{
|
||||||
class Camera final : public projection::Camera<Mat4X4, ViewAngles>
|
using Camera = projection::Camera<Mat4X4, ViewAngles, CameraTrait>;
|
||||||
{
|
|
||||||
public:
|
|
||||||
Camera(const Vector3<float>& position, const ViewAngles& view_angles, const projection::ViewPort& view_port,
|
|
||||||
const Angle<float, 0.f, 180.f, AngleFlags::Clamped>& fov, float near, float far);
|
|
||||||
void look_at(const Vector3<float>& target) override;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
[[nodiscard]] Mat4X4 calc_view_matrix() const noexcept override;
|
|
||||||
[[nodiscard]] Mat4X4 calc_projection_matrix() const noexcept override;
|
|
||||||
};
|
|
||||||
} // namespace omath::unity_engine
|
} // namespace omath::unity_engine
|
||||||
@@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "omath/linear_algebra/mat.hpp"
|
||||||
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
#include <omath/angle.hpp>
|
#include <omath/angle.hpp>
|
||||||
#include <omath/mat.hpp>
|
|
||||||
#include <omath/vector3.hpp>
|
|
||||||
#include <omath/view_angles.hpp>
|
#include <omath/view_angles.hpp>
|
||||||
|
|
||||||
namespace omath::unity_engine
|
namespace omath::unity_engine
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 3/22/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "omath/linear_algebra/mat.hpp"
|
||||||
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
|
#include <omath/angle.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
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
// Created by vlad on 9/29/2024.
|
// Created by vlad on 9/29/2024.
|
||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "omath/vector3.hpp"
|
#include "vector3.hpp"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
@@ -11,13 +11,6 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#ifdef near
|
|
||||||
#undef near
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef far
|
|
||||||
#undef far
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace omath
|
namespace omath
|
||||||
{
|
{
|
||||||
@@ -88,7 +81,7 @@ namespace omath
|
|||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr Type& operator[](const size_t row, const size_t col) const
|
constexpr const Type& operator[](const size_t row, const size_t col) const
|
||||||
{
|
{
|
||||||
return at(row, col);
|
return at(row, col);
|
||||||
}
|
}
|
||||||
@@ -479,4 +472,49 @@ namespace omath
|
|||||||
{0.f, 0.f, -(far + near) / (far - near), -(2.f * near * far) / (far - near)},
|
{0.f, 0.f, -(far + near) / (far - near), -(2.f * near * far) / (far - near)},
|
||||||
{0.f, 0.f, -1.f, 0.f}};
|
{0.f, 0.f, -1.f, 0.f}};
|
||||||
}
|
}
|
||||||
|
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR>
|
||||||
|
[[nodiscard]]
|
||||||
|
Mat<4, 4, Type, St> mat_ortho_left_handed(const Type left, const Type right,
|
||||||
|
const Type bottom, const Type top,
|
||||||
|
const Type near, const Type far) noexcept
|
||||||
|
{
|
||||||
|
return
|
||||||
|
{
|
||||||
|
{ static_cast<Type>(2) / (right - left), 0.f, 0.f, -(right + left) / (right - left)},
|
||||||
|
{ 0.f, static_cast<Type>(2) / (top - bottom), 0.f, -(top + bottom) / (top - bottom)},
|
||||||
|
{ 0.f, 0.f, static_cast<Type>(2) / (far - near), -(far + near) / (far - near) },
|
||||||
|
{ 0.f, 0.f, 0.f, 1.f }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR>
|
||||||
|
[[nodiscard]]
|
||||||
|
Mat<4, 4, Type, St> mat_ortho_right_handed(const Type left, const Type right,
|
||||||
|
const Type bottom, const Type top,
|
||||||
|
const Type near, const Type far) noexcept
|
||||||
|
{
|
||||||
|
return
|
||||||
|
{
|
||||||
|
{ static_cast<Type>(2) / (right - left), 0.f, 0.f, -(right + left) / (right - left)},
|
||||||
|
{ 0.f, static_cast<Type>(2) / (top - bottom), 0.f, -(top + bottom) / (top - bottom)},
|
||||||
|
{ 0.f, 0.f, -static_cast<Type>(2) / (far - near), -(far + near) / (far - near) },
|
||||||
|
{ 0.f, 0.f, 0.f, 1.f }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace omath
|
} // 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());
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <format>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
#ifdef OMATH_IMGUI_INTEGRATION
|
#ifdef OMATH_IMGUI_INTEGRATION
|
||||||
@@ -142,7 +143,7 @@ namespace omath
|
|||||||
[[nodiscard]] Vector2 normalized() const noexcept
|
[[nodiscard]] Vector2 normalized() const noexcept
|
||||||
{
|
{
|
||||||
const Type len = length();
|
const Type len = length();
|
||||||
return len > 0.f ? *this / len : *this;
|
return len > static_cast<Type>(0) ? *this / len : *this;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
[[nodiscard]] constexpr Type length_sqr() const noexcept
|
[[nodiscard]] constexpr Type length_sqr() const noexcept
|
||||||
@@ -153,8 +154,8 @@ namespace omath
|
|||||||
constexpr Vector2& abs() noexcept
|
constexpr Vector2& abs() noexcept
|
||||||
{
|
{
|
||||||
// FIXME: Replace with std::abs, if it will become constexprable
|
// FIXME: Replace with std::abs, if it will become constexprable
|
||||||
x = x < 0 ? -x : x;
|
x = x < static_cast<Type>(0) ? -x : x;
|
||||||
y = y < 0 ? -y : y;
|
y = y < static_cast<Type>(0) ? -y : y;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,18 +191,60 @@ namespace omath
|
|||||||
return x + y;
|
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]]
|
[[nodiscard]]
|
||||||
constexpr std::tuple<Type, Type> as_tuple() const noexcept
|
constexpr std::tuple<Type, Type> as_tuple() const noexcept
|
||||||
{
|
{
|
||||||
return std::make_tuple(x, y);
|
return std::make_tuple(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OMATH_IMGUI_INTEGRATION
|
#ifdef OMATH_IMGUI_INTEGRATION
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
ImVec2 to_im_vec2() const noexcept
|
ImVec2 to_im_vec2() const noexcept
|
||||||
{
|
{
|
||||||
return {static_cast<float>(this->x), static_cast<float>(this->y)};
|
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
|
#endif
|
||||||
};
|
};
|
||||||
} // namespace omath
|
} // 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);
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "omath/angle.hpp"
|
#include "omath/angle.hpp"
|
||||||
#include "omath/vector2.hpp"
|
#include "omath/linear_algebra/vector2.hpp"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <expected>
|
#include <expected>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@@ -151,7 +151,7 @@ namespace omath
|
|||||||
{
|
{
|
||||||
const Type len = this->length();
|
const Type len = this->length();
|
||||||
|
|
||||||
return len != 0 ? *this / len : *this;
|
return len != static_cast<Type>(0) ? *this / len : *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] Type length_2d() const noexcept
|
[[nodiscard]] Type length_2d() const noexcept
|
||||||
@@ -159,9 +159,9 @@ namespace omath
|
|||||||
return Vector2<Type>::length();
|
return Vector2<Type>::length();
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] Type distance_to(const Vector3& vOther) const noexcept
|
[[nodiscard]] Type distance_to(const Vector3& v_other) const noexcept
|
||||||
{
|
{
|
||||||
return (*this - vOther).length();
|
return (*this - v_other).length();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ namespace omath
|
|||||||
{
|
{
|
||||||
const auto bottom = length() * other.length();
|
const auto bottom = length() * other.length();
|
||||||
|
|
||||||
if (bottom == 0.f)
|
if (bottom == static_cast<Type>(0))
|
||||||
return std::unexpected(Vector3Error::IMPOSSIBLE_BETWEEN_ANGLE);
|
return std::unexpected(Vector3Error::IMPOSSIBLE_BETWEEN_ANGLE);
|
||||||
|
|
||||||
return Angle<float, 0.f, 180.f, AngleFlags::Clamped>::from_radians(std::acos(dot(other) / bottom));
|
return Angle<float, 0.f, 180.f, AngleFlags::Clamped>::from_radians(std::acos(dot(other) / bottom));
|
||||||
@@ -230,7 +230,7 @@ namespace omath
|
|||||||
[[nodiscard]] bool is_perpendicular(const Vector3& other) const noexcept
|
[[nodiscard]] bool is_perpendicular(const Vector3& other) const noexcept
|
||||||
{
|
{
|
||||||
if (const auto angle = angle_between(other))
|
if (const auto angle = angle_between(other))
|
||||||
return angle->as_degrees() == 90.f;
|
return angle->as_degrees() == static_cast<Type>(90);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -253,23 +253,59 @@ namespace omath
|
|||||||
return {angles::radians_to_degrees(std::asin(delta.z / distance)),
|
return {angles::radians_to_degrees(std::asin(delta.z / distance)),
|
||||||
angles::radians_to_degrees(std::atan2(delta.y, delta.x)), 0};
|
angles::radians_to_degrees(std::atan2(delta.y, delta.x)), 0};
|
||||||
}
|
}
|
||||||
};
|
|
||||||
} // namespace omath
|
[[nodiscard]]
|
||||||
// ReSharper disable once CppRedundantNamespaceDefinition
|
bool operator<(const Vector3& other) const noexcept
|
||||||
namespace std
|
|
||||||
{
|
|
||||||
template<> struct hash<omath::Vector3<float>>
|
|
||||||
{
|
|
||||||
std::size_t operator()(const omath::Vector3<float>& vec) const noexcept
|
|
||||||
{
|
{
|
||||||
std::size_t hash = 0;
|
return length() < other.length();
|
||||||
constexpr std::hash<float> hasher;
|
}
|
||||||
|
|
||||||
hash ^= hasher(vec.x) + 0x9e3779b9 + (hash << 6) + (hash >> 2);
|
[[nodiscard]]
|
||||||
hash ^= hasher(vec.y) + 0x9e3779b9 + (hash << 6) + (hash >> 2);
|
bool operator>(const Vector3& other) const noexcept
|
||||||
hash ^= hasher(vec.z) + 0x9e3779b9 + (hash << 6) + (hash >> 2);
|
{
|
||||||
|
return length() > other.length();
|
||||||
|
}
|
||||||
|
|
||||||
return hash;
|
[[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 std
|
} // 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);
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <omath/vector3.hpp>
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
|
|
||||||
namespace omath
|
namespace omath
|
||||||
{
|
{
|
||||||
@@ -18,7 +18,7 @@ namespace omath
|
|||||||
constexpr Vector4(const Type& x, const Type& y, const Type& z, const Type& w): Vector3<Type>(x, y, z), w(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(0) {};
|
constexpr Vector4() noexcept: Vector3<Type>(), w(static_cast<Type>(0)) {};
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr bool operator==(const Vector4& other) const noexcept
|
constexpr bool operator==(const Vector4& other) const noexcept
|
||||||
@@ -89,7 +89,7 @@ namespace omath
|
|||||||
return Vector3<Type>::dot(other) + w * other.w;
|
return Vector3<Type>::dot(other) + w * other.w;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] Vector3<Type> length() const noexcept
|
[[nodiscard]] Type length() const noexcept
|
||||||
{
|
{
|
||||||
return std::sqrt(length_sqr());
|
return std::sqrt(length_sqr());
|
||||||
}
|
}
|
||||||
@@ -158,6 +158,30 @@ namespace omath
|
|||||||
return Vector3<Type>::sum() + w;
|
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
|
#ifdef OMATH_IMGUI_INTEGRATION
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
ImVec4 to_im_vec4() const noexcept
|
ImVec4 to_im_vec4() const noexcept
|
||||||
@@ -169,6 +193,26 @@ namespace omath
|
|||||||
static_cast<float>(w),
|
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
|
#endif
|
||||||
};
|
};
|
||||||
} // namespace omath
|
} // 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);
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#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
|
|
||||||
@@ -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/linear_algebra/vector2.hpp"
|
||||||
|
#include "omath/linear_algebra/vector4.hpp"
|
||||||
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
|
|
||||||
|
// Matrix classes
|
||||||
|
#include "linear_algebra/matrix.hpp"
|
||||||
|
#include "omath/linear_algebra/mat.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"
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
#include "omath/pathfinding/navigation_mesh.hpp"
|
#include "omath/pathfinding/navigation_mesh.hpp"
|
||||||
#include "omath/vector3.hpp"
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace omath::pathfinding
|
namespace omath::pathfinding
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "omath/vector3.hpp"
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
#include <expected>
|
#include <expected>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
@@ -2,18 +2,18 @@
|
|||||||
// Created by Vlad on 2/23/2025.
|
// Created by Vlad on 2/23/2025.
|
||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
#include "omath/projectile_prediction/projectile.hpp"
|
#include "omath/projectile_prediction/projectile.hpp"
|
||||||
#include "omath/projectile_prediction/target.hpp"
|
#include "omath/projectile_prediction/target.hpp"
|
||||||
#include "omath/vector3.hpp"
|
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
namespace omath::projectile_prediction
|
||||||
{
|
{
|
||||||
class ProjPredEngine
|
class ProjPredEngineInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
virtual std::optional<Vector3<float>> maybe_calculate_aim_point(const Projectile& projectile,
|
virtual std::optional<Vector3<float>> maybe_calculate_aim_point(const Projectile& projectile,
|
||||||
const Target& target) const = 0;
|
const Target& target) const = 0;
|
||||||
virtual ~ProjPredEngine() = default;
|
virtual ~ProjPredEngineInterface() = default;
|
||||||
};
|
};
|
||||||
} // namespace omath::projectile_prediction
|
} // namespace omath::projectile_prediction
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
namespace omath::projectile_prediction
|
namespace omath::projectile_prediction
|
||||||
{
|
{
|
||||||
class ProjPredEngineAvx2 final : public ProjPredEngine
|
class ProjPredEngineAvx2 final : public ProjPredEngineInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
[[nodiscard]] std::optional<Vector3<float>>
|
[[nodiscard]] std::optional<Vector3<float>>
|
||||||
|
|||||||
@@ -4,23 +4,74 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
|
#include "omath/engines/source_engine/traits/pred_engine_trait.hpp"
|
||||||
#include "omath/projectile_prediction/proj_pred_engine.hpp"
|
#include "omath/projectile_prediction/proj_pred_engine.hpp"
|
||||||
#include "omath/projectile_prediction/projectile.hpp"
|
#include "omath/projectile_prediction/projectile.hpp"
|
||||||
#include "omath/projectile_prediction/target.hpp"
|
#include "omath/projectile_prediction/target.hpp"
|
||||||
#include "omath/vector3.hpp"
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
namespace omath::projectile_prediction
|
||||||
{
|
{
|
||||||
class ProjPredEngineLegacy final : public ProjPredEngine
|
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:
|
public:
|
||||||
explicit ProjPredEngineLegacy(float gravity_constant, float simulation_time_step, float maximum_simulation_time,
|
explicit ProjPredEngineLegacy(const float gravity_constant, const float simulation_time_step,
|
||||||
float distance_tolerance);
|
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]]
|
[[nodiscard]]
|
||||||
std::optional<Vector3<float>> maybe_calculate_aim_point(const Projectile& projectile,
|
std::optional<Vector3<float>> maybe_calculate_aim_point(const Projectile& projectile,
|
||||||
const Target& target) const override;
|
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:
|
private:
|
||||||
const float m_gravity_constant;
|
const float m_gravity_constant;
|
||||||
@@ -28,13 +79,56 @@ namespace omath::projectile_prediction
|
|||||||
const float m_maximum_simulation_time;
|
const float m_maximum_simulation_time;
|
||||||
const float m_distance_tolerance;
|
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]]
|
[[nodiscard]]
|
||||||
std::optional<float>
|
std::optional<float>
|
||||||
maybe_calculate_projectile_launch_pitch_angle(const Projectile& projectile,
|
maybe_calculate_projectile_launch_pitch_angle(const Projectile& projectile,
|
||||||
const Vector3<float>& target_position) const noexcept;
|
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]]
|
[[nodiscard]]
|
||||||
bool is_projectile_reached_target(const Vector3<float>& target_position, const Projectile& projectile,
|
bool is_projectile_reached_target(const Vector3<float>& target_position, const Projectile& projectile,
|
||||||
float pitch, float time) const noexcept;
|
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
|
} // namespace omath::projectile_prediction
|
||||||
|
|||||||
@@ -3,16 +3,13 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "omath/vector3.hpp"
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
namespace omath::projectile_prediction
|
||||||
{
|
{
|
||||||
class Projectile final
|
class Projectile final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
[[nodiscard]]
|
|
||||||
Vector3<float> predict_position(float pitch, float yaw, float time, float gravity) const noexcept;
|
|
||||||
|
|
||||||
Vector3<float> m_origin;
|
Vector3<float> m_origin;
|
||||||
float m_launch_speed{};
|
float m_launch_speed{};
|
||||||
float m_gravity_scale{};
|
float m_gravity_scale{};
|
||||||
|
|||||||
@@ -3,24 +3,13 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "omath/vector3.hpp"
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
namespace omath::projectile_prediction
|
||||||
{
|
{
|
||||||
class Target final
|
class Target final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
[[nodiscard]]
|
|
||||||
constexpr Vector3<float> predict_position(const float time, const float gravity) const noexcept
|
|
||||||
{
|
|
||||||
auto predicted = m_origin + m_velocity * time;
|
|
||||||
|
|
||||||
if (m_is_airborne)
|
|
||||||
predicted.z -= gravity * (time*time) * 0.5f;
|
|
||||||
|
|
||||||
return predicted;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector3<float> m_origin;
|
Vector3<float> m_origin;
|
||||||
Vector3<float> m_velocity;
|
Vector3<float> m_velocity;
|
||||||
bool m_is_airborne{};
|
bool m_is_airborne{};
|
||||||
|
|||||||
@@ -4,13 +4,18 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "omath/linear_algebra/mat.hpp"
|
||||||
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
#include "omath/projection/error_codes.hpp"
|
#include "omath/projection/error_codes.hpp"
|
||||||
#include <expected>
|
#include <expected>
|
||||||
#include <omath/angle.hpp>
|
#include <omath/angle.hpp>
|
||||||
#include <omath/mat.hpp>
|
|
||||||
#include <omath/vector3.hpp>
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
#ifdef OMATH_BUILD_TESTS
|
||||||
|
// ReSharper disable once CppInconsistentNaming
|
||||||
|
class UnitTestProjection_Projection_Test;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace omath::projection
|
namespace omath::projection
|
||||||
{
|
{
|
||||||
class ViewPort final
|
class ViewPort final
|
||||||
@@ -26,11 +31,30 @@ namespace omath::projection
|
|||||||
};
|
};
|
||||||
using FieldOfView = Angle<float, 0.f, 180.f, AngleFlags::Clamped>;
|
using FieldOfView = Angle<float, 0.f, 180.f, AngleFlags::Clamped>;
|
||||||
|
|
||||||
template<class Mat4X4Type, class ViewAnglesType>
|
template<class T, class MatType, class ViewAnglesType>
|
||||||
class Camera
|
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
|
||||||
{
|
{
|
||||||
|
#ifdef OMATH_BUILD_TESTS
|
||||||
|
friend UnitTestProjection_Projection_Test;
|
||||||
|
#endif
|
||||||
public:
|
public:
|
||||||
virtual ~Camera() = default;
|
~Camera() = default;
|
||||||
Camera(const Vector3<float>& position, const ViewAnglesType& view_angles, const ViewPort& view_port,
|
Camera(const Vector3<float>& position, const ViewAnglesType& view_angles, const ViewPort& view_port,
|
||||||
const FieldOfView& fov, const float near, const float far) noexcept
|
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_port(view_port), m_field_of_view(fov), m_far_plane_distance(far), m_near_plane_distance(near),
|
||||||
@@ -39,15 +63,16 @@ namespace omath::projection
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void look_at(const Vector3<float>& target) = 0;
|
void look_at(const Vector3<float>& target)
|
||||||
|
{
|
||||||
[[nodiscard]] virtual Mat4X4Type calc_view_matrix() const noexcept = 0;
|
m_view_angles = TraitClass::calc_look_at_angle(m_origin, target);
|
||||||
|
}
|
||||||
[[nodiscard]] virtual Mat4X4Type calc_projection_matrix() const noexcept = 0;
|
|
||||||
|
|
||||||
[[nodiscard]] Mat4X4Type calc_view_projection_matrix() const noexcept
|
[[nodiscard]] Mat4X4Type calc_view_projection_matrix() const noexcept
|
||||||
{
|
{
|
||||||
return calc_projection_matrix() * calc_view_matrix();
|
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:
|
public:
|
||||||
@@ -147,6 +172,38 @@ namespace omath::projection
|
|||||||
|
|
||||||
return Vector3<float>{projected.at(0, 0), projected.at(1, 0), projected.at(2, 0)};
|
return Vector3<float>{projected.at(0, 0), projected.at(1, 0), projected.at(2, 0)};
|
||||||
}
|
}
|
||||||
|
[[nodiscard]]
|
||||||
|
std::expected<Vector3<float>, Error> view_port_to_screen(const Vector3<float>& ndc) const noexcept
|
||||||
|
{
|
||||||
|
const auto inv_view_proj = get_view_projection_matrix().inverted();
|
||||||
|
|
||||||
|
if (!inv_view_proj)
|
||||||
|
return std::unexpected(Error::INV_VIEW_PROJ_MAT_DET_EQ_ZERO);
|
||||||
|
|
||||||
|
auto inverted_projection =
|
||||||
|
inv_view_proj.value() * mat_column_from_vector<float, Mat4X4Type::get_store_ordering()>(ndc);
|
||||||
|
|
||||||
|
if (!inverted_projection.at(3, 0))
|
||||||
|
return std::unexpected(Error::WORLD_POSITION_IS_OUT_OF_SCREEN_BOUNDS);
|
||||||
|
|
||||||
|
inverted_projection /= inverted_projection.at(3, 0);
|
||||||
|
|
||||||
|
return Vector3<float>{inverted_projection.at(0, 0), inverted_projection.at(1, 0),
|
||||||
|
inverted_projection.at(2, 0)};
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
std::expected<Vector3<float>, Error> screen_to_world(const Vector3<float>& screen_pos) const noexcept
|
||||||
|
{
|
||||||
|
return view_port_to_screen(screen_to_ndc(screen_pos));
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
std::expected<Vector3<float>, Error> screen_to_world(const Vector2<float>& screen_pos) const noexcept
|
||||||
|
{
|
||||||
|
const auto& [x, y] = screen_pos;
|
||||||
|
return screen_to_world({x, y, 1.f});
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ViewPort m_view_port{};
|
ViewPort m_view_port{};
|
||||||
@@ -169,7 +226,25 @@ namespace omath::projection
|
|||||||
|
|
||||||
[[nodiscard]] Vector3<float> ndc_to_screen_position(const Vector3<float>& ndc) const noexcept
|
[[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};
|
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};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] Vector3<float> screen_to_ndc(const Vector3<float>& screen_pos) const noexcept
|
||||||
|
{
|
||||||
|
return {screen_pos.x / m_view_port.m_width * 2.f - 1.f, 1.f - screen_pos.y / m_view_port.m_height * 2.f,
|
||||||
|
screen_pos.z};
|
||||||
|
}
|
||||||
};
|
};
|
||||||
} // namespace omath::projection
|
} // namespace omath::projection
|
||||||
|
|||||||
@@ -10,5 +10,6 @@ namespace omath::projection
|
|||||||
enum class Error : uint16_t
|
enum class Error : uint16_t
|
||||||
{
|
{
|
||||||
WORLD_POSITION_IS_OUT_OF_SCREEN_BOUNDS,
|
WORLD_POSITION_IS_OUT_OF_SCREEN_BOUNDS,
|
||||||
|
INV_VIEW_PROJ_MAT_DET_EQ_ZERO,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
// Created by Orange on 11/13/2024.
|
// Created by Orange on 11/13/2024.
|
||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "omath/vector3.hpp"
|
#include "linear_algebra/vector3.hpp"
|
||||||
|
|
||||||
namespace omath
|
namespace omath
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 8/28/2025.
|
||||||
|
//
|
||||||
|
#include "omath/3d_primitives/plane.hpp"
|
||||||
|
|
||||||
|
namespace omath::primitives
|
||||||
|
{
|
||||||
|
std::array<Triangle<Vector3<float>>, 2> create_plane(const Vector3<float>& vertex_a,
|
||||||
|
const Vector3<float>& vertex_b,
|
||||||
|
const Vector3<float>& direction, const float size) noexcept
|
||||||
|
{
|
||||||
|
const auto second_vertex_a = vertex_a + direction * size;
|
||||||
|
return std::array
|
||||||
|
{
|
||||||
|
Triangle{second_vertex_a, vertex_a, vertex_b},
|
||||||
|
Triangle{second_vertex_a, vertex_b + direction * size, vertex_b}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} // namespace omath::primitives
|
||||||
@@ -50,12 +50,10 @@ namespace omath::collision
|
|||||||
|
|
||||||
const auto t_hit = side_b.dot(q) * inv_det;
|
const auto t_hit = side_b.dot(q) * inv_det;
|
||||||
|
|
||||||
if (ray.infinite_length)
|
if (ray.infinite_length && t_hit <= k_epsilon)
|
||||||
{
|
return ray.end;
|
||||||
if (t_hit <= k_epsilon)
|
|
||||||
return ray.end;
|
if (t_hit <= k_epsilon || t_hit > 1.0f - k_epsilon)
|
||||||
}
|
|
||||||
else if (t_hit <= k_epsilon || t_hit > 1.0f - k_epsilon)
|
|
||||||
return ray.end;
|
return ray.end;
|
||||||
|
|
||||||
return ray.start + ray_dir * t_hit;
|
return ray.start + ray_dir * t_hit;
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by Vlad on 3/17/2025.
|
|
||||||
//
|
|
||||||
#include "omath/engines/iw_engine/camera.hpp"
|
|
||||||
#include "omath/engines/iw_engine/formulas.hpp"
|
|
||||||
|
|
||||||
namespace omath::iw_engine
|
|
||||||
{
|
|
||||||
|
|
||||||
Camera::Camera(const Vector3<float>& position, const ViewAngles& view_angles, const projection::ViewPort& view_port,
|
|
||||||
const Angle<float, 0.f, 180.f, AngleFlags::Clamped>& fov, const float near, const float far)
|
|
||||||
: projection::Camera<Mat4X4, ViewAngles>(position, view_angles, view_port, fov, near, far)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
void Camera::look_at([[maybe_unused]] const Vector3<float>& target)
|
|
||||||
{
|
|
||||||
const float distance = m_origin.distance_to(target);
|
|
||||||
const auto delta = target - m_origin;
|
|
||||||
|
|
||||||
m_view_angles.pitch = PitchAngle::from_radians(std::asin(delta.z / distance));
|
|
||||||
m_view_angles.yaw = -YawAngle::from_radians(std::atan2(delta.y, delta.x));
|
|
||||||
m_view_angles.roll = RollAngle::from_radians(0.f);
|
|
||||||
}
|
|
||||||
Mat4X4 Camera::calc_view_matrix() const noexcept
|
|
||||||
{
|
|
||||||
return iw_engine::calc_view_matrix(m_view_angles, m_origin);
|
|
||||||
}
|
|
||||||
Mat4X4 Camera::calc_projection_matrix() const noexcept
|
|
||||||
{
|
|
||||||
return calc_perspective_projection_matrix(m_field_of_view.as_degrees(), m_view_port.aspect_ratio(),
|
|
||||||
m_near_plane_distance, m_far_plane_distance);
|
|
||||||
}
|
|
||||||
} // namespace omath::iw_engine
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 8/11/2025.
|
||||||
|
//
|
||||||
|
#include "omath/engines/iw_engine/traits/camera_trait.hpp"
|
||||||
|
#include "omath/engines/iw_engine/formulas.hpp"
|
||||||
|
namespace omath::iw_engine
|
||||||
|
{
|
||||||
|
|
||||||
|
ViewAngles CameraTrait::calc_look_at_angle(const Vector3<float>& cam_origin, const Vector3<float>& look_at) noexcept
|
||||||
|
{
|
||||||
|
const auto distance = cam_origin.distance_to(look_at);
|
||||||
|
const auto delta = cam_origin - look_at;
|
||||||
|
|
||||||
|
return {PitchAngle::from_radians(-std::asin(delta.z / distance)),
|
||||||
|
YawAngle::from_radians(std::atan2(delta.y, delta.x)), RollAngle::from_radians(0.f)};
|
||||||
|
}
|
||||||
|
Mat4X4 CameraTrait::calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept
|
||||||
|
{
|
||||||
|
return iw_engine::calc_view_matrix(angles, cam_origin);
|
||||||
|
}
|
||||||
|
Mat4X4 CameraTrait::calc_projection_matrix(const projection::FieldOfView& fov,
|
||||||
|
const projection::ViewPort& view_port, const float near,
|
||||||
|
const float far) noexcept
|
||||||
|
{
|
||||||
|
return calc_perspective_projection_matrix(fov.as_degrees(), view_port.aspect_ratio(), near, far);
|
||||||
|
}
|
||||||
|
} // namespace omath::iw_engine
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by Orange on 12/23/2024.
|
|
||||||
//
|
|
||||||
#include "omath/engines/opengl_engine/camera.hpp"
|
|
||||||
#include "omath/engines/opengl_engine/formulas.hpp"
|
|
||||||
|
|
||||||
namespace omath::opengl_engine
|
|
||||||
{
|
|
||||||
|
|
||||||
Camera::Camera(const Vector3<float>& position, const ViewAngles& view_angles, const projection::ViewPort& view_port,
|
|
||||||
const Angle<float, 0.f, 180.f, AngleFlags::Clamped>& fov, const float near, const float far)
|
|
||||||
: projection::Camera<Mat4X4, ViewAngles>(position, view_angles, view_port, fov, near, far)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
void Camera::look_at([[maybe_unused]] const Vector3<float>& target)
|
|
||||||
{
|
|
||||||
const float distance = m_origin.distance_to(target);
|
|
||||||
const auto delta = target - m_origin;
|
|
||||||
|
|
||||||
m_view_angles.pitch = PitchAngle::from_radians(std::asin(delta.z / distance));
|
|
||||||
m_view_angles.yaw = -YawAngle::from_radians(std::atan2(delta.y, delta.x));
|
|
||||||
m_view_angles.roll = RollAngle::from_radians(0.f);
|
|
||||||
}
|
|
||||||
Mat4X4 Camera::calc_view_matrix() const noexcept
|
|
||||||
{
|
|
||||||
return opengl_engine::calc_view_matrix(m_view_angles, m_origin);
|
|
||||||
}
|
|
||||||
Mat4X4 Camera::calc_projection_matrix() const noexcept
|
|
||||||
{
|
|
||||||
return calc_perspective_projection_matrix(m_field_of_view.as_degrees(), m_view_port.aspect_ratio(),
|
|
||||||
m_near_plane_distance, m_far_plane_distance);
|
|
||||||
}
|
|
||||||
} // namespace omath::opengl_engine
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 8/11/2025.
|
||||||
|
//
|
||||||
|
#include "omath/engines/opengl_engine/traits/camera_trait.hpp"
|
||||||
|
#include "omath/engines/opengl_engine/formulas.hpp"
|
||||||
|
|
||||||
|
namespace omath::opengl_engine
|
||||||
|
{
|
||||||
|
|
||||||
|
ViewAngles CameraTrait::calc_look_at_angle(const Vector3<float>& cam_origin, const Vector3<float>& look_at) noexcept
|
||||||
|
{
|
||||||
|
const auto distance = cam_origin.distance_to(look_at);
|
||||||
|
const auto delta = cam_origin - look_at;
|
||||||
|
|
||||||
|
return {PitchAngle::from_radians(-std::asin(delta.y / distance)),
|
||||||
|
YawAngle::from_radians(std::atan2(delta.z, delta.x)), RollAngle::from_radians(0.f)};
|
||||||
|
}
|
||||||
|
Mat4X4 CameraTrait::calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept
|
||||||
|
{
|
||||||
|
return opengl_engine::calc_view_matrix(angles, cam_origin);
|
||||||
|
}
|
||||||
|
Mat4X4 CameraTrait::calc_projection_matrix(const projection::FieldOfView& fov,
|
||||||
|
const projection::ViewPort& view_port, const float near,
|
||||||
|
const float far) noexcept
|
||||||
|
{
|
||||||
|
return calc_perspective_projection_matrix(fov.as_degrees(), view_port.aspect_ratio(), near, far);
|
||||||
|
}
|
||||||
|
} // namespace omath::opengl_engine
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by Orange on 12/4/2024.
|
|
||||||
//
|
|
||||||
#include "omath/engines/source_engine/camera.hpp"
|
|
||||||
#include "omath/engines/source_engine/formulas.hpp"
|
|
||||||
|
|
||||||
namespace omath::source_engine
|
|
||||||
{
|
|
||||||
|
|
||||||
Camera::Camera(const Vector3<float>& position, const ViewAngles& view_angles, const projection::ViewPort& view_port,
|
|
||||||
const projection::FieldOfView& fov, const float near, const float far)
|
|
||||||
: projection::Camera<Mat4X4, ViewAngles>(position, view_angles, view_port, fov, near, far)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
void Camera::look_at(const Vector3<float>& target)
|
|
||||||
{
|
|
||||||
const float distance = m_origin.distance_to(target);
|
|
||||||
const auto delta = target - m_origin;
|
|
||||||
|
|
||||||
m_view_angles.pitch = PitchAngle::from_radians(std::asin(delta.z / distance));
|
|
||||||
m_view_angles.yaw = -YawAngle::from_radians(std::atan2(delta.y, delta.x));
|
|
||||||
m_view_angles.roll = RollAngle::from_radians(0.f);
|
|
||||||
}
|
|
||||||
|
|
||||||
Mat4X4 Camera::calc_view_matrix() const noexcept
|
|
||||||
{
|
|
||||||
return source_engine::calc_view_matrix(m_view_angles, m_origin);
|
|
||||||
}
|
|
||||||
|
|
||||||
Mat4X4 Camera::calc_projection_matrix() const noexcept
|
|
||||||
{
|
|
||||||
return calc_perspective_projection_matrix(m_field_of_view.as_degrees(), m_view_port.aspect_ratio(),
|
|
||||||
m_near_plane_distance, m_far_plane_distance);
|
|
||||||
}
|
|
||||||
} // namespace omath::source_engine
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 8/11/2025.
|
||||||
|
//
|
||||||
|
#include "omath/engines/source_engine/traits/camera_trait.hpp"
|
||||||
|
#include "omath/engines/source_engine/formulas.hpp"
|
||||||
|
namespace omath::source_engine
|
||||||
|
{
|
||||||
|
|
||||||
|
ViewAngles CameraTrait::calc_look_at_angle(const Vector3<float>& cam_origin, const Vector3<float>& look_at) noexcept
|
||||||
|
{
|
||||||
|
const auto distance = cam_origin.distance_to(look_at);
|
||||||
|
const auto delta = cam_origin - look_at;
|
||||||
|
|
||||||
|
return {PitchAngle::from_radians(-std::asin(delta.z / distance)),
|
||||||
|
YawAngle::from_radians(std::atan2(delta.y, delta.x)), RollAngle::from_radians(0.f)};
|
||||||
|
}
|
||||||
|
Mat4X4 CameraTrait::calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept
|
||||||
|
{
|
||||||
|
return source_engine::calc_view_matrix(angles, cam_origin);
|
||||||
|
}
|
||||||
|
Mat4X4 CameraTrait::calc_projection_matrix(const projection::FieldOfView& fov,
|
||||||
|
const projection::ViewPort& view_port, const float near,
|
||||||
|
const float far) noexcept
|
||||||
|
{
|
||||||
|
return calc_perspective_projection_matrix(fov.as_degrees(), view_port.aspect_ratio(), near, far);
|
||||||
|
}
|
||||||
|
} // namespace omath::source_engine
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by Vlad on 3/22/2025.
|
|
||||||
//
|
|
||||||
#include <omath/engines/unity_engine/camera.hpp>
|
|
||||||
#include <omath/engines/unity_engine/formulas.hpp>
|
|
||||||
|
|
||||||
namespace omath::unity_engine
|
|
||||||
{
|
|
||||||
Camera::Camera(const Vector3<float>& position, const ViewAngles& view_angles, const projection::ViewPort& view_port,
|
|
||||||
const projection::FieldOfView& fov, const float near, const float far)
|
|
||||||
: projection::Camera<Mat4X4, ViewAngles>(position, view_angles, view_port, fov, near, far)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
void Camera::look_at([[maybe_unused]] const Vector3<float>& target)
|
|
||||||
{
|
|
||||||
throw std::runtime_error("Not implemented");
|
|
||||||
}
|
|
||||||
Mat4X4 Camera::calc_view_matrix() const noexcept
|
|
||||||
{
|
|
||||||
return unity_engine::calc_view_matrix(m_view_angles, m_origin);
|
|
||||||
}
|
|
||||||
Mat4X4 Camera::calc_projection_matrix() const noexcept
|
|
||||||
{
|
|
||||||
return calc_perspective_projection_matrix(m_field_of_view.as_degrees(), m_view_port.aspect_ratio(),
|
|
||||||
m_near_plane_distance, m_far_plane_distance);
|
|
||||||
}
|
|
||||||
} // namespace omath::unity_engine
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 8/11/2025.
|
||||||
|
//
|
||||||
|
#include "omath/engines/unity_engine/traits/camera_trait.hpp"
|
||||||
|
|
||||||
|
namespace omath::unity_engine
|
||||||
|
{
|
||||||
|
|
||||||
|
ViewAngles CameraTrait::calc_look_at_angle(const Vector3<float>& cam_origin, const Vector3<float>& look_at) noexcept
|
||||||
|
{
|
||||||
|
const auto distance = cam_origin.distance_to(look_at);
|
||||||
|
const auto delta = cam_origin - look_at;
|
||||||
|
|
||||||
|
return {PitchAngle::from_radians(-std::asin(delta.y / distance)),
|
||||||
|
YawAngle::from_radians(std::atan2(delta.z, delta.x)), RollAngle::from_radians(0.f)};
|
||||||
|
}
|
||||||
|
Mat4X4 CameraTrait::calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept
|
||||||
|
{
|
||||||
|
return unity_engine::calc_view_matrix(angles, cam_origin);
|
||||||
|
}
|
||||||
|
Mat4X4 CameraTrait::calc_projection_matrix(const projection::FieldOfView& fov,
|
||||||
|
const projection::ViewPort& view_port, const float near,
|
||||||
|
const float far) noexcept
|
||||||
|
{
|
||||||
|
return calc_perspective_projection_matrix(fov.as_degrees(), view_port.aspect_ratio(), near, far);
|
||||||
|
}
|
||||||
|
} // namespace omath::unity_engine
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 3/22/2025.
|
||||||
|
//
|
||||||
|
#include "omath/engines/unreal_engine/formulas.hpp"
|
||||||
|
|
||||||
|
namespace omath::unreal_engine
|
||||||
|
{
|
||||||
|
Vector3<float> forward_vector(const ViewAngles& angles) noexcept
|
||||||
|
{
|
||||||
|
const auto vec = rotation_matrix(angles) * mat_column_from_vector(k_abs_forward);
|
||||||
|
|
||||||
|
return {vec.at(0, 0), vec.at(1, 0), vec.at(2, 0)};
|
||||||
|
}
|
||||||
|
Vector3<float> right_vector(const ViewAngles& angles) noexcept
|
||||||
|
{
|
||||||
|
const auto vec = rotation_matrix(angles) * mat_column_from_vector(k_abs_right);
|
||||||
|
|
||||||
|
return {vec.at(0, 0), vec.at(1, 0), vec.at(2, 0)};
|
||||||
|
}
|
||||||
|
Vector3<float> up_vector(const ViewAngles& angles) noexcept
|
||||||
|
{
|
||||||
|
const auto vec = rotation_matrix(angles) * mat_column_from_vector(k_abs_up);
|
||||||
|
|
||||||
|
return {vec.at(0, 0), vec.at(1, 0), vec.at(2, 0)};
|
||||||
|
}
|
||||||
|
Mat4X4 calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept
|
||||||
|
{
|
||||||
|
return mat_camera_view<float, MatStoreType::ROW_MAJOR>(forward_vector(angles), -right_vector(angles),
|
||||||
|
up_vector(angles), cam_origin);
|
||||||
|
}
|
||||||
|
Mat4X4 rotation_matrix(const ViewAngles& angles) noexcept
|
||||||
|
{
|
||||||
|
return mat_rotation_axis_x<float, MatStoreType::ROW_MAJOR>(angles.roll)
|
||||||
|
* mat_rotation_axis_y<float, MatStoreType::ROW_MAJOR>(angles.pitch)
|
||||||
|
* mat_rotation_axis_z<float, MatStoreType::ROW_MAJOR>(angles.yaw);
|
||||||
|
}
|
||||||
|
Mat4X4 calc_perspective_projection_matrix(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, 0, 0},
|
||||||
|
{0, 1.f / (fov_half_tan), 0, 0},
|
||||||
|
{0, 0, (far + near) / (far - near), -(2.f * far * near) / (far - near)},
|
||||||
|
{0, 0, -1.f, 0},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} // namespace omath::unreal_engine
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 8/11/2025.
|
||||||
|
//
|
||||||
|
#include "omath/engines/unreal_engine/traits/camera_trait.hpp"
|
||||||
|
|
||||||
|
namespace omath::unreal_engine
|
||||||
|
{
|
||||||
|
|
||||||
|
ViewAngles CameraTrait::calc_look_at_angle(const Vector3<float>& cam_origin, const Vector3<float>& look_at) noexcept
|
||||||
|
{
|
||||||
|
const auto distance = cam_origin.distance_to(look_at);
|
||||||
|
const auto delta = cam_origin - look_at;
|
||||||
|
|
||||||
|
return {PitchAngle::from_radians(-std::asin(delta.z / distance)),
|
||||||
|
YawAngle::from_radians(std::atan2(delta.x, delta.y)), RollAngle::from_radians(0.f)};
|
||||||
|
}
|
||||||
|
Mat4X4 CameraTrait::calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept
|
||||||
|
{
|
||||||
|
return unreal_engine::calc_view_matrix(angles, cam_origin);
|
||||||
|
}
|
||||||
|
Mat4X4 CameraTrait::calc_projection_matrix(const projection::FieldOfView& fov,
|
||||||
|
const projection::ViewPort& view_port, const float near,
|
||||||
|
const float far) noexcept
|
||||||
|
{
|
||||||
|
return calc_perspective_projection_matrix(fov.as_degrees(), view_port.aspect_ratio(), near, far);
|
||||||
|
}
|
||||||
|
} // namespace omath::unreal_engine
|
||||||
@@ -1,361 +0,0 @@
|
|||||||
#include "omath/matrix.hpp"
|
|
||||||
#include "omath/angles.hpp"
|
|
||||||
#include "omath/vector3.hpp"
|
|
||||||
#include <complex>
|
|
||||||
#include <format>
|
|
||||||
#include <stdexcept>
|
|
||||||
#include <utility>
|
|
||||||
|
|
||||||
namespace omath
|
|
||||||
{
|
|
||||||
Matrix::Matrix(const size_t rows, const size_t columns)
|
|
||||||
{
|
|
||||||
if (rows == 0 and columns == 0)
|
|
||||||
throw std::runtime_error("Matrix cannot be 0x0");
|
|
||||||
|
|
||||||
m_rows = rows;
|
|
||||||
m_columns = columns;
|
|
||||||
|
|
||||||
m_data = std::make_unique<float[]>(m_rows * m_columns);
|
|
||||||
|
|
||||||
set(0.f);
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix::Matrix(const std::initializer_list<std::initializer_list<float>>& rows)
|
|
||||||
{
|
|
||||||
m_rows = rows.size();
|
|
||||||
m_columns = rows.begin()->size();
|
|
||||||
|
|
||||||
for (const auto& row: rows)
|
|
||||||
if (row.size() != m_columns)
|
|
||||||
throw std::invalid_argument("All rows must have the same number of columns.");
|
|
||||||
|
|
||||||
m_data = std::make_unique<float[]>(m_rows * m_columns);
|
|
||||||
|
|
||||||
size_t i = 0;
|
|
||||||
for (const auto& row: rows)
|
|
||||||
{
|
|
||||||
size_t j = 0;
|
|
||||||
for (const auto& value: row)
|
|
||||||
at(i, j++) = value;
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix::Matrix(const Matrix& other)
|
|
||||||
{
|
|
||||||
m_rows = other.m_rows;
|
|
||||||
m_columns = other.m_columns;
|
|
||||||
|
|
||||||
m_data = std::make_unique<float[]>(m_rows * m_columns);
|
|
||||||
|
|
||||||
for (size_t i = 0; i < m_rows; ++i)
|
|
||||||
for (size_t j = 0; j < m_columns; ++j)
|
|
||||||
at(i, j) = other.at(i, j);
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix::Matrix(const size_t rows, const size_t columns, const float* raw_data)
|
|
||||||
{
|
|
||||||
m_rows = rows;
|
|
||||||
m_columns = columns;
|
|
||||||
|
|
||||||
m_data = std::make_unique<float[]>(m_rows * m_columns);
|
|
||||||
|
|
||||||
for (size_t i = 0; i < rows * columns; ++i)
|
|
||||||
at(i / rows, i % columns) = raw_data[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t Matrix::row_count() const noexcept
|
|
||||||
{
|
|
||||||
return m_rows;
|
|
||||||
}
|
|
||||||
|
|
||||||
float& Matrix::operator[](const size_t row, const size_t column)
|
|
||||||
{
|
|
||||||
return at(row, column);
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix::Matrix(Matrix&& other) noexcept
|
|
||||||
{
|
|
||||||
m_rows = other.m_rows;
|
|
||||||
m_columns = other.m_columns;
|
|
||||||
m_data = std::move(other.m_data);
|
|
||||||
|
|
||||||
other.m_rows = 0;
|
|
||||||
other.m_columns = 0;
|
|
||||||
|
|
||||||
other.m_data = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t Matrix::columns_count() const noexcept
|
|
||||||
{
|
|
||||||
return m_columns;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::pair<size_t, size_t> Matrix::size() const noexcept
|
|
||||||
{
|
|
||||||
return {row_count(), columns_count()};
|
|
||||||
}
|
|
||||||
|
|
||||||
float& Matrix::at(const size_t row, const size_t col)
|
|
||||||
{
|
|
||||||
return const_cast<float&>(std::as_const(*this).at(row, col));
|
|
||||||
}
|
|
||||||
|
|
||||||
float Matrix::sum()
|
|
||||||
{
|
|
||||||
float sum = 0;
|
|
||||||
|
|
||||||
for (size_t i = 0; i < row_count(); i++)
|
|
||||||
for (size_t j = 0; j < columns_count(); j++)
|
|
||||||
sum += at(i, j);
|
|
||||||
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
const float& Matrix::at(const size_t row, const size_t col) const
|
|
||||||
{
|
|
||||||
return m_data[row * m_columns + col];
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix Matrix::operator*(const Matrix& other) const
|
|
||||||
{
|
|
||||||
if (m_columns != other.m_rows)
|
|
||||||
throw std::runtime_error("n != m");
|
|
||||||
|
|
||||||
auto out_mat = Matrix(m_rows, other.m_columns);
|
|
||||||
|
|
||||||
for (size_t d = 0; d < m_rows; ++d)
|
|
||||||
for (size_t i = 0; i < other.m_columns; ++i)
|
|
||||||
for (size_t j = 0; j < other.m_rows; ++j)
|
|
||||||
out_mat.at(d, i) += at(d, j) * other.at(j, i);
|
|
||||||
|
|
||||||
return out_mat;
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix& Matrix::operator*=(const Matrix& other)
|
|
||||||
{
|
|
||||||
*this = *this * other;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix Matrix::operator*(const float f) const
|
|
||||||
{
|
|
||||||
auto out = *this;
|
|
||||||
for (size_t i = 0; i < m_rows; ++i)
|
|
||||||
for (size_t j = 0; j < m_columns; ++j)
|
|
||||||
out.at(i, j) *= f;
|
|
||||||
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix& Matrix::operator*=(const float f)
|
|
||||||
{
|
|
||||||
for (size_t i = 0; i < row_count(); i++)
|
|
||||||
for (size_t j = 0; j < columns_count(); j++)
|
|
||||||
at(i, j) *= f;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Matrix::clear()
|
|
||||||
{
|
|
||||||
set(0.f);
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix& Matrix::operator=(const Matrix& other)
|
|
||||||
{
|
|
||||||
if (this == &other)
|
|
||||||
return *this;
|
|
||||||
|
|
||||||
for (size_t i = 0; i < m_rows; ++i)
|
|
||||||
for (size_t j = 0; j < m_columns; ++j)
|
|
||||||
at(i, j) = other.at(i, j);
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix& Matrix::operator=(Matrix&& other) noexcept
|
|
||||||
{
|
|
||||||
if (this == &other)
|
|
||||||
return *this;
|
|
||||||
|
|
||||||
m_rows = other.m_rows;
|
|
||||||
m_columns = other.m_columns;
|
|
||||||
m_data = std::move(other.m_data);
|
|
||||||
|
|
||||||
other.m_rows = 0;
|
|
||||||
other.m_columns = 0;
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix& Matrix::operator/=(const float f)
|
|
||||||
{
|
|
||||||
for (size_t i = 0; i < m_rows; ++i)
|
|
||||||
for (size_t j = 0; j < m_columns; ++j)
|
|
||||||
at(i, j) /= f;
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix Matrix::operator/(const float f) const
|
|
||||||
{
|
|
||||||
auto out = *this;
|
|
||||||
for (size_t i = 0; i < m_rows; ++i)
|
|
||||||
for (size_t j = 0; j < m_columns; ++j)
|
|
||||||
out.at(i, j) /= f;
|
|
||||||
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string Matrix::to_string() const
|
|
||||||
{
|
|
||||||
std::string str;
|
|
||||||
|
|
||||||
for (size_t i = 0; i < m_rows; i++)
|
|
||||||
{
|
|
||||||
for (size_t j = 0; j < m_columns; ++j)
|
|
||||||
{
|
|
||||||
str += std::format("{:.1f}", at(i, j));
|
|
||||||
|
|
||||||
if (j == m_columns - 1)
|
|
||||||
str += '\n';
|
|
||||||
else
|
|
||||||
str += ' ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
float Matrix::determinant() const // NOLINT(*-no-recursion)
|
|
||||||
{
|
|
||||||
if (m_rows + m_columns == 2)
|
|
||||||
return at(0, 0);
|
|
||||||
|
|
||||||
if (m_rows == 2 and m_columns == 2)
|
|
||||||
return at(0, 0) * at(1, 1) - at(0, 1) * at(1, 0);
|
|
||||||
|
|
||||||
float det = 0;
|
|
||||||
for (size_t i = 0; i < m_columns; i++)
|
|
||||||
det += alg_complement(0, i) * at(0, i);
|
|
||||||
|
|
||||||
return det;
|
|
||||||
}
|
|
||||||
|
|
||||||
float Matrix::alg_complement(const size_t i, const size_t j) const // NOLINT(*-no-recursion)
|
|
||||||
{
|
|
||||||
const auto tmp = minor(i, j);
|
|
||||||
return ((i + j + 2) % 2 == 0) ? tmp : -tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix Matrix::transpose() const
|
|
||||||
{
|
|
||||||
Matrix transposed = {m_columns, m_rows};
|
|
||||||
|
|
||||||
for (size_t i = 0; i < m_rows; ++i)
|
|
||||||
for (size_t j = 0; j < m_columns; ++j)
|
|
||||||
transposed.at(j, i) = at(i, j);
|
|
||||||
|
|
||||||
return transposed;
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix::~Matrix() = default;
|
|
||||||
|
|
||||||
void Matrix::set(const float val)
|
|
||||||
{
|
|
||||||
for (size_t i = 0; i < m_rows; ++i)
|
|
||||||
for (size_t j = 0; j < m_columns; ++j)
|
|
||||||
at(i, j) = val;
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix Matrix::strip(const size_t row, const size_t column) const
|
|
||||||
{
|
|
||||||
Matrix stripped = {m_rows - 1, m_columns - 1};
|
|
||||||
size_t strip_row_index = 0;
|
|
||||||
|
|
||||||
for (size_t i = 0; i < m_rows; i++)
|
|
||||||
{
|
|
||||||
if (i == row)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
size_t strip_column_index = 0;
|
|
||||||
for (size_t j = 0; j < m_columns; ++j)
|
|
||||||
{
|
|
||||||
if (j == column)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
stripped.at(strip_row_index, strip_column_index) = at(i, j);
|
|
||||||
strip_column_index++;
|
|
||||||
}
|
|
||||||
|
|
||||||
strip_row_index++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return stripped;
|
|
||||||
}
|
|
||||||
|
|
||||||
float Matrix::minor(const size_t i, const size_t j) const // NOLINT(*-no-recursion)
|
|
||||||
{
|
|
||||||
return strip(i, j).determinant();
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix Matrix::to_screen_matrix(const float screen_width, const float screen_height)
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
{screen_width / 2.f, 0.f, 0.f, 0.f},
|
|
||||||
{0.f, -screen_height / 2.f, 0.f, 0.f},
|
|
||||||
{0.f, 0.f, 1.f, 0.f},
|
|
||||||
{screen_width / 2.f, screen_height / 2.f, 0.f, 1.f},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix Matrix::translation_matrix(const Vector3<float>& diff)
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
{1.f, 0.f, 0.f, 0.f},
|
|
||||||
{0.f, 1.f, 0.f, 0.f},
|
|
||||||
{0.f, 0.f, 1.f, 0.f},
|
|
||||||
{diff.x, diff.y, diff.z, 1.f},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix Matrix::orientation_matrix(const Vector3<float>& forward, const Vector3<float>& right,
|
|
||||||
const Vector3<float>& up)
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
{right.x, up.x, forward.x, 0.f},
|
|
||||||
{right.y, up.y, forward.y, 0.f},
|
|
||||||
{right.z, up.z, forward.z, 0.f},
|
|
||||||
{0.f, 0.f, 0.f, 1.f},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix Matrix::projection_matrix(const float field_of_view, const float aspect_ratio, const float near,
|
|
||||||
const float far)
|
|
||||||
{
|
|
||||||
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}};
|
|
||||||
}
|
|
||||||
|
|
||||||
const float* Matrix::raw() const
|
|
||||||
{
|
|
||||||
return m_data.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Matrix::set_data_from_raw(const float* raw_matrix)
|
|
||||||
{
|
|
||||||
for (size_t i = 0; i < m_columns * m_rows; ++i)
|
|
||||||
at(i / m_rows, i % m_columns) = raw_matrix[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
Matrix::Matrix()
|
|
||||||
{
|
|
||||||
m_columns = 0;
|
|
||||||
m_rows = 0;
|
|
||||||
m_data = nullptr;
|
|
||||||
}
|
|
||||||
} // namespace omath
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
#include "omath/projectile_prediction/proj_pred_engine_legacy.hpp"
|
|
||||||
#include <cmath>
|
|
||||||
#include <omath/angles.hpp>
|
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
|
||||||
{
|
|
||||||
ProjPredEngineLegacy::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)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<Vector3<float>> ProjPredEngineLegacy::maybe_calculate_aim_point(const Projectile& projectile,
|
|
||||||
const Target& target) const
|
|
||||||
{
|
|
||||||
for (float time = 0.f; time < m_maximum_simulation_time; time += m_simulation_time_step)
|
|
||||||
{
|
|
||||||
const auto predicted_target_position = target.predict_position(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;
|
|
||||||
|
|
||||||
const auto delta2d = (predicted_target_position - projectile.m_origin).length_2d();
|
|
||||||
const auto height = delta2d * std::tan(angles::degrees_to_radians(projectile_pitch.value()));
|
|
||||||
|
|
||||||
return Vector3(predicted_target_position.x, predicted_target_position.y, projectile.m_origin.z + height);
|
|
||||||
}
|
|
||||||
return std::nullopt;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<float> ProjPredEngineLegacy::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;
|
|
||||||
const auto delta = target_position - projectile.m_origin;
|
|
||||||
|
|
||||||
const auto distance2d = delta.length_2d();
|
|
||||||
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 * delta.z * 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ProjPredEngineLegacy::is_projectile_reached_target(const Vector3<float>& target_position,
|
|
||||||
const Projectile& projectile, const float pitch,
|
|
||||||
const float time) const noexcept
|
|
||||||
{
|
|
||||||
const auto yaw = projectile.m_origin.view_angle_to(target_position).y;
|
|
||||||
const auto projectile_position = projectile.predict_position(pitch, yaw, time, m_gravity_constant);
|
|
||||||
|
|
||||||
return projectile_position.distance_to(target_position) <= m_distance_tolerance;
|
|
||||||
}
|
|
||||||
} // namespace omath::projectile_prediction
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by Vlad on 6/9/2024.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "omath/projectile_prediction/projectile.hpp"
|
|
||||||
#include <omath/engines/source_engine/formulas.hpp>
|
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
|
||||||
{
|
|
||||||
Vector3<float> Projectile::predict_position(const float pitch, const float yaw, const float time,
|
|
||||||
const float gravity) const noexcept
|
|
||||||
{
|
|
||||||
auto current_pos = m_origin
|
|
||||||
+ source_engine::forward_vector({source_engine::PitchAngle::from_degrees(-pitch),
|
|
||||||
source_engine::YawAngle::from_degrees(yaw),
|
|
||||||
source_engine::RollAngle::from_degrees(0)})
|
|
||||||
* m_launch_speed * time;
|
|
||||||
current_pos.z -= (gravity * m_gravity_scale) * (time * time) * 0.5f;
|
|
||||||
|
|
||||||
return current_pos;
|
|
||||||
}
|
|
||||||
} // namespace omath::projectile_prediction
|
|
||||||
@@ -88,7 +88,9 @@ TEST(unit_test_unity_engine, Project)
|
|||||||
|
|
||||||
const auto cam = omath::unity_engine::Camera({0, 0, 0}, {}, {1280.f, 720.f}, fov, 0.03f, 1000.f);
|
const auto cam = omath::unity_engine::Camera({0, 0, 0}, {}, {1280.f, 720.f}, fov, 0.03f, 1000.f);
|
||||||
const auto proj = cam.world_to_screen({5.f, 3, 10.f});
|
const auto proj = cam.world_to_screen({5.f, 3, 10.f});
|
||||||
std::println("{} {}", proj->x, proj->y);
|
|
||||||
|
EXPECT_NEAR(proj->x, 951.769f, 0.001f);
|
||||||
|
EXPECT_NEAR(proj->y, 547.061f, 0.001f);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(unit_test_unity_engine, CameraSetAndGetFov)
|
TEST(unit_test_unity_engine, CameraSetAndGetFov)
|
||||||
|
|||||||
@@ -0,0 +1,105 @@
|
|||||||
|
//
|
||||||
|
// Created by Orange on 11/27/2024.
|
||||||
|
//
|
||||||
|
#include <gtest/gtest.h>
|
||||||
|
#include <omath/engines/unreal_engine/camera.hpp>
|
||||||
|
#include <omath/engines/unreal_engine/constants.hpp>
|
||||||
|
#include <omath/engines/unreal_engine/formulas.hpp>
|
||||||
|
#include <print>
|
||||||
|
|
||||||
|
TEST(unit_test_unreal_engine, ForwardVector)
|
||||||
|
{
|
||||||
|
const auto forward = omath::unreal_engine::forward_vector({});
|
||||||
|
|
||||||
|
EXPECT_EQ(forward, omath::unreal_engine::k_abs_forward);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(unit_test_unreal_engine, ForwardVectorRotationYaw)
|
||||||
|
{
|
||||||
|
omath::unreal_engine::ViewAngles angles;
|
||||||
|
|
||||||
|
angles.yaw = omath::unreal_engine::YawAngle::from_degrees(90.f);
|
||||||
|
|
||||||
|
const auto forward = omath::unreal_engine::forward_vector(angles);
|
||||||
|
EXPECT_NEAR(forward.x, omath::unreal_engine::k_abs_right.x, 0.00001f);
|
||||||
|
EXPECT_NEAR(forward.y, omath::unreal_engine::k_abs_right.y, 0.00001f);
|
||||||
|
EXPECT_NEAR(forward.z, omath::unreal_engine::k_abs_right.z, 0.00001f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(unit_test_unreal_engine, ForwardVectorRotationPitch)
|
||||||
|
{
|
||||||
|
omath::unreal_engine::ViewAngles angles;
|
||||||
|
|
||||||
|
angles.pitch = omath::unreal_engine::PitchAngle::from_degrees(-90.f);
|
||||||
|
|
||||||
|
const auto forward = omath::unreal_engine::forward_vector(angles);
|
||||||
|
EXPECT_NEAR(forward.x, omath::unreal_engine::k_abs_up.x, 0.00001f);
|
||||||
|
EXPECT_NEAR(forward.y, omath::unreal_engine::k_abs_up.y, 0.00001f);
|
||||||
|
EXPECT_NEAR(forward.z, omath::unreal_engine::k_abs_up.z, 0.00001f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(unit_test_unreal_engine, ForwardVectorRotationRoll)
|
||||||
|
{
|
||||||
|
omath::unreal_engine::ViewAngles angles;
|
||||||
|
|
||||||
|
angles.roll = omath::unreal_engine::RollAngle::from_degrees(-90.f);
|
||||||
|
|
||||||
|
const auto forward = omath::unreal_engine::up_vector(angles);
|
||||||
|
EXPECT_NEAR(forward.x, omath::unreal_engine::k_abs_right.x, 0.00001f);
|
||||||
|
EXPECT_NEAR(forward.y, omath::unreal_engine::k_abs_right.y, 0.00001f);
|
||||||
|
EXPECT_NEAR(forward.z, omath::unreal_engine::k_abs_right.z, 0.00001f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(unit_test_unreal_engine, RightVector)
|
||||||
|
{
|
||||||
|
const auto right = omath::unreal_engine::right_vector({});
|
||||||
|
|
||||||
|
EXPECT_EQ(right, omath::unreal_engine::k_abs_right);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(unit_test_unreal_engine, UpVector)
|
||||||
|
{
|
||||||
|
const auto up = omath::unreal_engine::up_vector({});
|
||||||
|
EXPECT_EQ(up, omath::unreal_engine::k_abs_up);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(unit_test_unreal_engine, ProjectTargetMovedFromCamera)
|
||||||
|
{
|
||||||
|
constexpr auto fov = omath::projection::FieldOfView::from_degrees(60.f);
|
||||||
|
const auto cam = omath::unreal_engine::Camera({0, 0, 0}, {}, {1280.f, 720.f}, fov, 0.01f, 1000.f);
|
||||||
|
|
||||||
|
|
||||||
|
for (float distance = 0.02f; distance < 100.f; distance += 0.01f)
|
||||||
|
{
|
||||||
|
const auto projected = cam.world_to_screen({distance, 0, 0});
|
||||||
|
|
||||||
|
EXPECT_TRUE(projected.has_value());
|
||||||
|
|
||||||
|
if (!projected.has_value())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
EXPECT_NEAR(projected->x, 640, 0.00001f);
|
||||||
|
EXPECT_NEAR(projected->y, 360, 0.00001f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(unit_test_unreal_engine, CameraSetAndGetFov)
|
||||||
|
{
|
||||||
|
constexpr auto fov = omath::projection::FieldOfView::from_degrees(90.f);
|
||||||
|
auto cam = omath::unreal_engine::Camera({0, 0, 0}, {}, {1920.f, 1080.f}, fov, 0.01f, 1000.f);
|
||||||
|
|
||||||
|
EXPECT_EQ(cam.get_field_of_view().as_degrees(), 90.f);
|
||||||
|
cam.set_field_of_view(omath::projection::FieldOfView::from_degrees(50.f));
|
||||||
|
|
||||||
|
EXPECT_EQ(cam.get_field_of_view().as_degrees(), 50.f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(unit_test_unreal_engine, CameraSetAndGetOrigin)
|
||||||
|
{
|
||||||
|
auto cam = omath::unreal_engine::Camera({0, 0, 0}, {}, {1920.f, 1080.f}, {}, 0.01f, 1000.f);
|
||||||
|
|
||||||
|
EXPECT_EQ(cam.get_origin(), omath::Vector3<float>{});
|
||||||
|
cam.set_field_of_view(omath::projection::FieldOfView::from_degrees(50.f));
|
||||||
|
|
||||||
|
EXPECT_EQ(cam.get_field_of_view().as_degrees(), 50.f);
|
||||||
|
}
|
||||||
@@ -1,3 +1,192 @@
|
|||||||
//
|
//
|
||||||
// Created by Orange on 11/30/2024.
|
// Created by Orange on 11/30/2024.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
#include <gtest/gtest.h>
|
||||||
|
#include <numbers>
|
||||||
|
#include <omath/angle.hpp>
|
||||||
|
|
||||||
|
using namespace omath;
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
|
||||||
|
// Handy aliases (defaults: Type=float, [0,360], Normalized)
|
||||||
|
using Deg = Angle<float, float(0), float(360), AngleFlags::Normalized>;
|
||||||
|
using Pitch = Angle<float, float(-90), float(90), AngleFlags::Clamped>;
|
||||||
|
using Turn = Angle<float, float(-180), float(180), AngleFlags::Normalized>;
|
||||||
|
|
||||||
|
constexpr float kEps = 1e-5f;
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
// ---------- Construction / factories ----------
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, DefaultConstructor_IsZeroDegrees)
|
||||||
|
{
|
||||||
|
Deg a; // default ctor
|
||||||
|
EXPECT_FLOAT_EQ(*a, 0.0f);
|
||||||
|
EXPECT_FLOAT_EQ(a.as_degrees(), 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, FromDegrees_Normalized_WrapsAboveMax)
|
||||||
|
{
|
||||||
|
const Deg a = Deg::from_degrees(370.0f);
|
||||||
|
EXPECT_FLOAT_EQ(a.as_degrees(), 10.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, FromDegrees_Normalized_WrapsBelowMin)
|
||||||
|
{
|
||||||
|
const Deg a = Deg::from_degrees(-10.0f);
|
||||||
|
EXPECT_FLOAT_EQ(a.as_degrees(), 350.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, FromDegrees_Clamped_ClampsToRange)
|
||||||
|
{
|
||||||
|
const Pitch hi = Pitch::from_degrees(100.0f);
|
||||||
|
const Pitch lo = Pitch::from_degrees(-120.0f);
|
||||||
|
|
||||||
|
EXPECT_FLOAT_EQ(hi.as_degrees(), 90.0f);
|
||||||
|
EXPECT_FLOAT_EQ(lo.as_degrees(), -90.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, FromRadians_And_AsRadians)
|
||||||
|
{
|
||||||
|
const Deg a = Deg::from_radians(std::numbers::pi_v<float>);
|
||||||
|
EXPECT_FLOAT_EQ(a.as_degrees(), 180.0f);
|
||||||
|
|
||||||
|
const Deg b = Deg::from_degrees(180.0f);
|
||||||
|
EXPECT_NEAR(b.as_radians(), std::numbers::pi_v<float>, 1e-6f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------- Unary minus & deref ----------
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, UnaryMinus_Normalized)
|
||||||
|
{
|
||||||
|
const Deg a = Deg::from_degrees(30.0f);
|
||||||
|
const Deg b = -a; // wraps to 330 in [0,360)
|
||||||
|
EXPECT_FLOAT_EQ(b.as_degrees(), 330.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, DereferenceReturnsDegrees)
|
||||||
|
{
|
||||||
|
const Deg a = Deg::from_degrees(42.0f);
|
||||||
|
EXPECT_FLOAT_EQ(*a, 42.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------- Trigonometric helpers ----------
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, SinCosTanCot_BasicCases)
|
||||||
|
{
|
||||||
|
const Deg a0 = Deg::from_degrees(0.0f);
|
||||||
|
EXPECT_NEAR(a0.sin(), 0.0f, kEps);
|
||||||
|
EXPECT_NEAR(a0.cos(), 1.0f, kEps);
|
||||||
|
// cot(0) -> cos/sin -> div by 0: allow inf or nan
|
||||||
|
const float cot0 = a0.cot();
|
||||||
|
EXPECT_TRUE(std::isinf(cot0) || std::isnan(cot0));
|
||||||
|
|
||||||
|
const Deg a45 = Deg::from_degrees(45.0f);
|
||||||
|
EXPECT_NEAR(a45.tan(), 1.0f, 1e-4f);
|
||||||
|
EXPECT_NEAR(a45.cot(), 1.0f, 1e-4f);
|
||||||
|
|
||||||
|
const Deg a90 = Deg::from_degrees(90.0f);
|
||||||
|
EXPECT_NEAR(a90.sin(), 1.0f, 1e-4f);
|
||||||
|
EXPECT_NEAR(a90.cos(), 0.0f, 1e-4f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, Atan_IsAtanOfRadians)
|
||||||
|
{
|
||||||
|
// atan(as_radians). For 0° -> atan(0)=0.
|
||||||
|
const Deg a0 = Deg::from_degrees(0.0f);
|
||||||
|
EXPECT_NEAR(a0.atan(), 0.0f, kEps);
|
||||||
|
|
||||||
|
const Deg a45 = Deg::from_degrees(45.0f);
|
||||||
|
// atan(pi/4) ≈ 0.665773...
|
||||||
|
EXPECT_NEAR(a45.atan(), 0.66577375f, 1e-6f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------- Compound arithmetic ----------
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, PlusEquals_Normalized_Wraps)
|
||||||
|
{
|
||||||
|
Deg a = Deg::from_degrees(350.0f);
|
||||||
|
a += Deg::from_degrees(20.0f); // 370 -> 10
|
||||||
|
EXPECT_FLOAT_EQ(a.as_degrees(), 10.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, MinusEquals_Normalized_Wraps)
|
||||||
|
{
|
||||||
|
Deg a = Deg::from_degrees(10.0f);
|
||||||
|
a -= Deg::from_degrees(30.0f); // -20 -> 340
|
||||||
|
EXPECT_FLOAT_EQ(a.as_degrees(), 340.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, PlusEquals_Clamped_Clamps)
|
||||||
|
{
|
||||||
|
Pitch p = Pitch::from_degrees(80.0f);
|
||||||
|
p += Pitch::from_degrees(30.0f); // 110 -> clamp to 90
|
||||||
|
EXPECT_FLOAT_EQ(p.as_degrees(), 90.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, MinusEquals_Clamped_Clamps)
|
||||||
|
{
|
||||||
|
Pitch p = Pitch::from_degrees(-70.0f);
|
||||||
|
p -= Pitch::from_degrees(40.0f); // -110 -> clamp to -90
|
||||||
|
EXPECT_FLOAT_EQ(p.as_degrees(), -90.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------- Alternative ranges ----------
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, NormalizedRange_Neg180To180)
|
||||||
|
{
|
||||||
|
const Turn a = Turn::from_degrees(190.0f); // -> -170
|
||||||
|
const Turn b = Turn::from_degrees(-190.0f); // -> 170
|
||||||
|
|
||||||
|
EXPECT_FLOAT_EQ(a.as_degrees(), -170.0f);
|
||||||
|
EXPECT_FLOAT_EQ(b.as_degrees(), 170.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------- Comparisons (via <=>) ----------
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, Comparisons_WorkWithPartialOrdering)
|
||||||
|
{
|
||||||
|
const Deg a = Deg::from_degrees(10.0f);
|
||||||
|
const Deg b = Deg::from_degrees(20.0f);
|
||||||
|
const Deg c = Deg::from_degrees(10.0f);
|
||||||
|
|
||||||
|
EXPECT_TRUE(a < b);
|
||||||
|
EXPECT_TRUE(b > a);
|
||||||
|
EXPECT_TRUE(a <= c);
|
||||||
|
EXPECT_TRUE(c >= a);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------- std::format formatter ----------
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, Formatter_PrintsDegreesWithSuffix)
|
||||||
|
{
|
||||||
|
const Deg a = Deg::from_degrees(15.0f);
|
||||||
|
EXPECT_EQ(std::format("{}", a), "15deg");
|
||||||
|
|
||||||
|
const Deg b = Deg::from_degrees(10.5f);
|
||||||
|
EXPECT_EQ(std::format("{}", b), "10.5deg");
|
||||||
|
|
||||||
|
const Turn t = Turn::from_degrees(-170.0f);
|
||||||
|
EXPECT_EQ(std::format("{}", t), "-170deg");
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, BinaryPlus_ReturnsWrappedSum)
|
||||||
|
{
|
||||||
|
Angle<> a = Deg::from_degrees(350.0f);
|
||||||
|
const Deg b = Deg::from_degrees(20.0f);
|
||||||
|
const Deg c = a + b; // expect 10°
|
||||||
|
EXPECT_FLOAT_EQ(c.as_degrees(), 10.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestAngle, BinaryMinus_ReturnsWrappedDiff)
|
||||||
|
{
|
||||||
|
Angle<> a = Deg::from_degrees(10.0f);
|
||||||
|
const Deg b = Deg::from_degrees(30.0f);
|
||||||
|
const Deg c = a - b; // expect 340°
|
||||||
|
EXPECT_FLOAT_EQ(c.as_degrees(), 340.0f);
|
||||||
|
}
|
||||||
|
|||||||
@@ -20,20 +20,20 @@ TEST(unit_test_angles, degrees_to_radians)
|
|||||||
|
|
||||||
TEST(unit_test_angles, horizontal_fov_to_verical)
|
TEST(unit_test_angles, horizontal_fov_to_verical)
|
||||||
{
|
{
|
||||||
constexpr float hFov = 90;
|
constexpr float h_fov = 90;
|
||||||
constexpr float aspectRation = 16.0f / 9.0f;
|
constexpr float aspect_ration = 16.0f / 9.0f;
|
||||||
const auto verticalFov = omath::angles::horizontal_fov_to_vertical(hFov, aspectRation);
|
const auto vertical_fov = omath::angles::horizontal_fov_to_vertical(h_fov, aspect_ration);
|
||||||
|
|
||||||
EXPECT_NEAR(verticalFov, 58.71f, 0.01f);
|
EXPECT_NEAR(vertical_fov, 58.71f, 0.01f);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(unit_test_angles, vertical_to_horizontal)
|
TEST(unit_test_angles, vertical_to_horizontal)
|
||||||
{
|
{
|
||||||
constexpr float vFov = 58.71;
|
constexpr float v_fov = 58.71;
|
||||||
constexpr float aspectRation = 16.0f / 9.0f;
|
constexpr float aspect_ration = 16.0f / 9.0f;
|
||||||
const auto horizontalFov = omath::angles::vertical_fov_to_horizontal(vFov, aspectRation);
|
const auto horizontal_fov = omath::angles::vertical_fov_to_horizontal(v_fov, aspect_ration);
|
||||||
|
|
||||||
EXPECT_NEAR(horizontalFov, 89.99f, 0.01f);
|
EXPECT_NEAR(horizontal_fov, 89.99f, 0.01f);
|
||||||
}
|
}
|
||||||
TEST(unit_test_angles, wrap_angle)
|
TEST(unit_test_angles, wrap_angle)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ TEST_F(unit_test_color, Constructor_Float)
|
|||||||
TEST_F(unit_test_color, Constructor_Vector4)
|
TEST_F(unit_test_color, Constructor_Vector4)
|
||||||
{
|
{
|
||||||
constexpr omath::Vector4 vec(0.2f, 0.4f, 0.6f, 0.8f);
|
constexpr omath::Vector4 vec(0.2f, 0.4f, 0.6f, 0.8f);
|
||||||
Color color(vec);
|
constexpr Color color(vec);
|
||||||
EXPECT_FLOAT_EQ(color.x, 0.2f);
|
EXPECT_FLOAT_EQ(color.x, 0.2f);
|
||||||
EXPECT_FLOAT_EQ(color.y, 0.4f);
|
EXPECT_FLOAT_EQ(color.y, 0.4f);
|
||||||
EXPECT_FLOAT_EQ(color.z, 0.6f);
|
EXPECT_FLOAT_EQ(color.z, 0.6f);
|
||||||
@@ -62,16 +62,16 @@ TEST_F(unit_test_color, FromHSV)
|
|||||||
// Test HSV conversion
|
// Test HSV conversion
|
||||||
TEST_F(unit_test_color, ToHSV)
|
TEST_F(unit_test_color, ToHSV)
|
||||||
{
|
{
|
||||||
Hsv hsv = color1.to_hsv(); // Red color
|
const auto [hue, saturation, value] = color1.to_hsv(); // Red color
|
||||||
EXPECT_FLOAT_EQ(hsv.hue, 0.0f);
|
EXPECT_FLOAT_EQ(hue, 0.0f);
|
||||||
EXPECT_FLOAT_EQ(hsv.saturation, 1.0f);
|
EXPECT_FLOAT_EQ(saturation, 1.0f);
|
||||||
EXPECT_FLOAT_EQ(hsv.value, 1.0f);
|
EXPECT_FLOAT_EQ(value, 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test color blending
|
// Test color blending
|
||||||
TEST_F(unit_test_color, Blend)
|
TEST_F(unit_test_color, Blend)
|
||||||
{
|
{
|
||||||
Color blended = color1.blend(color2, 0.5f);
|
const Color blended = color1.blend(color2, 0.5f);
|
||||||
EXPECT_FLOAT_EQ(blended.x, 0.5f);
|
EXPECT_FLOAT_EQ(blended.x, 0.5f);
|
||||||
EXPECT_FLOAT_EQ(blended.y, 0.5f);
|
EXPECT_FLOAT_EQ(blended.y, 0.5f);
|
||||||
EXPECT_FLOAT_EQ(blended.z, 0.0f);
|
EXPECT_FLOAT_EQ(blended.z, 0.0f);
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
// Revised unit‑test suite for LineTracer (segment‑based Möller–Trumbore)
|
// Revised unit‑test suite for LineTracer (segment‑based Möller–Trumbore)
|
||||||
// Pure ASCII: avoids non‑standard characters that MSVC rejects.
|
// Pure ASCII: avoids non‑standard characters that MSVC rejects.
|
||||||
//
|
//
|
||||||
#include "gtest/gtest.h"
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
#include "omath/collision/line_tracer.hpp"
|
#include "omath/collision/line_tracer.hpp"
|
||||||
#include "omath/triangle.hpp"
|
#include "omath/triangle.hpp"
|
||||||
#include "omath/vector3.hpp"
|
#include "gtest/gtest.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
using namespace omath;
|
using namespace omath;
|
||||||
@@ -31,10 +31,10 @@ namespace
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Fixture with one canonical right‑angled triangle in the XY plane.
|
// Fixture with one canonical right‑angled triangle in the XY plane.
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
class lline_tracer_fixture : public ::testing::Test
|
class LineTracerFixture : public ::testing::Test
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
lline_tracer_fixture() :
|
LineTracerFixture() :
|
||||||
triangle({0.f, 0.f, 0.f}, {1.f, 0.f, 0.f}, {0.f, 1.f, 0.f})
|
triangle({0.f, 0.f, 0.f}, {1.f, 0.f, 0.f}, {0.f, 1.f, 0.f})
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ namespace
|
|||||||
bool expected_clear; // true => segment does NOT hit the triangle
|
bool expected_clear; // true => segment does NOT hit the triangle
|
||||||
};
|
};
|
||||||
|
|
||||||
class CanTraceLineParam : public lline_tracer_fixture,
|
class CanTraceLineParam : public LineTracerFixture,
|
||||||
public ::testing::WithParamInterface<TraceCase>
|
public ::testing::WithParamInterface<TraceCase>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
@@ -79,7 +79,7 @@ namespace
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Validate that the reported hit point is correct for a genuine intersection.
|
// Validate that the reported hit point is correct for a genuine intersection.
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
TEST_F(lline_tracer_fixture, HitPointCorrect)
|
TEST_F(LineTracerFixture, HitPointCorrect)
|
||||||
{
|
{
|
||||||
constexpr Ray ray{{0.3f, 0.3f, -1.f}, {0.3f, 0.3f, 1.f}};
|
constexpr Ray ray{{0.3f, 0.3f, -1.f}, {0.3f, 0.3f, 1.f}};
|
||||||
constexpr Vec3 expected{0.3f, 0.3f, 0.f};
|
constexpr Vec3 expected{0.3f, 0.3f, 0.f};
|
||||||
@@ -92,7 +92,7 @@ namespace
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Triangle far beyond the ray should not block.
|
// Triangle far beyond the ray should not block.
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
TEST_F(lline_tracer_fixture, DistantTriangleClear)
|
TEST_F(LineTracerFixture, DistantTriangleClear)
|
||||||
{
|
{
|
||||||
constexpr Ray short_ray{{0.f, 0.f, 0.f}, {0.f, 0.f, 1.f}};
|
constexpr Ray short_ray{{0.f, 0.f, 0.f}, {0.f, 0.f, 1.f}};
|
||||||
constexpr Triangle<Vec3> distant{{1000.f, 1000.f, 1000.f},
|
constexpr Triangle<Vec3> distant{{1000.f, 1000.f, 1000.f},
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
// UnitTestMat.cpp
|
// UnitTestMat.cpp
|
||||||
|
#include "omath/linear_algebra/mat.hpp"
|
||||||
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include "omath/mat.hpp"
|
|
||||||
#include "omath/vector3.hpp"
|
|
||||||
|
|
||||||
using namespace omath;
|
using namespace omath;
|
||||||
|
|
||||||
class unit_test_mat : public ::testing::Test
|
class UnitTestMat : public ::testing::Test
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
Mat<2, 2> m1;
|
Mat<2, 2> m1;
|
||||||
@@ -19,7 +19,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Test constructors
|
// Test constructors
|
||||||
TEST_F(unit_test_mat, Constructor_Default)
|
TEST_F(UnitTestMat, Constructor_Default)
|
||||||
{
|
{
|
||||||
Mat<3, 3> m;
|
Mat<3, 3> m;
|
||||||
EXPECT_EQ(m.row_count(), 3);
|
EXPECT_EQ(m.row_count(), 3);
|
||||||
@@ -29,7 +29,7 @@ TEST_F(unit_test_mat, Constructor_Default)
|
|||||||
EXPECT_FLOAT_EQ(m.at(i, j), 0.0f);
|
EXPECT_FLOAT_EQ(m.at(i, j), 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(unit_test_mat, Constructor_InitializerList)
|
TEST_F(UnitTestMat, Constructor_InitializerList)
|
||||||
{
|
{
|
||||||
constexpr Mat<2, 2> m{{1.0f, 2.0f}, {3.0f, 4.0f}};
|
constexpr Mat<2, 2> m{{1.0f, 2.0f}, {3.0f, 4.0f}};
|
||||||
EXPECT_EQ(m.row_count(), 2);
|
EXPECT_EQ(m.row_count(), 2);
|
||||||
@@ -40,7 +40,7 @@ TEST_F(unit_test_mat, Constructor_InitializerList)
|
|||||||
EXPECT_FLOAT_EQ(m.at(1, 1), 4.0f);
|
EXPECT_FLOAT_EQ(m.at(1, 1), 4.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(unit_test_mat, Operator_SquareBrackets)
|
TEST_F(UnitTestMat, Operator_SquareBrackets)
|
||||||
{
|
{
|
||||||
EXPECT_EQ((m2[0, 0]), 1.0f);
|
EXPECT_EQ((m2[0, 0]), 1.0f);
|
||||||
EXPECT_EQ((m2[0, 1]), 2.0f);
|
EXPECT_EQ((m2[0, 1]), 2.0f);
|
||||||
@@ -48,7 +48,7 @@ TEST_F(unit_test_mat, Operator_SquareBrackets)
|
|||||||
EXPECT_EQ((m2[1, 1]), 4.0f);
|
EXPECT_EQ((m2[1, 1]), 4.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(unit_test_mat, Constructor_Copy)
|
TEST_F(UnitTestMat, Constructor_Copy)
|
||||||
{
|
{
|
||||||
Mat<2, 2> m3 = m2;
|
Mat<2, 2> m3 = m2;
|
||||||
EXPECT_EQ(m3.row_count(), m2.row_count());
|
EXPECT_EQ(m3.row_count(), m2.row_count());
|
||||||
@@ -57,7 +57,7 @@ TEST_F(unit_test_mat, Constructor_Copy)
|
|||||||
EXPECT_FLOAT_EQ(m3.at(1, 1), m2.at(1, 1));
|
EXPECT_FLOAT_EQ(m3.at(1, 1), m2.at(1, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(unit_test_mat, Constructor_Move)
|
TEST_F(UnitTestMat, Constructor_Move)
|
||||||
{
|
{
|
||||||
Mat<2, 2> m3 = std::move(m2);
|
Mat<2, 2> m3 = std::move(m2);
|
||||||
EXPECT_EQ(m3.row_count(), 2);
|
EXPECT_EQ(m3.row_count(), 2);
|
||||||
@@ -68,7 +68,7 @@ TEST_F(unit_test_mat, Constructor_Move)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Test matrix operations
|
// Test matrix operations
|
||||||
TEST_F(unit_test_mat, Operator_Multiplication_Matrix)
|
TEST_F(UnitTestMat, Operator_Multiplication_Matrix)
|
||||||
{
|
{
|
||||||
Mat<2, 2> m3 = m2 * m2;
|
Mat<2, 2> m3 = m2 * m2;
|
||||||
EXPECT_EQ(m3.row_count(), 2);
|
EXPECT_EQ(m3.row_count(), 2);
|
||||||
@@ -79,14 +79,14 @@ TEST_F(unit_test_mat, Operator_Multiplication_Matrix)
|
|||||||
EXPECT_FLOAT_EQ(m3.at(1, 1), 22.0f);
|
EXPECT_FLOAT_EQ(m3.at(1, 1), 22.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(unit_test_mat, Operator_Multiplication_Scalar)
|
TEST_F(UnitTestMat, Operator_Multiplication_Scalar)
|
||||||
{
|
{
|
||||||
Mat<2, 2> m3 = m2 * 2.0f;
|
Mat<2, 2> m3 = m2 * 2.0f;
|
||||||
EXPECT_FLOAT_EQ(m3.at(0, 0), 2.0f);
|
EXPECT_FLOAT_EQ(m3.at(0, 0), 2.0f);
|
||||||
EXPECT_FLOAT_EQ(m3.at(1, 1), 8.0f);
|
EXPECT_FLOAT_EQ(m3.at(1, 1), 8.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(unit_test_mat, Operator_Division_Scalar)
|
TEST_F(UnitTestMat, Operator_Division_Scalar)
|
||||||
{
|
{
|
||||||
Mat<2, 2> m3 = m2 / 2.0f;
|
Mat<2, 2> m3 = m2 / 2.0f;
|
||||||
EXPECT_FLOAT_EQ(m3.at(0, 0), 0.5f);
|
EXPECT_FLOAT_EQ(m3.at(0, 0), 0.5f);
|
||||||
@@ -94,7 +94,7 @@ TEST_F(unit_test_mat, Operator_Division_Scalar)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Test matrix functions
|
// Test matrix functions
|
||||||
TEST_F(unit_test_mat, Transpose)
|
TEST_F(UnitTestMat, Transpose)
|
||||||
{
|
{
|
||||||
Mat<2, 2> m3 = m2.transposed();
|
Mat<2, 2> m3 = m2.transposed();
|
||||||
EXPECT_FLOAT_EQ(m3.at(0, 0), m2.at(0, 0));
|
EXPECT_FLOAT_EQ(m3.at(0, 0), m2.at(0, 0));
|
||||||
@@ -103,19 +103,19 @@ TEST_F(unit_test_mat, Transpose)
|
|||||||
EXPECT_FLOAT_EQ(m3.at(1, 1), m2.at(1, 1));
|
EXPECT_FLOAT_EQ(m3.at(1, 1), m2.at(1, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(unit_test_mat, Determinant)
|
TEST_F(UnitTestMat, Determinant)
|
||||||
{
|
{
|
||||||
const float det = m2.determinant();
|
const float det = m2.determinant();
|
||||||
EXPECT_FLOAT_EQ(det, -2.0f);
|
EXPECT_FLOAT_EQ(det, -2.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(unit_test_mat, Sum)
|
TEST_F(UnitTestMat, Sum)
|
||||||
{
|
{
|
||||||
const float sum = m2.sum();
|
const float sum = m2.sum();
|
||||||
EXPECT_FLOAT_EQ(sum, 10.0f);
|
EXPECT_FLOAT_EQ(sum, 10.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(unit_test_mat, Clear)
|
TEST_F(UnitTestMat, Clear)
|
||||||
{
|
{
|
||||||
m2.clear();
|
m2.clear();
|
||||||
for (size_t i = 0; i < m2.row_count(); ++i)
|
for (size_t i = 0; i < m2.row_count(); ++i)
|
||||||
@@ -123,15 +123,15 @@ TEST_F(unit_test_mat, Clear)
|
|||||||
EXPECT_FLOAT_EQ(m2.at(i, j), 0.0f);
|
EXPECT_FLOAT_EQ(m2.at(i, j), 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(unit_test_mat, ToString)
|
TEST_F(UnitTestMat, ToString)
|
||||||
{
|
{
|
||||||
const std::string str = m2.to_string();
|
const std::string str = std::format("{}", m2);
|
||||||
EXPECT_FALSE(str.empty());
|
EXPECT_FALSE(str.empty());
|
||||||
EXPECT_EQ(str, "[[ 1.000, 2.000]\n [ 3.000, 4.000]]");
|
EXPECT_EQ(str, "[[ 1.000, 2.000]\n [ 3.000, 4.000]]");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test assignment operators
|
// Test assignment operators
|
||||||
TEST_F(unit_test_mat, AssignmentOperator_Copy)
|
TEST_F(UnitTestMat, AssignmentOperator_Copy)
|
||||||
{
|
{
|
||||||
Mat<2, 2> m3;
|
Mat<2, 2> m3;
|
||||||
m3 = m2;
|
m3 = m2;
|
||||||
@@ -140,7 +140,7 @@ TEST_F(unit_test_mat, AssignmentOperator_Copy)
|
|||||||
EXPECT_FLOAT_EQ(m3.at(0, 0), m2.at(0, 0));
|
EXPECT_FLOAT_EQ(m3.at(0, 0), m2.at(0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(unit_test_mat, AssignmentOperator_Move)
|
TEST_F(UnitTestMat, AssignmentOperator_Move)
|
||||||
{
|
{
|
||||||
Mat<2, 2> m3;
|
Mat<2, 2> m3;
|
||||||
m3 = std::move(m2);
|
m3 = std::move(m2);
|
||||||
@@ -152,7 +152,7 @@ TEST_F(unit_test_mat, AssignmentOperator_Move)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Test static methods
|
// Test static methods
|
||||||
TEST_F(unit_test_mat, StaticMethod_ToScreenMat)
|
TEST_F(UnitTestMat, StaticMethod_ToScreenMat)
|
||||||
{
|
{
|
||||||
Mat<4, 4> screenMat = Mat<4, 4>::to_screen_mat(800.0f, 600.0f);
|
Mat<4, 4> screenMat = Mat<4, 4>::to_screen_mat(800.0f, 600.0f);
|
||||||
EXPECT_FLOAT_EQ(screenMat.at(0, 0), 400.0f);
|
EXPECT_FLOAT_EQ(screenMat.at(0, 0), 400.0f);
|
||||||
@@ -164,11 +164,11 @@ TEST_F(unit_test_mat, StaticMethod_ToScreenMat)
|
|||||||
|
|
||||||
|
|
||||||
// Test exception handling in At() method
|
// Test exception handling in At() method
|
||||||
TEST_F(unit_test_mat, Method_At_OutOfRange)
|
TEST_F(UnitTestMat, Method_At_OutOfRange)
|
||||||
{
|
{
|
||||||
#if !defined(NDEBUG) && defined(OMATH_SUPRESS_SAFETY_CHECKS)
|
#if !defined(NDEBUG) && defined(OMATH_SUPRESS_SAFETY_CHECKS)
|
||||||
EXPECT_THROW(std::ignore = m2.At(2, 0), std::out_of_range);
|
EXPECT_THROW(std::ignore = m2.at(2, 0), std::out_of_range);
|
||||||
EXPECT_THROW(std::ignore = m2.At(0, 2), std::out_of_range);
|
EXPECT_THROW(std::ignore = m2.at(0, 2), std::out_of_range);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,180 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by vlad on 5/18/2024.
|
|
||||||
//
|
|
||||||
#include <gtest/gtest.h>
|
|
||||||
#include <omath/matrix.hpp>
|
|
||||||
#include "omath/vector3.hpp"
|
|
||||||
|
|
||||||
using namespace omath;
|
|
||||||
|
|
||||||
|
|
||||||
class UnitTestMatrix : public ::testing::Test
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
Matrix m1;
|
|
||||||
Matrix m2;
|
|
||||||
|
|
||||||
void SetUp() override
|
|
||||||
{
|
|
||||||
m1 = Matrix(2, 2);
|
|
||||||
m2 = Matrix{{1.0f, 2.0f}, {3.0f, 4.0f}};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Test constructors
|
|
||||||
TEST_F(UnitTestMatrix, Constructor_Size)
|
|
||||||
{
|
|
||||||
const Matrix m(3, 3);
|
|
||||||
EXPECT_EQ(m.row_count(), 3);
|
|
||||||
EXPECT_EQ(m.columns_count(), 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, Operator_SquareBrackets)
|
|
||||||
{
|
|
||||||
EXPECT_EQ((m2[0, 0]), 1.0f);
|
|
||||||
EXPECT_EQ((m2[0, 1]), 2.0f);
|
|
||||||
EXPECT_EQ((m2[1, 0]), 3.0f);
|
|
||||||
EXPECT_EQ((m2[1, 1]), 4.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, Constructor_InitializerList)
|
|
||||||
{
|
|
||||||
Matrix m{{1.0f, 2.0f}, {3.0f, 4.0f}};
|
|
||||||
EXPECT_EQ(m.row_count(), 2);
|
|
||||||
EXPECT_EQ(m.columns_count(), 2);
|
|
||||||
EXPECT_FLOAT_EQ(m.at(0, 0), 1.0f);
|
|
||||||
EXPECT_FLOAT_EQ(m.at(1, 1), 4.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, Constructor_Copy)
|
|
||||||
{
|
|
||||||
Matrix m3 = m2;
|
|
||||||
EXPECT_EQ(m3.row_count(), m2.row_count());
|
|
||||||
EXPECT_EQ(m3.columns_count(), m2.columns_count());
|
|
||||||
EXPECT_FLOAT_EQ(m3.at(0, 0), m2.at(0, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, Constructor_Move)
|
|
||||||
{
|
|
||||||
Matrix m3 = std::move(m2);
|
|
||||||
EXPECT_EQ(m3.row_count(), 2);
|
|
||||||
EXPECT_EQ(m3.columns_count(), 2);
|
|
||||||
EXPECT_FLOAT_EQ(m3.at(0, 0), 1.0f);
|
|
||||||
EXPECT_EQ(m2.row_count(), 0); // m2 should be empty after the move
|
|
||||||
EXPECT_EQ(m2.columns_count(), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test matrix operations
|
|
||||||
TEST_F(UnitTestMatrix, Operator_Multiplication_Matrix)
|
|
||||||
{
|
|
||||||
Matrix m3 = m2 * m2;
|
|
||||||
EXPECT_EQ(m3.row_count(), 2);
|
|
||||||
EXPECT_EQ(m3.columns_count(), 2);
|
|
||||||
EXPECT_FLOAT_EQ(m3.at(0, 0), 7.0f);
|
|
||||||
EXPECT_FLOAT_EQ(m3.at(1, 1), 22.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, Operator_Multiplication_Scalar)
|
|
||||||
{
|
|
||||||
Matrix m3 = m2 * 2.0f;
|
|
||||||
EXPECT_FLOAT_EQ(m3.at(0, 0), 2.0f);
|
|
||||||
EXPECT_FLOAT_EQ(m3.at(1, 1), 8.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, Operator_Division_Scalar)
|
|
||||||
{
|
|
||||||
Matrix m3 = m2 / 2.0f;
|
|
||||||
EXPECT_FLOAT_EQ(m3.at(0, 0), 0.5f);
|
|
||||||
EXPECT_FLOAT_EQ(m3.at(1, 1), 2.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test matrix functions
|
|
||||||
TEST_F(UnitTestMatrix, Transpose)
|
|
||||||
{
|
|
||||||
Matrix m3 = m2.transpose();
|
|
||||||
EXPECT_FLOAT_EQ(m3.at(0, 1), 3.0f);
|
|
||||||
EXPECT_FLOAT_EQ(m3.at(1, 0), 2.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, Determinant)
|
|
||||||
{
|
|
||||||
const float det = m2.determinant();
|
|
||||||
EXPECT_FLOAT_EQ(det, -2.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, Minor)
|
|
||||||
{
|
|
||||||
const float minor = m2.minor(0, 0);
|
|
||||||
EXPECT_FLOAT_EQ(minor, 4.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, AlgComplement)
|
|
||||||
{
|
|
||||||
const float algComp = m2.alg_complement(0, 0);
|
|
||||||
EXPECT_FLOAT_EQ(algComp, 4.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, Strip)
|
|
||||||
{
|
|
||||||
Matrix m3 = m2.strip(0, 0);
|
|
||||||
EXPECT_EQ(m3.row_count(), 1);
|
|
||||||
EXPECT_EQ(m3.columns_count(), 1);
|
|
||||||
EXPECT_FLOAT_EQ(m3.at(0, 0), 4.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, ProjectionMatrix)
|
|
||||||
{
|
|
||||||
const Matrix proj = Matrix::projection_matrix(45.0f, 1.33f, 0.1f, 100.0f);
|
|
||||||
EXPECT_EQ(proj.row_count(), 4);
|
|
||||||
EXPECT_EQ(proj.columns_count(), 4);
|
|
||||||
// Further checks on projection matrix elements could be added
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test other member functions
|
|
||||||
TEST_F(UnitTestMatrix, Set)
|
|
||||||
{
|
|
||||||
m1.set(3.0f);
|
|
||||||
EXPECT_FLOAT_EQ(m1.at(0, 0), 3.0f);
|
|
||||||
EXPECT_FLOAT_EQ(m1.at(1, 1), 3.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, Sum)
|
|
||||||
{
|
|
||||||
const float sum = m2.sum();
|
|
||||||
EXPECT_FLOAT_EQ(sum, 10.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, Clear)
|
|
||||||
{
|
|
||||||
m2.clear();
|
|
||||||
EXPECT_FLOAT_EQ(m2.at(0, 0), 0.0f);
|
|
||||||
EXPECT_FLOAT_EQ(m2.at(1, 1), 0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, ToString)
|
|
||||||
{
|
|
||||||
const std::string str = m2.to_string();
|
|
||||||
EXPECT_FALSE(str.empty());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test assignment operators
|
|
||||||
TEST_F(UnitTestMatrix, AssignmentOperator_Copy)
|
|
||||||
{
|
|
||||||
Matrix m3(2, 2);
|
|
||||||
m3 = m2;
|
|
||||||
EXPECT_EQ(m3.row_count(), m2.row_count());
|
|
||||||
EXPECT_EQ(m3.columns_count(), m2.columns_count());
|
|
||||||
EXPECT_FLOAT_EQ(m3.at(0, 0), m2.at(0, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(UnitTestMatrix, AssignmentOperator_Move)
|
|
||||||
{
|
|
||||||
Matrix m3(2, 2);
|
|
||||||
m3 = std::move(m2);
|
|
||||||
EXPECT_EQ(m3.row_count(), 2);
|
|
||||||
EXPECT_EQ(m3.columns_count(), 2);
|
|
||||||
EXPECT_FLOAT_EQ(m3.at(0, 0), 1.0f);
|
|
||||||
EXPECT_EQ(m2.row_count(), 0); // m2 should be empty after the move
|
|
||||||
EXPECT_EQ(m2.columns_count(), 0);
|
|
||||||
}
|
|
||||||
@@ -9,9 +9,17 @@
|
|||||||
|
|
||||||
TEST(UnitTestProjection, Projection)
|
TEST(UnitTestProjection, Projection)
|
||||||
{
|
{
|
||||||
const auto x = omath::Angle<float, 0.f, 180.f, omath::AngleFlags::Clamped>::from_degrees(90.f);
|
constexpr auto fov = omath::Angle<float, 0.f, 180.f, omath::AngleFlags::Clamped>::from_degrees(90.f);
|
||||||
auto cam = omath::source_engine::Camera({0, 0, 0}, omath::source_engine::ViewAngles{}, {1920.f, 1080.f}, x, 0.01f, 1000.f);
|
const auto cam = omath::source_engine::Camera({0, 0, 0}, omath::source_engine::ViewAngles{}, {1920.f, 1080.f}, fov,
|
||||||
|
0.01f, 1000.f);
|
||||||
|
|
||||||
const auto projected = cam.world_to_screen({1000, 0, 50});
|
const auto projected = cam.world_to_screen({1000.f, 0, 50.f});
|
||||||
std::print("{} {} {}", projected->x, projected->y, projected->z);
|
const auto result = cam.screen_to_world(projected.value());
|
||||||
|
const auto result2 = cam.world_to_screen(result.value());
|
||||||
|
|
||||||
|
EXPECT_EQ(static_cast<omath::Vector2<float>>(projected.value()),
|
||||||
|
static_cast<omath::Vector2<float>>(result2.value()));
|
||||||
|
EXPECT_NEAR(projected->x, 960.f, 0.001f);
|
||||||
|
EXPECT_NEAR(projected->y, 504.f, 0.001f);
|
||||||
|
EXPECT_NEAR(projected->z, 1.f, 0.001f);
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
//
|
//
|
||||||
// Created by Orange on 1/6/2025.
|
// Created by Orange on 1/6/2025.
|
||||||
//
|
//
|
||||||
|
#include "omath/triangle.hpp"
|
||||||
|
#include "omath/linear_algebra/vector3.hpp"
|
||||||
#include <cmath> // For std::sqrt, std::isinf, std::isnan
|
#include <cmath> // For std::sqrt, std::isinf, std::isnan
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <omath/vector3.hpp>
|
|
||||||
#include "omath/triangle.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
using namespace omath;
|
using namespace omath;
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
// Created by Vlad on 02.09.2024.
|
// Created by Vlad on 02.09.2024.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <omath/linear_algebra/vector2.hpp>
|
||||||
#include <cfloat> // For FLT_MAX and FLT_MIN
|
#include <cfloat> // For FLT_MAX and FLT_MIN
|
||||||
#include <cmath> // For std::isinf and std::isnan
|
#include <cmath> // For std::isinf and std::isnan
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <omath/vector2.hpp>
|
|
||||||
|
|
||||||
using namespace omath;
|
using namespace omath;
|
||||||
|
|
||||||
@@ -346,6 +346,28 @@ TEST_F(UnitTestVector2, NegationOperator_ZeroVector)
|
|||||||
EXPECT_FLOAT_EQ(result.y, -0.0f);
|
EXPECT_FLOAT_EQ(result.y, -0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(UnitTestVector2, LessOperator)
|
||||||
|
{
|
||||||
|
EXPECT_TRUE(v1 < v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(UnitTestVector2, GreaterOperator)
|
||||||
|
{
|
||||||
|
EXPECT_TRUE(v2 > v1);
|
||||||
|
}
|
||||||
|
TEST_F(UnitTestVector2, LessEqualOperator)
|
||||||
|
{
|
||||||
|
EXPECT_TRUE(omath::Vector2<float>{} <= omath::Vector2<float>{});
|
||||||
|
EXPECT_TRUE(omath::Vector2<float>{} <= omath::Vector2(1.f, 1.f));
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(UnitTestVector2, GreaterEqualOperator)
|
||||||
|
{
|
||||||
|
EXPECT_TRUE(omath::Vector2<float>{} >= omath::Vector2<float>{});
|
||||||
|
EXPECT_TRUE(omath::Vector2(1.f, 1.f) >= omath::Vector2<float>{});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Static assertions (compile-time checks)
|
// Static assertions (compile-time checks)
|
||||||
static_assert(Vector2(1.0f, 2.0f).length_sqr() == 5.0f, "LengthSqr should be 5");
|
static_assert(Vector2(1.0f, 2.0f).length_sqr() == 5.0f, "LengthSqr should be 5");
|
||||||
static_assert(Vector2(1.0f, 2.0f).dot(Vector2(4.0f, 5.0f)) == 14.0f, "Dot product should be 14");
|
static_assert(Vector2(1.0f, 2.0f).dot(Vector2(4.0f, 5.0f)) == 14.0f, "Dot product should be 14");
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user