Improved transformation compacting.

This commit is contained in:
Chicken Bones committed 2013-09-05 17:41:31 +10:00
1 parent 5c5384f79c
commit ea515682c1
6 files changed
+56 -34

No files matched your search

+7 -7
View File
@@ -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()
{