Dice: Improve initial position of dices

This change ensures proper initial distance of dices based
on their size. It also distributes them horizontally so that
they hit each other later at different angles.

Pick-to: 6.8 6.9 6.9.0
Change-Id: I7f8d2ab0c9b7b6b00996cae8fb121de950b68ca4
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
This commit is contained in:
Soheil Armin 2025-02-28 15:41:06 +02:00
parent f8da375cf9
commit 48edb006a9
1 changed files with 3 additions and 3 deletions

View File

@ -23,9 +23,9 @@ Node {
})
delegate: PhysicalDie {
position.x: 0.11 * Math.cos(index / (Math.PI / 4))
position.y: index * 2.1
position.z: 0
position.x: { position.x = diceWidth * Math.cos(index / (Math.PI / 4)) }
position.y: { position.y = index * shapeSpawner.diceWidth * 1.41 }
position.z: { position.z = diceWidth * Math.sin(index / (Math.PI / 4)) }
eulerRotation.x: randomInRange(0, 360)
eulerRotation.y: randomInRange(0, 360)
eulerRotation.z: randomInRange(0, 360)