MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / updateRenderChangesByParent

Method updateRenderChangesByParent

Engine/source/scene/sceneObject.cpp:1699–1720  ·  view source on GitHub ↗

This function will move the rendered image based on how much it's parent have moved since the processtick. For some reason the player object must be updated via it's GetRenderTransform seen below, Other objects seem to require getTransform() only

Source from the content-addressed store, hash-verified

1697// For some reason the player object must be updated via it's GetRenderTransform seen below,
1698// Other objects seem to require getTransform() only
1699void SceneObject::updateRenderChangesByParent(){
1700 if (getParent() != NULL){
1701 MatrixF renderXform = getParent()->getRenderTransform();
1702 MatrixF xform = getParent()->getTransform();
1703 xform.affineInverse();
1704
1705 MatrixF offset;
1706 offset.mul(renderXform, xform);
1707
1708 MatrixF mat;
1709
1710 //add the "offset" caused by the parents change, and add it to it's own
1711 // This is needed by objects that update their own render transform thru interpolate tick
1712 // Mostly for stationary objects.
1713
1714 if (getClassName() == StringTable->insert("Player"))
1715 mat.mul(offset,getRenderTransform());
1716 else
1717 mat.mul(offset,getTransform());
1718 setRenderTransform(mat);
1719 }
1720}
1721
1722
1723

Callers

nothing calls this directly

Calls 4

getRenderTransformMethod · 0.45
getTransformMethod · 0.45
mulMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected