Changeset View
Changeset View
Standalone View
Standalone View
source/maths/Matrix3D.h
/* Copyright (C) 2019 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | return CMatrix3D( | ||||
_41*matrix._12 + _42*matrix._22 + _43*matrix._32 + _44*matrix._42, | _41*matrix._12 + _42*matrix._22 + _43*matrix._32 + _44*matrix._42, | ||||
_41*matrix._13 + _42*matrix._23 + _43*matrix._33 + _44*matrix._43, | _41*matrix._13 + _42*matrix._23 + _43*matrix._33 + _44*matrix._43, | ||||
_41*matrix._14 + _42*matrix._24 + _43*matrix._34 + _44*matrix._44 | _41*matrix._14 + _42*matrix._24 + _43*matrix._34 + _44*matrix._44 | ||||
); | ); | ||||
} | } | ||||
// matrix multiplication/assignment | // matrix multiplication/assignment | ||||
CMatrix3D& operator*=(const CMatrix3D &matrix) | CMatrix3D& operator*=(const CMatrix3D &matrix) | ||||
{ | { | ||||
Concatenate(matrix); | return *this = *this * matrix; | ||||
vladislavbelovUnsubmitted Done Inline Actionsvladislavbelov: ```lang=cpp
return *this = *this * matrix;
``` | |||||
return *this; | |||||
} | } | ||||
// matrix scaling | // matrix scaling | ||||
CMatrix3D operator*(float f) const | CMatrix3D operator*(float f) const | ||||
{ | { | ||||
return CMatrix3D( | return CMatrix3D( | ||||
_11*f, _12*f, _13*f, _14*f, | _11*f, _12*f, _13*f, _14*f, | ||||
_21*f, _22*f, _23*f, _24*f, | _21*f, _22*f, _23*f, _24*f, | ||||
▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator