Skip to content

Commit

Permalink
fix standing sign rotation step
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Oct 8, 2023
1 parent 19ad1e5 commit d40f388
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions prismarine-viewer/viewer/lib/worldrenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ class WorldRenderer {
}

const group = new THREE.Group()
const rotateStep = isWall ? 2 : 4
group.rotation.set(0, -(Math.PI / rotateStep) * rotation, 0)
group.rotation.set(0, -THREE.MathUtils.degToRad(
rotation * (isWall ? 90 : 45 / 2)
), 0)
group.add(mesh)
const y = isWall ? 4.5 / 16 + mesh.scale.y / 2 : (1 - (mesh.scale.y / 2))
group.position.set(position.x + 0.5, position.y + y, position.z + 0.5)
Expand Down
2 changes: 1 addition & 1 deletion prismarine-viewer/viewer/prepare/moreGeneratedBlocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const handleSign = async (dataBase: string, match: RegExpExecArray) => {
Array.from({ length: 16 }).map((_val, i) => {
return [`rotation=${i}`, {
"model": currentBlockName,
y: i * 45,
y: i * (45 / 2),
}]
})
)
Expand Down

0 comments on commit d40f388

Please sign in to comment.