Revision 5b893eee
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/objects/RubikObject.java | ||
---|---|---|
54 | 54 |
{ |
55 | 55 |
private static final Static3D CENTER = new Static3D(0,0,0); |
56 | 56 |
static final int INTERIOR_COLOR = 0xff000000; |
57 |
public static final int NODE_FBO_SIZE = 600; |
|
58 | 57 |
private static final int POST_ROTATION_MILLISEC = 500; |
59 | 58 |
private static final int TEXTURE_HEIGHT = 128; |
60 | 59 |
|
... | ... | |
65 | 64 |
static float OBJECT_SCREEN_RATIO; |
66 | 65 |
|
67 | 66 |
private final int NUM_CUBITS; |
67 |
private final int mNodeSize; |
|
68 | 68 |
private int mRotRowBitmap; |
69 | 69 |
private int mRotAxis; |
70 | 70 |
private Static3D[] mOrigPos; |
... | ... | |
90 | 90 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
91 | 91 |
|
92 | 92 |
RubikObject(int size, int fov, Static4D quat, DistortedTexture nodeTexture, MeshRectangles nodeMesh, |
93 |
DistortedEffects nodeEffects, int[][] moves, RubikObjectList list, Resources res) |
|
93 |
DistortedEffects nodeEffects, int[][] moves, RubikObjectList list, Resources res, int screenWidth)
|
|
94 | 94 |
{ |
95 | 95 |
super(nodeTexture,nodeEffects,nodeMesh); |
96 | 96 |
|
97 |
resizeFBO(NODE_FBO_SIZE, NODE_FBO_SIZE); |
|
97 |
mNodeSize = screenWidth; |
|
98 |
|
|
99 |
resizeFBO(mNodeSize, mNodeSize); |
|
98 | 100 |
|
99 | 101 |
mList = list; |
100 | 102 |
mOrigPos = getCubitPositions(size); |
... | ... | |
118 | 120 |
mRotationAngleMiddle = new Static1D(0); |
119 | 121 |
mRotationAngleFinal = new Static1D(0); |
120 | 122 |
|
121 |
float scale = OBJECT_SCREEN_RATIO*NODE_FBO_SIZE/mSize;
|
|
123 |
float scale = OBJECT_SCREEN_RATIO*mNodeSize/mSize;
|
|
122 | 124 |
mScaleEffect = new MatrixEffectScale(new Static3D(scale,scale,scale)); |
123 | 125 |
mQuatEffect = new MatrixEffectQuaternion(quat, CENTER); |
124 | 126 |
|
... | ... | |
616 | 618 |
return speed> 1.3f ? NEAREST*(angle>0 ? 1:-1) : 0; |
617 | 619 |
} |
618 | 620 |
|
621 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
622 |
|
|
623 |
public int getNodeSize() |
|
624 |
{ |
|
625 |
return mNodeSize; |
|
626 |
} |
|
627 |
|
|
619 | 628 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
620 | 629 |
|
621 | 630 |
public RubikObjectList getObjectList() |
Also available in: Unified diff
Object node: size of screenWidth.