2 * Sixth 3D engine. Copyright ©2012-2019, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public License
6 * or later as published by the Free Software Foundation.
10 package eu.svjatoslav.sixth.e3d.math;
12 import eu.svjatoslav.sixth.e3d.geometry.Point3D;
14 public class Transform implements Cloneable {
16 private final Point3D translation;
17 private final Orientation orientation;
20 translation = new Point3D();
21 orientation = new Orientation();
24 public Transform(final Point3D translation) {
25 this.translation = translation;
26 orientation = new Orientation();
29 public Transform(final Point3D translation, final double angleXZ,
30 final double angleYZ) {
32 this.translation = translation;
33 orientation = new Orientation(angleXZ, angleYZ);
36 public Transform(final Point3D translation, final Orientation orientation) {
37 this.translation = translation;
38 this.orientation = orientation;
42 public Transform clone() {
43 return new Transform(translation, orientation);
46 public Orientation getOrientation() {
50 public Point3D getTranslation() {
54 public void transform(final Point3D point) {
55 orientation.rotate(point);
56 point.add(translation);