2 * Sixth 3D engine. Author: Svjatoslav Agejenko.
3 * This project is released under Creative Commons Zero (CC0) license.
5 package eu.svjatoslav.sixth.e3d.math;
7 import eu.svjatoslav.sixth.e3d.geometry.Point3D;
9 public class Transform implements Cloneable {
11 private final Point3D translation;
12 private final Orientation orientation;
15 translation = new Point3D();
16 orientation = new Orientation();
19 public Transform(final Point3D translation) {
20 this.translation = translation;
21 orientation = new Orientation();
24 public Transform(final Point3D translation, final double angleXZ,
25 final double angleYZ) {
27 this.translation = translation;
28 orientation = new Orientation(angleXZ, angleYZ);
31 public Transform(final Point3D translation, final Orientation orientation) {
32 this.translation = translation;
33 this.orientation = orientation;
37 public Transform clone() {
38 return new Transform(translation, orientation);
41 public Orientation getOrientation() {
45 public Point3D getTranslation() {
49 public void transform(final Point3D point) {
50 orientation.rotate(point);
51 point.add(translation);