]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blob - src/main/java/com/irtimaled/bbor/client/renderers/OffsetPoint.java
9d794fdf49a64c5dc058a3e8177f0eead0c85de7
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / client / renderers / OffsetPoint.java
1 package com.irtimaled.bbor.client.renderers;
2
3 import com.irtimaled.bbor.client.Camera;
4 import com.irtimaled.bbor.common.models.Coords;
5 import com.irtimaled.bbor.common.models.Point;
6
7 class OffsetPoint {
8     private final Point point;
9
10     OffsetPoint(double x, double y, double z) {
11         this(new Point(x, y, z));
12     }
13
14     OffsetPoint(Coords coords) {
15         this(new Point(coords));
16     }
17
18     OffsetPoint(Point point) {
19         this.point = point;
20     }
21
22     double getX() {
23         return point.getX() - Camera.getX();
24     }
25
26     double getY() {
27         return point.getY() - Camera.getY();
28     }
29
30     double getZ() {
31         return point.getZ() - Camera.getZ();
32     }
33
34     OffsetPoint offset(double x, double y, double z) {
35         return new OffsetPoint(point.offset(x, y, z));
36     }
37
38     double getDistance(OffsetPoint offsetPoint) {
39         return this.point.getDistance(offsetPoint.point);
40     }
41 }