| 45 | } |
| 46 | |
| 47 | glm::dvec2 |
| 48 | KhrTextureTransform::applyTransform(double u, double v) const noexcept { |
| 49 | glm::dvec2 scaled{u * this->_scale.x, v * this->_scale.y}; |
| 50 | |
| 51 | const double sin = this->_rotationSineCosine.x; |
| 52 | const double cos = this->_rotationSineCosine.y; |
| 53 | // u' = u cos(r) + v sin(r) |
| 54 | // v' = v cos(r) - u sin(r) |
| 55 | glm::dvec2 scaledAndRotated{0, 0}; |
| 56 | scaledAndRotated.x = scaled.x * cos + scaled.y * sin; |
| 57 | scaledAndRotated.y = scaled.y * cos - scaled.x * sin; |
| 58 | |
| 59 | return scaledAndRotated + this->_offset; |
| 60 | } |
no outgoing calls
no test coverage detected