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/MovementPyraminx.java
23 23

  
24 24
class MovementPyraminx extends Movement4
25 25
{
26
  MovementPyraminx()
26
  MovementPyraminx(float[][] cuts, boolean[][] rotatable,int numLayers)
27 27
    {
28
    super(TwistyPyraminx.ROT_AXIS);
29
    }
30

  
31
///////////////////////////////////////////////////////////////////////////////////////////////////
32

  
33
  int computeRowFromOffset(int face, int axisIndex, int numLayers, float offset)
34
    {
35
    return (int)(numLayers*(offset+DIST2D)/(3*DIST2D));
28
    super(TwistyPyraminx.ROT_AXIS,cuts,rotatable,numLayers);
36 29
    }
37 30

  
38 31
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff