2 * PROJECT: NyARToolkit
\r
3 * --------------------------------------------------------------------------------
\r
4 * This work is based on the original ARToolKit developed by
\r
7 * HITLab, University of Washington, Seattle
\r
8 * http://www.hitl.washington.edu/artoolkit/
\r
10 * The NyARToolkit is Java edition ARToolKit class library.
\r
11 * Copyright (C)2008-2009 Ryo Iizuka
\r
13 * This program is free software: you can redistribute it and/or modify
\r
14 * it under the terms of the GNU General Public License as published by
\r
15 * the Free Software Foundation, either version 3 of the License, or
\r
16 * (at your option) any later version.
\r
18 * This program is distributed in the hope that it will be useful,
\r
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
21 * GNU General Public License for more details.
\r
23 * You should have received a copy of the GNU General Public License
\r
24 * along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
26 * For further information please contact.
\r
27 * http://nyatla.jp/nyatoolkit/
\r
28 * <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
\r
31 package jp.nyatla.nyartoolkit.core.transmat;
\r
34 import jp.nyatla.nyartoolkit.core.types.NyARDoublePoint3d;
\r
35 import jp.nyatla.nyartoolkit.core.types.matrix.*;
\r
38 * NyARTransMat戻り値専用のNyARMat
\r
41 public class NyARTransMatResult extends NyARDoubleMatrix34
\r
43 public boolean has_value = false;
\r
45 * この関数は、0-PIの間で値を返します。
\r
48 public final void getZXYAngle(NyARDoublePoint3d o_out)
\r
50 double sina = this.m21;
\r
52 o_out.x = Math.PI / 2;
\r
54 o_out.z = Math.atan2(-this.m10, this.m00);
\r
55 } else if (sina <= -1.0) {
\r
56 o_out.x = -Math.PI / 2;
\r
58 o_out.z = Math.atan2(-this.m10, this.m00);
\r
60 o_out.x = Math.asin(sina);
\r
61 o_out.z = Math.atan2(-this.m01, this.m11);
\r
62 o_out.y = Math.atan2(-this.m20, this.m22);
\r
65 public final void transformVertex(double i_x,double i_y,double i_z,NyARDoublePoint3d o_out)
\r
67 o_out.x=this.m00*i_x+this.m01*i_y+this.m02*i_z+this.m03;
\r
68 o_out.y=this.m10*i_x+this.m11*i_y+this.m12*i_z+this.m13;
\r
69 o_out.z=this.m20*i_x+this.m21*i_y+this.m22*i_z+this.m23;
\r