--- /dev/null
+/*
+ * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 3 of the GNU Lesser General Public License
+ * or later as published by the Free Software Foundation.
+ *
+ */
+
+package eu.svjatoslav.sixth.e3d.math;
+
+import eu.svjatoslav.sixth.e3d.geometry.Point3D;
+
+public class Transform implements Cloneable {
+
+ private final Point3D translation;
+ private final Orientation orientation;
+
+ public Transform() {
+ translation = new Point3D();
+ orientation = new Orientation();
+ }
+
+ public Transform(final Point3D translation) {
+ this.translation = translation;
+ orientation = new Orientation();
+ }
+
+ public Transform(final Point3D translation, final double angleXZ,
+ final double angleYZ) {
+
+ this.translation = translation;
+ orientation = new Orientation(angleXZ, angleYZ);
+ }
+
+ public Transform(final Point3D translation, final Orientation orientation) {
+ this.translation = translation;
+ this.orientation = orientation;
+ }
+
+ @Override
+ public Transform clone() {
+ return new Transform(translation, orientation);
+ }
+
+ public Orientation getOrientation() {
+ return orientation;
+ }
+
+ public Point3D getTranslation() {
+ return translation;
+ }
+
+ public void transform(final Point3D point) {
+ orientation.rotate(point);
+ point.add(translation);
+ }
+
+}