Skip to content

Commit

Permalink
Fix sprite rotation ignored, #58
Browse files Browse the repository at this point in the history
  • Loading branch information
kotcrab committed Nov 12, 2015
1 parent 8c366c9 commit 9c7f970
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Runtime/CHANGES
@@ -1,4 +1,5 @@
[0.2.6] [LibGDX 1.7.0] [Artemis 0.13.1] [Snapshot]
-Fixed rotation of sprite ignored when creating physics body

[0.2.5] [LibGDX 1.7.0] [Artemis 0.13.1]
-Updated to Artemis 0.13.1, LibGDX 1.7.0
Expand Down
Expand Up @@ -20,6 +20,7 @@
import com.artemis.Entity;
import com.artemis.Manager;
import com.artemis.annotations.Wire;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.*;
import com.kotcrab.vis.runtime.component.PhysicsComponent;
Expand Down Expand Up @@ -59,6 +60,7 @@ public void added (int entityId) {

BodyDef bodyDef = new BodyDef();
bodyDef.position.set(worldPos);
bodyDef.angle = MathUtils.degreesToRadians * sprite.getRotation();

Body body = world.createBody(bodyDef);
body.setType(physicsProperties.bodyType);
Expand Down

0 comments on commit 9c7f970

Please sign in to comment.