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

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

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

  
33
  int computeRowFromOffset(int face, int axisIndex, int numLayers, float offset)
34
    {
35
    return offset<0 ? 0:2;
28
    super(TwistyHelicopter.ROT_AXIS,cuts,rotatable, numLayers);
36 29
    }
37 30

  
38 31
///////////////////////////////////////////////////////////////////////////////////////////////////
......
48 41
    {
49 42
    boolean p0 = touchPoint[0] > 0;
50 43
    boolean p1 = touchPoint[1] > 0;
51

  
52 44
    return p0 ? (p1 ? 0:1) : (p1 ? 3:2);
53 45
    }
54 46

  

Also available in: Unified diff