MCPcopy Create free account
hub / github.com/CesiumGS/cesium-native / applyTransform

Method applyTransform

CesiumGltf/src/KhrTextureTransform.cpp:47–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47glm::dvec2
48KhrTextureTransform::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}

Callers 4

transformBufferViewFunction · 0.80
sampleNearestPixelMethod · 0.80
applyTransformFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected