Revision 334c13fa
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/matrix3d/Matrix3DActivity.java | ||
---|---|---|
53 | 53 |
private EffectNames[] mEffectNames; |
54 | 54 |
|
55 | 55 |
private static boolean mSupportsCenter; |
56 |
private float mCenterX, mCenterY; |
|
56 |
private float mCenterX, mCenterY, mCenterZ;
|
|
57 | 57 |
|
58 | 58 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
59 | 59 |
|
... | ... | |
111 | 111 |
|
112 | 112 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
113 | 113 |
|
114 |
public void setCenter(float x, float y) |
|
114 |
public void setCenter(float x, float y, float z)
|
|
115 | 115 |
{ |
116 | 116 |
mCenterX = x; |
117 | 117 |
mCenterY = y; |
118 |
mCenterZ = z; |
|
118 | 119 |
} |
119 | 120 |
|
120 | 121 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
183 | 184 |
return mObject==null ? 0: mObject.getHeight(); |
184 | 185 |
} |
185 | 186 |
|
187 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
188 |
|
|
189 |
public int getScreenWidth() |
|
190 |
{ |
|
191 |
Matrix3DRenderer r = ((Matrix3DSurfaceView)findViewById(R.id.matrix3dSurfaceView)).getRenderer(); |
|
192 |
return r.getWidth(); |
|
193 |
} |
|
194 |
|
|
195 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
196 |
|
|
197 |
public int getScreenHeight() |
|
198 |
{ |
|
199 |
Matrix3DRenderer r = ((Matrix3DSurfaceView)findViewById(R.id.matrix3dSurfaceView)).getRenderer(); |
|
200 |
return r.getHeight(); |
|
201 |
} |
|
202 |
|
|
203 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
204 |
|
|
205 |
public int getDepth() |
|
206 |
{ |
|
207 |
return mObject==null ? 0: mObject.getDepth(); |
|
208 |
} |
|
209 |
|
|
186 | 210 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
187 | 211 |
|
188 | 212 |
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) |
Also available in: Unified diff
Make the effect Center be always 3D.