top.hendrixshen.magiclib.impl.compat.mojang.math.Vector3fCompatImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of magiclib-minecraft-api-1.19.3-fabric Show documentation
Show all versions of magiclib-minecraft-api-1.19.3-fabric Show documentation
Unleash magic into Minecraft, infuse souls, ascend to heaven!
package top.hendrixshen.magiclib.impl.compat.mojang.math;
import org.joml.Vector3f;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import org.jetbrains.annotations.NotNull;
import top.hendrixshen.magiclib.api.compat.AbstractCompat;
import top.hendrixshen.magiclib.api.compat.mojang.math.QuaternionCompat;
import top.hendrixshen.magiclib.api.compat.mojang.math.Vector3fCompat;
//#if MC > 11902
import org.joml.Quaternionf;
//#endif
//#if MC < 11500
//$$ import com.mojang.math.Quaternion;
//#endif
@Environment(EnvType.CLIENT)
public class Vector3fCompatImpl extends AbstractCompat implements Vector3fCompat {
public Vector3fCompatImpl(@NotNull Vector3f type) {
super(type);
}
@Override
public QuaternionCompat rotationDegrees(float degrees) {
return QuaternionCompat.of(
//#if MC > 11902
new Quaternionf().rotationAxis(degrees, this.get())
//#elseif MC > 11404
//$$ this.get().rotationDegrees(degrees)
//#else
//$$ new Quaternion(this.get(), degrees, true)
//#endif
);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy