mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 15:02:17 +00:00
changed rotation of orbs and discs based on their heading
This commit is contained in:
1 parent
0a85bb5a7b
commit
fcbd2545cb
3 files changed
+48
No files matched your search
@@ -4,6 +4,8 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.entity.EntityAbilityDisc;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.Vec3;
|
||||
import noppes.npcs.util.MathUtil;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
@@ -51,6 +53,16 @@ public class RenderAbilityDisc extends RenderEnergyAbility {
|
||||
GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
double motionX = entity.motionX;
|
||||
double motionY = entity.motionY;
|
||||
double motionZ = entity.motionZ;
|
||||
Vec3 motionVec = Vec3.createVectorHelper(motionX, motionY, motionZ);
|
||||
|
||||
float motionYaw = MathUtil.getYaw(motionVec);
|
||||
float motionPitch = MathUtil.getPitch(motionVec);
|
||||
GL11.glRotatef(motionYaw, 0, 1, 0);
|
||||
GL11.glRotatef(motionPitch, 1, 0, 0);
|
||||
|
||||
// Apply Y-axis rotation for spin
|
||||
GL11.glRotatef(disc.getInterpolatedRotationY(partialTicks), 0.0f, 1.0f, 0.0f);
|
||||
|
||||
|
||||
Reference in new issue
Block a user