MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / transform

Method transform

source/game/StarDrawable.cpp:191–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191void Drawable::transform(Mat3F const& transformation) {
192 Vec2F localTranslation = transformation.transformVec2(Vec2F());
193 Mat3F localTransform = Mat3F::translation(-localTranslation) * transformation;
194
195 if (auto line = part.ptr<LinePart>())
196 line->line.transform(localTransform);
197 else if (auto poly = part.ptr<PolyPart>())
198 poly->poly.transform(localTransform);
199 else if (auto image = part.ptr<ImagePart>())
200 image->transformation = localTransform * image->transformation;
201
202 position = transformation.transformVec2(position);
203}
204
205void Drawable::rebase(Vec2F const& newBase) {
206 if (auto line = part.ptr<LinePart>())

Callers 12

damageSourcesMethod · 0.45
movingCollisionMethod · 0.45
previewAddBiomeRegionMethod · 0.45
getSwimmingNeighborsMethod · 0.45
transformAllMethod · 0.45
damageSourcesMethod · 0.45
partPolyMethod · 0.45
drawablesWithZLevelMethod · 0.45
toMethod · 0.45

Calls 1

transformVec2Method · 0.80

Tested by

no test coverage detected