Revision da178c88
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objects/Movement.java | ||
---|---|---|
152 | 152 |
} |
153 | 153 |
|
154 | 154 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
155 |
// in the center of the face offset is always 0 regardless of the axis |
|
155 | 156 |
|
156 | 157 |
private float computeOffset(float[] point, float[] axis) |
157 | 158 |
{ |
158 |
return point[0]*axis[0] + point[1]*axis[1] + mDistanceCenterFace2D;
|
|
159 |
return point[0]*axis[0] + point[1]*axis[1]; |
|
159 | 160 |
} |
160 | 161 |
|
161 | 162 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
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'