Revision ee5c2ae1
Added by Leszek Koltunski about 5 years ago
src/main/java/org/distorted/magic/RubikSurfaceView.java | ||
---|---|---|
55 | 55 |
|
56 | 56 |
private boolean mDragging, mBeginningRotation, mContinuingRotation; |
57 | 57 |
private int mX, mY; |
58 |
private Static4D mQuatCurrent, mQuatAccumulated; |
|
59 | 58 |
private int mRotationVect; |
60 | 59 |
private RubikRenderer mRenderer; |
61 | 60 |
|
... | ... | |
64 | 63 |
private int mScreenWidth, mScreenHeight, mScreenMin; |
65 | 64 |
private float mCameraDistance; |
66 | 65 |
|
66 |
private static Static4D mQuatCurrent =new Static4D(0,0,0,1); |
|
67 |
private static Static4D mQuatAccumulated=new Static4D(-0.25189602f,0.3546389f,0.009657208f,0.90038127f); |
|
68 |
|
|
67 | 69 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
68 | 70 |
|
69 | 71 |
public RubikSurfaceView(Context context, AttributeSet attrs) |
... | ... | |
83 | 85 |
mScreenWidth = mScreenHeight = mScreenMin = 0; |
84 | 86 |
|
85 | 87 |
mRenderer = new RubikRenderer(this); |
86 |
|
|
87 |
mQuatCurrent = new Static4D(0,0,0,1); |
|
88 |
mQuatAccumulated = mRenderer.initializeQuat(); |
|
88 |
mRenderer.setQuatAccumulated(mQuatAccumulated); |
|
89 | 89 |
|
90 | 90 |
final ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); |
91 | 91 |
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo(); |
Also available in: Unified diff
Remember the quaternion.