mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-16 18:54:51 +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
@@ -58,6 +58,19 @@ public class Scale extends Transformation
|
||||
return new Scale(1/factor.x, 1/factor.y, 1/factor.z);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user