Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ object DrawHelper {
* This is useful for rendering things in world space, as it will negate the camera rotation.
*/
fun cameraRotation(matrices: UMatrixStack) {
matrices.multiply(mc.gameRenderer.camera.rotation.conjugate(Quaternionf()))
//#if MC>12000
matrices.multiply(mc.gameRenderer.camera.rotation.conjugate(Quaternionf()).mul(70f/mc.options.fov.value))
//#else
//$$matrices.multiply(mc.gameRenderer.camera.rotation.conjugate(Quaternionf()))
//#endif
}

/**
Expand Down Expand Up @@ -223,9 +227,9 @@ object DrawHelper {
fun drawNametag(matrices: UMatrixStack, text: String, x: Double, y: Double, z: Double, shadow: Boolean = true, scale: Float = 1f, background: Boolean = true, throughWalls: Boolean = false) {
matrices.push()
matrices.translate(x, y + 0.5, z)
matrices.multiply(mc.entityRenderDispatcher.rotation)
matrices.multiply(mc.gameRenderer.camera.rotation)
// TODO: fix fov drifting issues for nametags
matrices.scale(0.025f, -0.025f, 0.025f)

matrices.scale(scale, scale, scale)
val centerPos = UGraphics.getStringWidth(text) / -2f
val backgroundColor = if (!background) 0 else (mc.options.getTextBackgroundOpacity(0.25f) * 255).toInt() shl 24
Expand Down