Project

General

Profile

« Previous | Next » 

Revision ef018c1b

Added by Leszek Koltunski over 2 years ago

Abstract the next function, computeRowFromOffset(), out of the individual Movement classes.
Still two issues:

1) mysterious 1.5 multiplier in Movement12
2) in Movement8, moving the offset works only if the rotAxis are face-turning, i.e. they connect the centers of the opposing faces of the octahedron.

View differences:

src/main/java/org/distorted/objects/MovementJing.java
19 19

  
20 20
package org.distorted.objects;
21 21

  
22
import static org.distorted.objects.TwistyJing.F;
23

  
24 22
///////////////////////////////////////////////////////////////////////////////////////////////////
25 23

  
26 24
class MovementJing extends Movement4
27 25
{
28
  MovementJing()
29
    {
30
    super(TwistyJing.ROT_AXIS);
31
    }
32

  
33
///////////////////////////////////////////////////////////////////////////////////////////////////
34

  
35
  int computeRowFromOffset(int face, int axisIndex, int numLayers, float offset)
26
  MovementJing(float[][] cuts, boolean[][] rotatable, int numLayers)
36 27
    {
37
    return offset+DIST2D < (SQ3/4)*F ? 0:1;
28
    super(TwistyJing.ROT_AXIS,cuts,rotatable,numLayers);
38 29
    }
39 30

  
40 31
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff