チェンジセット 1755

差分発生行の前後
無視リスト:
コミット日時:
2008/10/30 01:26:56 (2 ヶ月前)
コミッタ:
tarotarorg
ログメッセージ:

キューブ型マーカ関連。ちょっと出来てきた。

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/FLARToolKit/trunk/samples/Data

    • 属性の設定値: svn:ignore (変更前)
      *.jpg
      (変更後)
      *.jpg
      saito-marker.png
      saito.pat
  • as3/FLARToolKit/trunk/src/org/libspark/flartoolkit/core/types/FLARIntSize.as

    r1752 r1755  
    3131package org.libspark.flartoolkit.core.types { 
    3232 
    33         public class FLARIntSize
     33        public class FLARIntSize
    3434 
    3535                public var h:int; 
     
    7777                } 
    7878                 
    79                 override public function toString():String  
     79                public function toString():String  
    8080                { 
    81                         return "(width=" + _size.w + " , height=" + this._size.h + ")"; 
     81                        return "(width=" + w + " , height=" + h + ")"; 
    8282                } 
    8383        } 
  • as3/FLARToolKit/trunk/src/org/libspark/flartoolkit/detector/CubeMarker.as

    r1752 r1755  
    3535 
    3636        import org.libspark.flartoolkit.core.FLARCode; 
     37        import org.libspark.flartoolkit.FLARException; 
    3738         
    3839        /** 
     
    8283                                var code:FLARCode = this[key] as FLARCode; 
    8384                                if (code != null && code != this.top) { 
    84                                         if (cw != code.getWidth() || ch != code.getHeight()) { 
     85                                        if (!this.checkResolution(this.top,code)) { 
    8586                                                // 違う解像度のが混ざっている。 
    86                                                 throw new FLARException(); 
     87                                                throw new FLARException("コード[" + key + "]の解像度が不正です。"); 
    8788                                        } 
    8889                                } 
    8990                        } 
     91                } 
     92 
     93                private function checkResolution(src:FLARCode,dest:FLARCode):Boolean  
     94                { 
     95                        const cw:int = src.getWidth(); 
     96                        const ch:int = src.getHeight(); 
     97                        return (cw == dest.getWidth() && ch == dest.getHeight()); 
    9098                } 
    9199 
     
    94102                public function set top(value:FLARCode):void  
    95103                { 
    96                         _top = value; 
     104                        if (_top == null || this.checkResolution(_top, value)) _top = value; 
     105                        else throw new FLARException("コード[top]の解像度が不正です。"); 
    97106                } 
    98107                 
     
    101110                public function set bottom(value:FLARCode):void  
    102111                { 
    103                         _bottom = value; 
     112                        if (_bottom == null || this.checkResolution(_bottom, value)) _bottom = value; 
     113                        else throw new FLARException("コード[bottom]の解像度が不正です。"); 
    104114                } 
    105115                 
     
    129139                public function set right(value:FLARCode):void  
    130140                { 
    131                         _right = value; 
     141                        if (_right == null || this.checkResolution(_right, value)) _right = value; 
     142                        else throw new FLARException("コード[right]の解像度が不正です。"); 
    132143                } 
    133144                 
  • as3/FLARToolKit/trunk/src/org/libspark/flartoolkit/detector/CubeMarkerDirection.as

    r1752 r1755  
    3838         * @author 太郎(tarotaro.org) 
    3939         */ 
    40         public final class CubeMarkerDirection  
     40        public class CubeMarkerDirection  
    4141        { 
    42                  
    43                 public function CubeMarkerDirection()  
    44                 { 
    45                         public const TOP:String = "top"; 
    46                         public const BOTTOM:String = "bottom"; 
    47                         public const LEFT:String = "left"; 
    48                         public const RIGHT:String = "right"; 
    49                         public const FRONT:String = "front"; 
    50                         public const BACK:String = "back"; 
    51                 } 
    52                  
     42                public static const TOP:String = "top"; 
     43                public static const BOTTOM:String = "bottom"; 
     44                public static const LEFT:String = "left"; 
     45                public static const RIGHT:String = "right"; 
     46                public static const FRONT:String = "front"; 
     47                public static const BACK:String = "back"; 
    5348        } 
    5449