mirror of
https://github.com/MistWeatherMedia/WeatherSTAR-3000-Java.git
synced 2026-11-28 14:38:08 -08:00
Add files via upload
This commit is contained in:
1 parent
5801b8ab41
commit
5923ef2043
44 files changed
+8557
No files matched your search
@@ -0,0 +1,44 @@
|
||||
package WS3000.weatherstar3000;
|
||||
|
||||
import org.joml.Vector2f;
|
||||
|
||||
public class Transform {
|
||||
|
||||
public Vector2f position;
|
||||
public Vector2f scale;
|
||||
|
||||
public Transform() {
|
||||
init(new Vector2f(), new Vector2f());
|
||||
}
|
||||
|
||||
public Transform(Vector2f position) {
|
||||
init(position, new Vector2f());
|
||||
}
|
||||
|
||||
public Transform(Vector2f position, Vector2f scale) {
|
||||
init(position, scale);
|
||||
}
|
||||
|
||||
public void init(Vector2f position, Vector2f scale) {
|
||||
this.position = position;
|
||||
this.scale = scale;
|
||||
}
|
||||
|
||||
public Transform copy() {
|
||||
return new Transform(new Vector2f(this.position), new Vector2f(this.scale));
|
||||
}
|
||||
|
||||
public void copy(Transform to) {
|
||||
to.position.set(this.position);
|
||||
to.scale.set(this.scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof Transform)) return false;
|
||||
|
||||
Transform t = (Transform)o;
|
||||
return t.position.equals(this.position) && t.scale.equals(this.scale);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user