2 * Sixth 3D engine. Copyright ©2012-2018, 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.geometry;
12 public class Transform implements Cloneable {
14 private final Point3D translation;
15 private final Orientation orientation;
18 translation = new Point3D();
19 orientation = new Orientation();
22 public Transform(final Point3D translation) {
23 this.translation = translation;
24 orientation = new Orientation();
27 public Transform(final Point3D translation, final double angleXZ,
28 final double angleYZ) {
30 this.translation = translation;
31 orientation = new Orientation(angleXZ, angleYZ);
34 public Transform(final Point3D translation, final Orientation orientation) {
35 this.translation = translation;
36 this.orientation = orientation;
40 public Transform clone() {
41 return new Transform(translation, orientation);
44 public Orientation getOrientation() {
48 public Point3D getTranslation() {
52 public void transform(final Point3D point) {
53 orientation.rotate(point);
54 point.add(translation);