Project

General

Profile

« Previous | Next » 

Revision b63235a0

Added by Leszek Koltunski over 1 year ago

Make it possible to create Diamond and Icosahedron-shaped objects to be read from json.

View differences:

src/main/java/org/distorted/objectlib/touchcontrol/TouchControlBall.java
14 14
import org.distorted.library.type.Static4D;
15 15
import org.distorted.objectlib.main.TwistyObject;
16 16

  
17
import static org.distorted.objectlib.main.TwistyObject.SQ2;
18

  
17 19
///////////////////////////////////////////////////////////////////////////////////////////////////
18 20
// Ball-shaped objects: map the 2D swipes of user's fingers to 3D rotations
19 21

  
......
33 35
  private float mLongitude, mLatitude;
34 36
  private float mX, mY, mZ;
35 37

  
38
  private static final float X = (float)Math.sqrt( (2-SQ2)/(6+SQ2) );
39
  private static final float Y = (float)Math.sqrt( (2+SQ2)/(6+SQ2) );
40

  
41
  public static final Static3D[] FACE_AXIS = new Static3D[]
42
        {
43
          new Static3D( X, Y, Y),
44
          new Static3D( X,-Y, Y),
45
          new Static3D( Y, Y, X),
46
          new Static3D( Y,-Y, X),
47
          new Static3D( Y, Y,-X),
48
          new Static3D( Y,-Y,-X),
49
          new Static3D( X, Y,-Y),
50
          new Static3D( X,-Y,-Y),
51
          new Static3D(-X, Y,-Y),
52
          new Static3D(-X,-Y,-Y),
53
          new Static3D(-Y, Y,-X),
54
          new Static3D(-Y,-Y,-X),
55
          new Static3D(-Y, Y, X),
56
          new Static3D(-Y,-Y, X),
57
          new Static3D(-X, Y, Y),
58
          new Static3D(-X,-Y, Y),
59
        };
60

  
36 61
///////////////////////////////////////////////////////////////////////////////////////////////////
37 62

  
38 63
  public TouchControlBall(TwistyObject object)

Also available in: Unified diff