Revision 14a4712f
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/object/RubikCubeMovement.java | ||
---|---|---|
25 | 25 |
{ |
26 | 26 |
RubikCubeMovement() |
27 | 27 |
{ |
28 |
super(RubikCube.AXIS,2,0.5f); |
|
29 |
} |
|
30 |
|
|
31 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
32 |
|
|
33 |
private boolean isVertical(float x, float y) |
|
34 |
{ |
|
35 |
return (y>x) ? (y>=-x) : (y< -x); |
|
28 |
super(RubikCube.AXIS, 2, 0.5f, 0.5f); |
|
36 | 29 |
} |
37 | 30 |
|
38 | 31 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
54 | 47 |
return ( p[0]<=0.5f && p[0]>=-0.5f && p[1]<=0.5f && p[1]>=-0.5f ); |
55 | 48 |
} |
56 | 49 |
|
57 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
58 |
|
|
59 |
float fillUpRotationVectAndOffset(float[] v, float[] touch, int[] possible) |
|
60 |
{ |
|
61 |
mRotationVect = isVertical(v[possible[0]],v[possible[1]]) ? possible[0] : possible[1]; |
|
62 |
return touch[mRotationVect]+0.5f; |
|
63 |
} |
|
64 |
|
|
65 | 50 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
66 | 51 |
|
67 | 52 |
float returnAngle(float[] v, int[] possible) |
Also available in: Unified diff
Progress with object Movement. Assigning new Rotations works now, independently of object type.