mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-17 11:05:24 +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
@@ -227,6 +227,22 @@ public class Rotation extends Transformation
|
||||
{
|
||||
return new Rotation(-angle, axis);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Transformation merge(Transformation next) {
|
||||
if(next instanceof Rotation) {
|
||||
Rotation r = (Rotation)next;
|
||||
if(r.axis.equalsT(axis)) {
|
||||
double d = angle+r.angle;
|
||||
if(d == 0)
|
||||
return new RedundantTransformation();
|
||||
|
||||
return new Rotation(angle, axis);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
|
||||
Reference in new issue
Block a user