Revision da178c88
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objects/MovementMinx.java | ||
---|---|---|
34 | 34 |
{ |
35 | 35 |
if( numLayers==3 ) |
36 | 36 |
{ |
37 |
return offset<DIST2D ? 0:2;
|
|
37 |
return offset<0 ? 0:2;
|
|
38 | 38 |
} |
39 | 39 |
if( numLayers==5 ) |
40 | 40 |
{ |
41 | 41 |
float quot = offset / DIST2D; |
42 | 42 |
|
43 |
if( quot>0.00f && quot<=0.34f ) return 0;
|
|
44 |
if( quot>0.34f && quot<=1.00f ) return 1;
|
|
45 |
if( quot>1.00f && quot<=1.66f ) return 3;
|
|
46 |
if( quot>1.66f && quot<=2.00f ) return 4;
|
|
43 |
if( quot>-1.00f && quot<=-0.66f ) return 0;
|
|
44 |
if( quot>-0.66f && quot<= 0.00f ) return 1;
|
|
45 |
if( quot> 0.00f && quot<= 0.66f ) return 3;
|
|
46 |
if( quot> 0.66f && quot<= 1.00f ) return 4;
|
|
47 | 47 |
} |
48 | 48 |
|
49 | 49 |
return 0; |
Also available in: Unified diff
Make computing the offset in the Movement class more correct. From now on, in the center of the face the offset if always 0 regardless of the axis.
Before it would always assume that we can add DIST2D to the offset which is originated at the center of the face and this way get an offset which spans from 0 to height of the face. This is not always true - conterexample: half of the triangluar faces of an octahedron which are 'upside down'