Project

General

Profile

« Previous | Next » 

Revision cad4b4d6

Added by Leszek Koltunski about 4 years ago

Progress with object Movement. Looks like detecting which face got touched and where (in 2D in-face surface coordinates) does work now.

View differences:

src/main/java/org/distorted/object/RubikPyraminxMovement.java
55 55
  boolean isInsideFace(float[] p)
56 56
    {
57 57
    boolean a1 = p[1] >= -SQ3/6;
58
    boolean a2 = p[1]*SQ3 <= 1 + 2*p[0];
59
    boolean a3 = p[1]*SQ3 <= 1 - 2*p[0];
58
    boolean a2 = p[1] <=  SQ3*(1.0f/3 + p[0]);
59
    boolean a3 = p[1] <=  SQ3*(1.0f/3 - p[0]);
60 60

  
61 61
    return a1 && a2 && a3;
62 62
    }

Also available in: Unified diff