Revision 36273130
Added by Leszek Koltunski almost 5 years ago
src/main/java/org/distorted/object/Cubit.java | ||
---|---|---|
171 | 171 |
mCurrentPosition = position; |
172 | 172 |
mRotateEffect = new MatrixEffectRotate(mRotationAngle, mRotationAxis, matrCenter); |
173 | 173 |
|
174 |
mEffect = new DistortedEffects(1);
|
|
174 |
mEffect = new DistortedEffects(); |
|
175 | 175 |
mEffect.apply(mParent.mSinkEffect); |
176 | 176 |
mEffect.apply( new MatrixEffectMove(vector) ); |
177 | 177 |
mEffect.apply( new MatrixEffectQuaternion(mQuatScramble, matrCenter)); |
src/main/java/org/distorted/object/RubikObject.java | ||
---|---|---|
169 | 169 |
|
170 | 170 |
public void recomputeScaleFactor(int screenWidth, int screenHeight) |
171 | 171 |
{ |
172 |
int sizeX = getEffects().getStartchX();
|
|
173 |
int sizeY = getEffects().getStartchY();
|
|
172 |
float sizeX = getMesh().getStretchX();
|
|
173 |
float sizeY = getMesh().getStretchY();
|
|
174 | 174 |
|
175 |
if( (float)sizeY/sizeX > (float)screenHeight/screenWidth )
|
|
175 |
if( sizeY/sizeX > (float)screenHeight/screenWidth ) |
|
176 | 176 |
{ |
177 |
int w = (screenHeight*sizeX)/sizeY;
|
|
177 |
float w = (screenHeight*sizeX)/sizeY;
|
|
178 | 178 |
float factor = (float)screenHeight/sizeY; |
179 | 179 |
mNodeMove.set((screenWidth-w)*0.5f ,0, 0); |
180 | 180 |
mNodeScale.set(factor,factor,factor); |
181 | 181 |
} |
182 | 182 |
else |
183 | 183 |
{ |
184 |
int h = (screenWidth*sizeY)/sizeX;
|
|
184 |
float h = (screenWidth*sizeY)/sizeX;
|
|
185 | 185 |
float factor = (float)screenWidth/sizeX; |
186 | 186 |
mNodeMove.set(0,(screenHeight-h)*0.5f,0); |
187 | 187 |
mNodeScale.set(factor,factor,factor); |
src/main/java/org/distorted/object/RubikObjectList.java | ||
---|---|---|
85 | 85 |
public RubikObject create(Static4D quatCur, Static4D quatAcc) |
86 | 86 |
{ |
87 | 87 |
DistortedTexture texture = new DistortedTexture(); |
88 |
DistortedEffects effects = new DistortedEffects(NODE_MESH_SIZE,NODE_MESH_SIZE,0);
|
|
88 |
DistortedEffects effects = new DistortedEffects(); |
|
89 | 89 |
MeshRectangles mesh = new MeshRectangles(20,20); // mesh of the node, not of the cubits |
90 | 90 |
|
91 |
mesh.setStretch(NODE_MESH_SIZE,NODE_MESH_SIZE,0); |
|
92 |
|
|
91 | 93 |
return new RubikCube(mObjectSize, quatCur, quatAcc, texture, mesh, effects); |
92 | 94 |
} |
93 | 95 |
|
Also available in: Unified diff
Move the Effects.setStretch to Meshbase.setStretch