implement third person camera collision detection

This commit is contained in:
LabyStudio
2022-05-04 02:30:47 +02:00
parent ed0849ca28
commit 48ad9dc9b3
5 changed files with 84 additions and 21 deletions
@@ -366,6 +366,8 @@ export default class BlockRenderer {
let maxY = 1;
let maxZ = 1;
let offset = (1 / 256);
// UV Mapping
let textureIndex = block.getTextureForFace(EnumBlockFace.NORTH);
let minU = (textureIndex % 16) / 16.0;
@@ -377,6 +379,11 @@ export default class BlockRenderer {
minV = 1 - minV;
maxV = 1 - maxV;
minU += offset;
maxU -= offset;
minV -= offset;
maxV += offset;
// Render item
this.addFace(null, EnumBlockFace.NORTH, false, minX, minY, minZ, maxX, maxY, maxZ, minU, minV, maxU, maxV);
}