Commit 7febbfc7 authored by Viktor Lidholt's avatar Viktor Lidholt

Correctly resets targets for kinematic sprite physics bodies

parent f77319fc
......@@ -112,6 +112,13 @@ class PhysicsNode extends Node {
for (box2d.Body b2Body = b2World.bodyList; b2Body != null; b2Body = b2Body.getNext()) {
// Update visual position and rotation
PhysicsBody body = b2Body.userData;
if (b2Body.getType() == box2d.BodyType.KINEMATIC) {
body._targetPosition = null;
body._targetAngle = null;
}
// Update visual position and rotation
body._node._setPositionFromPhysics(new Point(
b2Body.position.x * b2WorldToNodeConversionFactor,
b2Body.position.y * b2WorldToNodeConversionFactor
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment