MCPcopy Create free account
hub / github.com/axmolengine/axmol / beforeSimulation

Method beforeSimulation

core/physics/PhysicsWorld.cpp:1069–1089  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1067}
1068
1069void PhysicsWorld::beforeSimulation(Node* node,
1070 const Mat4& parentToWorldTransform,
1071 float nodeParentScaleX,
1072 float nodeParentScaleY,
1073 float parentRotation)
1074{
1075 auto scaleX = nodeParentScaleX * node->getScaleX();
1076 auto scaleY = nodeParentScaleY * node->getScaleY();
1077 auto rotation = parentRotation + node->getRotation();
1078
1079 auto nodeToWorldTransform = parentToWorldTransform * node->getNodeToParentTransform();
1080
1081 auto physicsBody = node->getPhysicsBody();
1082 if (physicsBody)
1083 {
1084 physicsBody->beforeSimulation(parentToWorldTransform, nodeToWorldTransform, scaleX, scaleY, rotation);
1085 }
1086
1087 for (auto&& child : node->getChildren())
1088 beforeSimulation(child, nodeToWorldTransform, scaleX, scaleY, rotation);
1089}
1090
1091void PhysicsWorld::afterSimulation(Node* node, const Mat4& parentToWorldTransform, float parentRotation)
1092{

Callers

nothing calls this directly

Calls 4

getScaleXMethod · 0.45
getScaleYMethod · 0.45
getRotationMethod · 0.45

Tested by

no test coverage detected