mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-15 17:44:42 +00:00
Improved transformation compacting.
This commit is contained in:
1 parent
5c5384f79c
commit
ea515682c1
6 files changed
+56
-34
No files matched your search
@@ -61,14 +61,17 @@ public class Translation extends Transformation
|
||||
|
||||
@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);
|
||||
}
|
||||
if(next instanceof Translation)
|
||||
return new Translation(vec.copy().add(((Translation) next).vec));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRedundant() {
|
||||
return vec.equalsT(Vector3.zero);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user