mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-17 02:55:10 +00:00
Add transformation compacting.
This commit is contained in:
1 parent
0941845227
commit
5ef9f6174d
7 files changed
+133
-66
No files matched your search
@@ -59,6 +59,16 @@ public class Translation extends Transformation
|
||||
return new Translation(-vec.x, -vec.y, -vec.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Transformation merge(Transformation next) {
|
||||
if(next instanceof Translation) {
|
||||
Vector3 vec2 = vec.copy().add(((Translation) next).vec);
|
||||
return vec2.isZero() ? new RedundantTransformation() : new Translation(vec2);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user