+
+ private void drawHand()
+ {
+ /* Draw hand */
+ int num = this.hand.length;
+ for (int i = 0; i < num; i++) {
+ if (this.drag && this.ypos >= this.ylim && i == this.pick)
+ continue;
+
+ Matrix.setIdentityM(this.model, 0);
+
+ Matrix.rotateM(this.model, 0, 45f, 1f, 0f, 0f);
+ Matrix.translateM(this.model, 0, 0f, -0.3f, 1.20f);
+
+ if (this.drag) {
+ float pct = (float)(i+0.5) / num;
+ float err = this.xpos - pct;
+ float y = (float)this.ypos / this.ylim;
+ float lim = Math.min(Math.max(y,0),1);
+ float fcn = 0.1f
+ * (float)Math.exp(-10*num*Math.pow(y*err,2))
+ * (1f-(float)Math.pow(1-lim, 2));
+ Matrix.translateM(this.model, 0, 0, fcn, 0);
+ }
+
+ float left = -20f + 20f*(1f/num);
+ float right = 54f - 54f*(1f/num);
+ float ang = left + i*(right-left)/num;
+ Matrix.rotateM(this.model, 0, ang, 0f, 0f, -1f);
+ Matrix.translateM(this.model, 0, 0f, 0.15f, 0f);
+
+ GLES20.glUniformMatrix4fv(this.modelHandle, 1, false, this.model, 0);
+ this.drawCard(this.hand[i]);
+ }
+ }
+
+ private void drawPick()
+ {
+ /* Draw selected card */
+ if (this.drag && this.ypos >= this.ylim) {
+ Matrix.setIdentityM(this.model, 0);
+ Matrix.rotateM(this.model, 0, 45f, 1f, 0f, 0f);
+ Matrix.translateM(this.model, 0, 0f, 0f, 1.20f);
+ GLES20.glUniformMatrix4fv(this.modelHandle, 1, false, this.model, 0);
+ this.drawCard(this.hand[this.pick]);
+ }
+ }
+