public class Rotation extends Transformation
| Modifier and Type | Field and Description |
|---|---|
double |
angle |
static Vector3[] |
axes |
Vector3 |
axis |
static Transformation[] |
quarterRotations
Clockwise pi/2 about y looking down
|
static int[] |
rotSideMap |
static Transformation[] |
sideRotations |
static int[] |
sideRotMap |
static int[] |
sideRotOffsets
Rotate pi/2 * this offset for [side] about y axis before rotating to the side for the rotation indicies to line up
|
operationIndex| Constructor and Description |
|---|
Rotation(double angle,
double x,
double y,
double z) |
Rotation(double angle,
Vector3 axis) |
Rotation(Quat quat) |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(Matrix4 mat)
Applies this transformation to a matrix as a multiplication on the right hand side.
|
void |
apply(Vector3 vec)
Applies this transformation to vec
|
void |
applyN(Vector3 normal)
Applies this transformation to a normal (doesn't translate)
|
static int |
getSidedRotation(EntityPlayer player,
int side) |
static int |
getSideFromLookAngle(EntityLivingBase entity) |
void |
glApply() |
Transformation |
inverse() |
boolean |
isRedundant()
Returns true if this transformation is redundant, eg.
|
Transformation |
merge(Transformation next)
Returns a simplified transformation that performs this, followed by next.
|
static int |
rotateSide(int s,
int r) |
static int |
rotationTo(int s1,
int s2)
Reverse of rotateSide
|
static Transformation |
sideOrientation(int s,
int r) |
Quat |
toQuat() |
java.lang.String |
toString() |
at, load, operate, operationID, with$plus$pluspublic static Transformation[] quarterRotations
public static Transformation[] sideRotations
public static Vector3[] axes
public static int[] sideRotMap
public static int[] rotSideMap
public static int[] sideRotOffsets
public double angle
public Vector3 axis
public Rotation(double angle,
Vector3 axis)
public Rotation(double angle,
double x,
double y,
double z)
public Rotation(Quat quat)
public static int rotateSide(int s,
int r)
public static int rotationTo(int s1,
int s2)
public static int getSidedRotation(EntityPlayer player,
int side)
player - The placing player, used for obtaining the look vectorside - The side of the block being placed onpublic static Transformation sideOrientation(int s, int r)
public static int getSideFromLookAngle(EntityLivingBase entity)
entity - The placing entity, used for obtaining the look vectorpublic void apply(Vector3 vec)
ITransformationapply in class ITransformation<Vector3,Transformation>public void applyN(Vector3 normal)
TransformationapplyN in class Transformationnormal - The normal to transformpublic void apply(Matrix4 mat)
Transformationapply in class Transformationmat - The matrix to combine this transformation withpublic Quat toQuat()
public void glApply()
glApply in class Transformationpublic Transformation inverse()
inverse in class ITransformation<Vector3,Transformation>public Transformation merge(Transformation next)
ITransformationmerge in class ITransformation<Vector3,Transformation>public boolean isRedundant()
ITransformationisRedundant in class ITransformation<Vector3,Transformation>public java.lang.String toString()
toString in class java.lang.Object