| 954 | } |
| 955 | |
| 956 | void 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 | |
| 972 | void PhysicsBody::onEnter() |
| 973 | { |
nothing calls this directly
no test coverage detected