Revision efef689c
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/object/RubikCubeMovement.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.object; |
21 | 21 |
|
22 |
import org.distorted.library.type.Static2D; |
|
22 | 23 |
import org.distorted.library.type.Static4D; |
23 | 24 |
|
24 | 25 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
191 | 192 |
|
192 | 193 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
193 | 194 |
|
194 |
public Static4D newRotation(Static4D rotatedTouchPoint)
|
|
195 |
public Static2D newRotation(Static4D rotatedTouchPoint)
|
|
195 | 196 |
{ |
196 | 197 |
float cubeHalfSize= RubikObject.OBJECT_SCREEN_RATIO*0.5f; |
197 | 198 |
|
... | ... | |
214 | 215 |
mTouch[1] = mPoint[1]; |
215 | 216 |
mTouch[2] = mPoint[2]; |
216 | 217 |
|
217 |
Static4D result=null; |
|
218 |
|
|
219 |
switch(mRotationVect) |
|
220 |
{ |
|
221 |
case VECTX: result = new Static4D(1,0,0,offset); break; |
|
222 |
case VECTY: result = new Static4D(0,1,0,offset); break; |
|
223 |
case VECTZ: result = new Static4D(0,0,1,offset); break; |
|
224 |
} |
|
225 |
|
|
226 |
return result; |
|
218 |
return new Static2D(mRotationVect,offset); |
|
227 | 219 |
} |
228 | 220 |
|
229 | 221 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Progress towards generalizing belongsToRotation()