diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..d074535 --- /dev/null +++ b/.clang-format @@ -0,0 +1,62 @@ +# Generated from CLion C/C++ Code Style settings +--- +Language: Cpp +BasedOnStyle: LLVM +AccessModifierOffset: -4 +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignOperands: true +AlignTrailingComments: false +AllowShortBlocksOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AlwaysBreakTemplateDeclarations: Yes +BraceWrapping: + AfterCaseLabel: true + AfterClass: true + AfterControlStatement: true + AfterEnum: true + AfterFunction: true + AfterNamespace: true + AfterStruct: true + AfterUnion: true + AfterExternBlock: true + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: true + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBraces: Custom +BreakConstructorInitializers: AfterColon +BreakConstructorInitializersBeforeComma: false +ColumnLimit: 120 +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ContinuationIndentWidth: 8 +IncludeCategories: + - Regex: '^<.*' + Priority: 1 + - Regex: '^".*' + Priority: 2 + - Regex: '.*' + Priority: 3 +IncludeIsMainRegex: '([-_](test|unittest))?$' +IndentCaseLabels: true +IndentWidth: 4 +InsertNewlineAtEOF: true +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: All +PointerAlignment: Left +SpaceAfterCStyleCast: true +SpaceAfterTemplateKeyword: false +SpaceBeforeRangeBasedForLoopColon: false +SpaceInEmptyParentheses: false +SpacesInAngles: false +SpacesInConditionalStatement: false +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +TabWidth: 4 +... diff --git a/include/omath/Matrix.hpp b/include/omath/Matrix.hpp index 81e7b4f..1fbdb4b 100644 --- a/include/omath/Matrix.hpp +++ b/include/omath/Matrix.hpp @@ -1,7 +1,7 @@ #pragma once +#include #include #include -#include namespace omath { @@ -27,11 +27,11 @@ namespace omath [[nodiscard]] static Matrix ProjectionMatrix(float fieldOfView, float aspectRatio, float near, float far); - Matrix(const Matrix &other); + Matrix(const Matrix& other); - Matrix(size_t rows, size_t columns, const float *pRaw); + Matrix(size_t rows, size_t columns, const float* pRaw); - Matrix(Matrix &&other) noexcept; + Matrix(Matrix&& other) noexcept; [[nodiscard]] size_t RowCount() const noexcept; @@ -43,7 +43,7 @@ namespace omath std::pair Size() const noexcept; [[nodiscard]] - float &At(size_t iRow, size_t iCol); + float& At(size_t iRow, size_t iCol); [[nodiscard]] float Sum(); @@ -56,17 +56,17 @@ namespace omath void Set(float val); [[nodiscard]] - const float &At(size_t iRow, size_t iCol) const; + const float& At(size_t iRow, size_t iCol) const; - Matrix operator*(const Matrix &other) const; + Matrix operator*(const Matrix& other) const; - Matrix& operator*=(const Matrix &other); + Matrix& operator*=(const Matrix& other); Matrix operator*(float f) const; - Matrix &operator*=(float f); + Matrix& operator*=(float f); - Matrix &operator/=(float f); + Matrix& operator/=(float f); void Clear(); @@ -85,9 +85,9 @@ namespace omath [[nodiscard]] const float* Raw() const; - Matrix &operator=(const Matrix &other); + Matrix& operator=(const Matrix& other); - Matrix &operator=(Matrix &&other) noexcept; + Matrix& operator=(Matrix&& other) noexcept; Matrix operator/(float f) const; @@ -101,4 +101,4 @@ namespace omath size_t m_columns; std::unique_ptr m_data; }; -} \ No newline at end of file +} // namespace omath