Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 203 | chris | 1 | /* |
| 2 | * PROJECT: NyARToolkit |
||
| 3 | * -------------------------------------------------------------------------------- |
||
| 4 | * |
||
| 5 | * The NyARToolkit is Java version ARToolkit class library. |
||
| 6 | * Copyright (C)2008 R.Iizuka |
||
| 7 | * |
||
| 8 | * This program is free software; you can redistribute it and/or |
||
| 9 | * modify it under the terms of the GNU General Public License |
||
| 10 | * as published by the Free Software Foundation; either version 2 |
||
| 11 | * of the License, or (at your option) any later version. |
||
| 12 | * |
||
| 13 | * This program is distributed in the hope that it will be useful, |
||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
| 16 | * GNU General Public License for more details. |
||
| 17 | * |
||
| 18 | * You should have received a copy of the GNU General Public License |
||
| 19 | * along with this framework; if not, write to the Free Software |
||
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
| 21 | * |
||
| 22 | * For further information please contact. |
||
| 23 | * http://nyatla.jp/nyatoolkit/ |
||
| 24 | * <airmail(at)ebony.plala.or.jp> |
||
| 25 | * |
||
| 26 | */ |
||
| 27 | package jp.nyatla.nyartoolkit.core; |
||
| 28 | |||
| 29 | import jp.nyatla.nyartoolkit.*; |
||
| 30 | /** |
||
| 31 | * NyARTransMat戻り値専用のNyARMat |
||
| 32 | * |
||
| 33 | */ |
||
| 34 | public class NyARTransMatResult extends NyARMat |
||
| 35 | { |
||
| 36 | private boolean has_value=false; |
||
| 37 | public NyARTransMatResult() |
||
| 38 | { |
||
| 39 | super(3,4); |
||
| 40 | } |
||
| 41 | /** |
||
| 42 | * この関数は使えません。 |
||
| 43 | * @param i_row |
||
| 44 | * @param i_clm |
||
| 45 | * @throws NyARException |
||
| 46 | */ |
||
| 47 | public NyARTransMatResult(int i_row,int i_clm) throws NyARException |
||
| 48 | { |
||
| 49 | super();//ここで例外発生 |
||
| 50 | } |
||
| 51 | /** |
||
| 52 | * パラメータで変換行列を更新します。 |
||
| 53 | * @param i_rot |
||
| 54 | * @param i_off |
||
| 55 | * @param i_trans |
||
| 56 | */ |
||
| 57 | public void updateMatrixValue(NyARTransRot i_rot,double[] i_off,double[] i_trans) |
||
| 58 | { |
||
| 59 | double[] pa; |
||
| 60 | double[] rot=i_rot.getArray(); |
||
| 61 | |||
| 62 | pa=this.m[0]; |
||
| 63 | pa[0] = rot[0*3+0]; |
||
| 64 | pa[1] = rot[0*3+1]; |
||
| 65 | pa[2] = rot[0*3+2]; |
||
| 66 | pa[3] = rot[0*3+0]*i_off[0] + rot[0*3+1]*i_off[1] + rot[0*3+2]*i_off[2] + i_trans[0]; |
||
| 67 | |||
| 68 | pa=this.m[1]; |
||
| 69 | pa[0] = rot[1*3+0]; |
||
| 70 | pa[1] = rot[1*3+1]; |
||
| 71 | pa[2] = rot[1*3+2]; |
||
| 72 | pa[3] = rot[1*3+0]*i_off[0] + rot[1*3+1]*i_off[1] + rot[1*3+2]*i_off[2] + i_trans[1]; |
||
| 73 | |||
| 74 | pa=this.m[2]; |
||
| 75 | pa[0] = rot[2*3+0]; |
||
| 76 | pa[1] = rot[2*3+1]; |
||
| 77 | pa[2] = rot[2*3+2]; |
||
| 78 | pa[3] = rot[2*3+0]*i_off[0] + rot[2*3+1]*i_off[1] + rot[2*3+2]*i_off[2] + i_trans[2]; |
||
| 79 | |||
| 80 | |||
| 81 | this.has_value=true; |
||
| 82 | return; |
||
| 83 | } |
||
| 84 | public void copyFrom(NyARTransMatResult i_from) throws NyARException |
||
| 85 | { |
||
| 86 | super.copyFrom(i_from); |
||
| 87 | this.has_value=i_from.has_value; |
||
| 88 | } |
||
| 89 | public boolean hasValue() |
||
| 90 | { |
||
| 91 | return this.has_value; |
||
| 92 | } |
||
| 93 | } |