Permalink
Browse files

Take the connected objects rotation into account.

  • Loading branch information...
1 parent c9c692e commit 990a97e85d2a8799a6af79b93b6eac24d9b541e3 @fabianbergmark committed May 6, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/main/java/org/marble/level/LevelLoader.java
@@ -242,6 +242,7 @@ public MetaLevelPack loadMetaLevelPack(final URL url) throws IOException,
// entity's offset is relative to that rotation)
baseEntity.getTransform().getTranslation(translationVector);
translationVector.addLocal(position.getPosition());
+ final Transform baseTransform = baseEntity.getTransform();
if (position.getConnector().isPresent()) {
final Connected connected = (Connected) baseEntity;
@@ -252,6 +253,7 @@ public MetaLevelPack loadMetaLevelPack(final URL url) throws IOException,
}
movedTransform.setTranslation(translationVector);
+ movedTransform.setRotation(baseTransform.getRotation());
} else {
movedTransform.setTranslation(position.getPosition());
}

0 comments on commit 990a97e

Please sign in to comment.