All Downloads are FREE. Search and download functionalities are using the official Maven repository.

top.hendrixshen.magiclib.impl.compat.mojang.math.Vector3fCompatImpl Maven / Gradle / Ivy

There is a newer version: 0.6.59
Show newest version
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