mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-15 09:34:53 +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
@@ -60,17 +60,17 @@ public class Scale extends Transformation
|
||||
|
||||
@Override
|
||||
public Transformation merge(Transformation next) {
|
||||
if(next instanceof Scale) {
|
||||
Vector3 vec = factor.copy().multiply(((Scale) next).factor);
|
||||
if(vec.equalsT(Vector3.one))
|
||||
return new RedundantTransformation();
|
||||
|
||||
return new Scale(vec);
|
||||
}
|
||||
if(next instanceof Scale)
|
||||
return new Scale(factor.copy().multiply(((Scale) next).factor));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRedundant() {
|
||||
return factor.equalsT(Vector3.one);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user