mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-15 17:44:42 +00:00
Initial 1.7 commit
This commit is contained in:
1 parent
34154fc011
commit
ca675b5f31
72 files changed
+2967
-3335
No files matched your search
@@ -0,0 +1,49 @@
|
||||
package codechicken.lib.vec;
|
||||
|
||||
/**
|
||||
* Abstract supertype for any VectorN transformation
|
||||
* @param <Vector> The vector type
|
||||
* @param <Transformation> The transformation type
|
||||
*/
|
||||
public abstract class ITransformation<Vector, Transformation extends ITransformation>
|
||||
{
|
||||
/**
|
||||
* Applies this transformation to vec
|
||||
*/
|
||||
public abstract void apply(Vector vec);
|
||||
|
||||
/**
|
||||
* @param point The point to apply this transformation around
|
||||
* @return Wraps this transformation in a translation to point and then back from point
|
||||
*/
|
||||
public abstract Transformation at(Vector point);
|
||||
|
||||
/**
|
||||
* Creates a TransformationList composed of this transformation followed by t
|
||||
* If this is a TransformationList, the transformation will be appended and this returned
|
||||
*/
|
||||
public abstract Transformation with(Transformation t);
|
||||
|
||||
/**
|
||||
* Returns a simplified transformation that performs this, followed by next. If such a transformation does not exist, returns null
|
||||
*/
|
||||
public Transformation merge(Transformation next) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this transformation is redundant, eg. Scale(1, 1, 1), Translation(0, 0, 0) or Rotation(0, a, b, c)
|
||||
*/
|
||||
public boolean isRedundant() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract Transformation inverse();
|
||||
|
||||
/**
|
||||
* Scala ++ operator
|
||||
*/
|
||||
public Transformation $plus$plus(Transformation t) {
|
||||
return with(t);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user