Revision ba740a0c
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/object/RubikObject.java | ||
---|---|---|
36 | 36 |
import org.distorted.library.type.Static3D; |
37 | 37 |
import org.distorted.library.type.Static4D; |
38 | 38 |
|
39 |
import static org.distorted.magic.RubikRenderer.NODE_MESH_SIZE;
|
|
39 |
import static org.distorted.magic.RubikRenderer.NODE_FBO_SIZE;
|
|
40 | 40 |
|
41 | 41 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
42 | 42 |
|
... | ... | |
69 | 69 |
{ |
70 | 70 |
super(texture,effects,mesh); |
71 | 71 |
|
72 |
resizeFBO(NODE_MESH_SIZE,NODE_MESH_SIZE);
|
|
72 |
resizeFBO(NODE_FBO_SIZE, NODE_FBO_SIZE);
|
|
73 | 73 |
|
74 | 74 |
LEGAL_QUATS = getLegalQuats(); |
75 | 75 |
NUM_CUBITS = getNumCubits(size); |
... | ... | |
94 | 94 |
mQuatAEffect = new MatrixEffectQuaternion(quatAcc, center); |
95 | 95 |
|
96 | 96 |
MatrixEffectScale nodeScaleEffect = new MatrixEffectScale(mNodeScale); |
97 |
|
|
98 | 97 |
effects.apply(nodeScaleEffect); |
99 | 98 |
|
100 | 99 |
mCubits = new Cubit[NUM_CUBITS]; |
... | ... | |
165 | 164 |
|
166 | 165 |
public void recomputeScaleFactor(int scrWidth, int scrHeight) |
167 | 166 |
{ |
168 |
float mx = getMesh().getStretchX(); |
|
169 |
float my = getMesh().getStretchY(); |
|
170 |
float factor = (my/mx > (float)scrHeight/scrWidth) ? (float)scrHeight/my : (float)scrWidth/mx; |
|
171 |
float scaleFactor = (OBJECT_SCREEN_RATIO*mx/mSize); |
|
167 |
float factor = scrWidth>scrHeight ? scrHeight : scrWidth; |
|
168 |
float scaleFactor = OBJECT_SCREEN_RATIO*NODE_FBO_SIZE/mSize; |
|
172 | 169 |
|
173 | 170 |
mNodeScale.set(factor,factor,factor); |
174 | 171 |
mScale.set(scaleFactor,scaleFactor,scaleFactor); |
Also available in: Unified diff
Correct the Rubik app for the recent changes to the library's Node.