Exemple #1
0
	    /**
	     * コンストラクタから呼び出す共通な初期化部分です。
	     * @param i_dist_factor
	     * @param i_prjmat
	     * @throws NyARException
	     */
	    protected void initInstance(NyARIntSize i_screen,double i_near,double i_far,NyARPerspectiveProjectionMatrix i_prjmat,INyARCameraDistortionFactor i_dist_factor)
	    {
		    int number_of_reality_target=this.MAX_LIMIT_KNOWN+this.MAX_LIMIT_UNKNOWN;
		    //演算インスタンス
		    this._transmat=new NyARTransMat(i_dist_factor,i_prjmat);

		    //データインスタンス
		    this._pool=new NyARRealityTargetPool(number_of_reality_target,i_prjmat);
		    this.target=new NyARRealityTargetList(number_of_reality_target);
		    //Trackerの特性値
		    this._tracker=new NyARTracker((this.MAX_LIMIT_KNOWN+this.MAX_LIMIT_UNKNOWN)*2,1,this.MAX_LIMIT_KNOWN*2);
		    //フラスタムの計算とスクリーンサイズの保存
		    this._ref_prjmat=i_prjmat;
		    this._frustum=new NyARFrustum(i_prjmat,i_screen.w,i_screen.h, i_near, i_far);

		    //初期化
		    this._number_of_dead=this._number_of_unknown=this._number_of_known=0;
		    return;
	    }
        /**
         * コンストラクタです。{@link INyARMarkerSystemConfig}を元に、インスタンスを生成します。
         * @param i_config
         * 初期化済の{@link MarkerSystem}を指定します。
         * @throws NyARException
         */
        public NyARMarkerSystem(INyARMarkerSystemConfig i_config)
        {
            this._ref_param=i_config.getNyARParam();
            this._frustum=new NyARFrustum();
            this.initInstance(i_config);
            this.setProjectionMatrixClipping(FRUSTUM_DEFAULT_NEAR_CLIP, FRUSTUM_DEFAULT_FAR_CLIP);

            this._armk_list=new ARMarkerList();
            this._idmk_list=new NyIdList();
            this._tracking_list=new TrackingList();
            this._transmat=i_config.createTransmatAlgorism();
            //同時に判定待ちにできる矩形の数
            this._sq_stack=new SquareStack(INITIAL_MARKER_STACK_SIZE);
            this._on_sq_handler=new OnSquareDetect(i_config,this._armk_list,this._idmk_list,this._tracking_list,this._sq_stack);
        }