blob: 2da820fd613c4f85bd08445b769718927ab334c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
package net.tylermurphy.Minecraft.Scene.Objects;
import net.tylermurphy.Minecraft.Scene.World;
import org.joml.Vector3f;
public class Transform {
private Vector3f position = new Vector3f(0f, 0f, 0f);
private Vector3f rotation = new Vector3f(0f, 0f, 0f);
private float scale = 1.0f;
public Transform setPosition(Vector3f position){
this.position = position;
return this;
}
public Transform setGlobalPosition(Vector3f position) {
this.position = new Vector3f(
position.x - World.world_origin.x(),
position.y,
position.z - World.world_origin.z()
);
return this;
}
public Transform increasePosition(float dx, float dy, float dz) {
this.position.x += dx;
this.position.y += dy;
this.position.z += dz;
return this;
}
public Transform setRotation(Vector3f rotation){
this.rotation = rotation;
return this;
}
public Transform setScale(float scale){
this.scale = scale;
return this;
}
public Vector3f getPosition(){
return position;
}
public Vector3f getGlobalPosition() {
return new Vector3f(position.x+ World.world_origin.x(),position.y,position.z+ World.world_origin.z());
}
public Vector3f getRotation(){
return rotation;
}
public float getScale(){
return scale;
}
}
|