| 11 | | * This program is free software; you can redistribute it and/or |
|---|
| 12 | | * modify it under the terms of the GNU General Public License |
|---|
| 13 | | * as published by the Free Software Foundation; either version 2 |
|---|
| 14 | | * of the License, or (at your option) any later version. |
|---|
| | 11 | * This program is free software: you can redistribute it and/or modify |
|---|
| | 12 | * it under the terms of the GNU General Public License as published by |
|---|
| | 13 | * the Free Software Foundation, either version 3 of the License, or |
|---|
| | 14 | * (at your option) any later version. |
|---|
| 31 | | package org.libspark.flartoolkit.core.transmat { |
|---|
| 32 | | import org.libspark.flartoolkit.core.transmat.rotmatrix.FLARRotMatrix; |
|---|
| 33 | | import org.libspark.flartoolkit.core.types.FLARDoublePoint3d; |
|---|
| 34 | | import org.libspark.flartoolkit.core.types.matrix.FLARDoubleMatrix34; |
|---|
| 35 | | |
|---|
| 36 | | /** |
|---|
| 37 | | * FLARTransMat戻り値専用のFLARMat |
|---|
| 38 | | * |
|---|
| 39 | | */ |
|---|
| 40 | | public class FLARTransMatResult extends FLARDoubleMatrix34 { |
|---|
| 41 | | |
|---|
| 42 | | private var has_value:Boolean = false; |
|---|
| 43 | | |
|---|
| 44 | | |
|---|
| 45 | | /** |
|---|
| 46 | | * パラメータで変換行列を更新します。 |
|---|
| 47 | | * |
|---|
| 48 | | * @param i_rot |
|---|
| 49 | | * @param i_off |
|---|
| 50 | | * @param i_trans |
|---|
| 51 | | */ |
|---|
| 52 | | public function updateMatrixValue(i_rot:FLARRotMatrix, i_off:FLARDoublePoint3d, i_trans:FLARDoublePoint3d):void { |
|---|
| 53 | | this.m00 = i_rot.m00; |
|---|
| 54 | | this.m01 = i_rot.m01; |
|---|
| 55 | | this.m02 = i_rot.m02; |
|---|
| 56 | | this.m03 = i_rot.m00 * i_off.x + i_rot.m01 * i_off.y + i_rot.m02 * i_off.z + i_trans.x; |
|---|
| 57 | | |
|---|
| 58 | | this.m10 = i_rot.m10; |
|---|
| 59 | | this.m11 = i_rot.m11; |
|---|
| 60 | | this.m12 = i_rot.m12; |
|---|
| 61 | | this.m13 = i_rot.m10 * i_off.x + i_rot.m11 * i_off.y + i_rot.m12 * i_off.z + i_trans.y; |
|---|
| 62 | | |
|---|
| 63 | | this.m20 = i_rot.m20; |
|---|
| 64 | | this.m21 = i_rot.m21; |
|---|
| 65 | | this.m22 = i_rot.m22; |
|---|
| 66 | | this.m23 = i_rot.m20 * i_off.x + i_rot.m21 * i_off.y + i_rot.m22 * i_off.z + i_trans.z; |
|---|
| 67 | | |
|---|
| 68 | | this.has_value = true; |
|---|
| 69 | | return; |
|---|
| 70 | | } |
|---|
| 71 | | |
|---|
| 72 | | public function hasValue():Boolean { |
|---|
| 73 | | return this.has_value; |
|---|
| 74 | | } |
|---|
| 75 | | } |
|---|