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

Method afterSimulation

core/physics/PhysicsBody.cpp:956–970  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

954}
955
956void PhysicsBody::afterSimulation(const Mat4& parentToWorldTransform, float parentRotation)
957{
958 // set Node position
959 auto tmp = getPosition();
960 Vec3 positionInParent(tmp.x, tmp.y, 0.f);
961 if (_recordPosX != positionInParent.x || _recordPosY != positionInParent.y)
962 {
963 parentToWorldTransform.getInversed().transformVector(positionInParent.x, positionInParent.y, positionInParent.z,
964 1.f, &positionInParent);
965 _owner->setPosition(positionInParent.x - _offset.x, positionInParent.y - _offset.y);
966 }
967
968 // set Node rotation
969 _owner->setRotation(getRotation() - parentRotation);
970}
971
972void PhysicsBody::onEnter()
973{

Callers

nothing calls this directly

Calls 6

transformVectorMethod · 0.80
getPositionFunction · 0.50
getRotationFunction · 0.50
getInversedMethod · 0.45
setPositionMethod · 0.45
setRotationMethod · 0.45

Tested by

no test coverage detected