use of javax.vecmath.AxisAngle4d in project EnderIO by SleepyTrousers.
the class RotatingSmartItemModel method handlePerspective.
@Override
@Nonnull
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(@Nonnull ItemCameraTransforms.TransformType cameraTransformType) {
Pair<? extends IBakedModel, Matrix4f> perspective = parent.handlePerspective(cameraTransformType);
double r = (EnderIO.proxy.getTickCount() % 360) + Minecraft.getMinecraft().getRenderPartialTicks();
TRSRTransformation transformOrig = new TRSRTransformation(perspective.getRight());
Quat4f leftRot = transformOrig.getLeftRot();
Quat4f yRotation = new Quat4f();
yRotation.set(new AxisAngle4d(0, 1, 0, Math.toRadians(r * speed)));
leftRot.mul(yRotation);
TRSRTransformation transformNew = new TRSRTransformation(transformOrig.getTranslation(), leftRot, transformOrig.getScale(), transformOrig.getRightRot());
return Pair.of(perspective.getLeft(), transformNew.getMatrix());
}
Aggregations