Commit 984032b8 by Jonathan Thomas

Lowering the button and chat bubble, and centering start button. Also extending…

Lowering the button and chat bubble, and centering start button. Also extending render distance to 9 block radius.
parent 2ef0dfb7
Pipeline #11645 passed with stage
in 23 seconds
...@@ -45,7 +45,7 @@ public class ClickHandler { ...@@ -45,7 +45,7 @@ public class ClickHandler {
if (cameraEntity == null) return; if (cameraEntity == null) return;
World world = cameraEntity.getEntityWorld(); World world = cameraEntity.getEntityWorld();
double renderDistance = 7.0; double renderDistance = 9.0;
// Calculate radius of entities // Calculate radius of entities
Vec3d pos = cameraEntity.getPos(); Vec3d pos = cameraEntity.getPos();
...@@ -69,7 +69,7 @@ public class ClickHandler { ...@@ -69,7 +69,7 @@ public class ClickHandler {
// Use the player's looking direction to define the ray's direction // Use the player's looking direction to define the ray's direction
Vec3d lookVec = player.getRotationVec(1.0F); Vec3d lookVec = player.getRotationVec(1.0F);
Vec3d endRay = startRay.add(lookVec.normalize().multiply(7)); // 7 blocks in the direction the camera is looking Vec3d endRay = startRay.add(lookVec.normalize().multiply(renderDistance));
Entity closestEntity = null; Entity closestEntity = null;
double closestDistance = Double.MAX_VALUE; // Start with the largest possible distance double closestDistance = Double.MAX_VALUE; // Start with the largest possible distance
...@@ -82,7 +82,7 @@ public class ClickHandler { ...@@ -82,7 +82,7 @@ public class ClickHandler {
} }
Vec3d entityPos = entity.getPos(); Vec3d entityPos = entity.getPos();
double extraHeight = 1D; // Calculate how much higher the text bubble is above the entity double extraHeight = 0.5D; // Calculate how much higher the text bubble is above the entity
Vec3d iconCenter = entityPos.add(0, entity.getHeight() + extraHeight, 0); Vec3d iconCenter = entityPos.add(0, entity.getHeight() + extraHeight, 0);
// Define a bounding box that accurately represents the text bubble // Define a bounding box that accurately represents the text bubble
......
...@@ -135,7 +135,7 @@ public class ClientInit implements ClientModInitializer { ...@@ -135,7 +135,7 @@ public class ClientInit implements ClientModInitializer {
if (cameraEntity == null) return; if (cameraEntity == null) return;
World world = cameraEntity.getEntityWorld(); World world = cameraEntity.getEntityWorld();
double renderDistance = 7.0; double renderDistance = 9.0;
// Calculate radius of entities // Calculate radius of entities
Vec3d pos = cameraEntity.getPos(); Vec3d pos = cameraEntity.getPos();
...@@ -190,7 +190,7 @@ public class ClientInit implements ClientModInitializer { ...@@ -190,7 +190,7 @@ public class ClientInit implements ClientModInitializer {
matrices.push(); matrices.push();
// Translate to the entity's position // Translate to the entity's position
double paddingAboveEntity = 1D; double paddingAboveEntity = 0.5D;
matrices.translate(entity.getPos().x - interpolatedCameraPos.x, matrices.translate(entity.getPos().x - interpolatedCameraPos.x,
entity.getPos().y - interpolatedCameraPos.y + entity.getHeight() + paddingAboveEntity, entity.getPos().y - interpolatedCameraPos.y + entity.getHeight() + paddingAboveEntity,
entity.getPos().z - interpolatedCameraPos.z); entity.getPos().z - interpolatedCameraPos.z);
...@@ -247,7 +247,7 @@ public class ClientInit implements ClientModInitializer { ...@@ -247,7 +247,7 @@ public class ClientInit implements ClientModInitializer {
// Check if conversation has started // Check if conversation has started
if (chatData.currentMessage.isEmpty()) { if (chatData.currentMessage.isEmpty()) {
// Draw 'start' button // Draw 'start' button
drawStartIcon(matrices, entity, 0, textHeaderHeight, 32, 17); drawStartIcon(matrices, entity, -16, textHeaderHeight, 32, 17);
} else { } else {
// Draw text background (no smaller than 50F tall) // Draw text background (no smaller than 50F tall)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment