MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / PropagateTransformsDown

Method PropagateTransformsDown

Source/Objects/group.cpp:257–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257void Group::PropagateTransformsDown(bool deep) {
258 for (auto& child : children) {
259 Object* obj = child.direct_ptr;
260 if (obj) {
261 obj->SetScale((invert(child.rel_rotation) * child.rel_scale) * scale_);
262 obj->SetRotation(GetRotation() * child.rel_rotation);
263 obj->SetTranslation(translation_ + (GetRotation() * (scale_ * child.rel_translation)));
264
265 if (deep && obj->IsGroupDerived()) {
266 Group* group = static_cast<Group*>(obj);
267 group->PropagateTransformsDown(deep);
268 }
269 }
270 }
271 child_transforms_need_update = false;
272 child_moved = false;
273}
274
275void Group::PreDrawCamera(float curr_game_time) {
276 if (g_debug_runtime_disable_group_pre_draw_camera) {

Callers 4

ReplaceObjectsMethod · 0.45
PreDrawFrameMethod · 0.45

Calls 6

GetRotationFunction · 0.85
invertFunction · 0.50
SetScaleMethod · 0.45
SetRotationMethod · 0.45
SetTranslationMethod · 0.45
IsGroupDerivedMethod · 0.45

Tested by

no test coverage detected