@@ -29,7 +29,8 @@ public FloorPatternNoiseCreator() {
2929 this (0.2f , 2 , 4 );
3030 }
3131
32- public FloorPatternNoiseCreator (float height , float radius , int subdivisions ) {
32+ public FloorPatternNoiseCreator (float height , float radius ,
33+ int subdivisions ) {
3334 this .height = height ;
3435 this .radius = radius ;
3536 this .subdivisions = subdivisions ;
@@ -49,17 +50,22 @@ public Mesh3D create() {
4950
5051 private void rotateFaces () {
5152 for (Face3D face : faceSelection .getFaces ()) {
52- Mesh3DUtil .rotateFaceZ (mesh , face , Mathf . toRadians ( Mathf . random ( 0 , 2 ) ));
53- Mesh3DUtil .rotateFaceX (mesh , face , Mathf . toRadians ( Mathf . random ( 0 , 2 ) ));
53+ Mesh3DUtil .rotateFaceZ (mesh , face , randomAngle ( ));
54+ Mesh3DUtil .rotateFaceX (mesh , face , randomAngle ( ));
5455 }
5556 }
5657
58+ private float randomAngle () {
59+ return Mathf .toRadians (Mathf .random (0 , 2 );
60+ }
61+
5762 private void snapToGround () {
5863 mesh .translateY (-height * 0.5f );
5964 }
6065
6166 private void extrude () {
62- new ExtrudeModifier (0.9f , height * 0.5f ).modify (mesh , faceSelection .getFaces ());
67+ new ExtrudeModifier (0.9f , height * 0.5f ).modify (mesh ,
68+ faceSelection .getFaces ());
6369 }
6470
6571 private void solidify () {
0 commit comments