package com.transmote.utils.geom { import flash.geom.Matrix3D; import org.libspark.flartoolkit.core.types.matrix.FLARDoubleMatrix34; /** * @author Eric Socolofsky * @url http://transmote.com/flar */ public class FLARGeomUtils { public static function translateFLARMatrixToFlashMatrix (fm:FLARDoubleMatrix34, scale:Number=1.0) :Matrix3D { return new Matrix3D (Vector.([ fm.m00*scale, fm.m10*scale, fm.m20*scale, 0, -fm.m01*scale, -fm.m11*scale, -fm.m21*scale, 0, -fm.m02*scale, -fm.m12*scale, -fm.m22*scale, 0, fm.m03*scale, fm.m13*scale, fm.m23*scale, 1 ])); } public static function dumpFLARMatrix (fm:FLARDoubleMatrix34) :String { return (fm.m00.toFixed(4) +"\u0009"+ fm.m01.toFixed(4) +"\u0009"+ fm.m02.toFixed(4) +"\u0009"+ fm.m03.toFixed(4) +"\n"+ fm.m10.toFixed(4) +"\u0009"+ fm.m11.toFixed(4) +"\u0009"+ fm.m12.toFixed(4) +"\u0009"+ fm.m13.toFixed(4) +"\n"+ fm.m20.toFixed(4) +"\u0009"+ fm.m21.toFixed(4) +"\u0009"+ fm.m22.toFixed(4) +"\u0009"+ fm.m23.toFixed(4)); } public function FLARGeomUtils () {} } }