Changeset 29 for Theme-2/nobu

Show
Ignore:
Timestamp:
02/29/08 13:39:02 (10 months ago)
Author:
nobu
Message:
  • 若干の修正。
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Theme-2/nobu/src/Application.as

    r27 r29  
    55package 
    66{ 
    7     //  import flash default libraries. 
    8     import flash.display.MovieClip; // fixed dependents. 
    97    import flash.display.StageAlign; 
    108    import flash.display.StageScaleMode; 
    119    import flash.display.StageQuality; 
    1210    import flash.events.Event; 
    13     //  import local libraries. 
    1411    import lib.core.PassiveMovieClip; 
    15     //  import external libraries. 
    1612    import org.libspark.thread.MasterThread; 
    1713 
    1814    /** 
    19      * 
    20      * 
     15     *  ドキュメントクラス 
    2116     **/ 
    2217    public class Application extends PassiveMovieClip 
    2318    { 
    2419        /** 
    25          * 
    26          * 
     20         *  マスタースレッドのインスタンス 
    2721         **/ 
    2822        private var _masterThread:MasterThread; 
    2923 
    3024        /** 
    31          * 
    32          * 
     25         *  初期化を行う 
    3326         **/ 
    3427        protected override function initialize():void 
    3528        { 
     29            //  stageの設定 
    3630            stage.align = StageAlign.TOP_LEFT; 
    3731            stage.quality = StageQuality.HIGH; 
    3832            stage.scaleMode = StageScaleMode.NO_SCALE; 
    3933 
     34            //  マスタースレッドの生成 
    4035            _masterThread = new MasterThread(new ApplicationThread(this)); 
     36 
     37            //  イベントリスナーの登録 
    4138            addEventListener(Event.ENTER_FRAME, loop, false, 0, true); 
    4239        } 
    4340 
    4441        /** 
     42         *  エンターフレーム処理 
    4543         * 
    46          * 
     44         *  @param  evt イベント 
    4745         **/ 
    4846        private function loop(evt:Event):void 
    4947        { 
     48            //  スレッドを実行 
    5049            _masterThread.executeActiveThreads(); 
    5150        } 
  • Theme-2/nobu/src/ApplicationThread.as

    r28 r29  
    55package 
    66{ 
    7     //  import flash default libraries. 
    87    import flash.display.Bitmap; 
    98    import flash.net.URLRequest; 
    10     //  import local libraries. 
    119    import lib.cloud.CloudView; 
    1210    import lib.loading.LoadingProgressView; 
    1311    import lib.core.PassiveMovieClip; 
    14     //  import external libraries. 
    1512    import org.libspark.display.LoaderThread; 
    1613    import org.libspark.net.URLLoaderThread; 
    1714    import org.libspark.thread.Thread; 
    18     import org.libspark.utils.concurrent.ParallelExecutor; 
     15    //import org.libspark.utils.concurrent.ParallelExecutor; 
    1916    import org.libspark.utils.concurrent.SerialExecutor; 
    2017     
    2118    /** 
    22      * 
    23      * 
     19     *  全体の動きを制御するクラス 
    2420     **/ 
    2521    internal class ApplicationThread extends Thread 
    2622    { 
    2723        /** 
    28          * 
    29          * 
     24         *  Applicationのインスタンス 
    3025         **/ 
    3126        private var _view:Application; 
    3227 
    3328        /** 
    34          * 
    35          * 
     29         *  CloudViewのインスタンス 
    3630         **/ 
    3731        private var _cloud:CloudView; 
    3832 
    3933        /** 
    40          * 
    41          * 
     34         *  URLLoaderThreadのインスタンス(XMLロード用) 
    4235         */ 
    4336        private var _xmlLoadThread:URLLoaderThread; 
    4437 
    4538        /** 
    46          * 
    47          * 
     39         *  SerialExecutorのインスタンス(画像ロード用) 
    4840         **/ 
    49         //private var _imageLoadThread:ParallelExecutor; 
    5041        private var _imageLoadThread:SerialExecutor; 
    5142         
    5243        /** 
     44         *  初期化を行う 
    5345         * 
    54          * 
     46         *  @param  p_view  Applicationのインスタンス 
    5547         **/ 
    5648        public function ApplicationThread(p_view:Application) 
     
    5850            _view = p_view; 
    5951        } 
    60          
     52 
     53        /** 
     54         *  スレッドの初期化を行う 
     55         **/ 
    6156        protected override function initialize():void 
    6257        { 
     
    10095            } 
    10196            _cloud = _view.addChild(new CloudView(d)) as CloudView; 
    102             /* 
    103             var i:int, b:Bitmap, p:PassiveMovieClip; 
    104             for (i = 0; i < _imageLoadThread.numThreads; i++) 
    105             { 
    106                 b = LoaderThread(_imageLoadThread.getThreadAt(i)).loader.content as Bitmap; 
    107                 p = _view.addChildAt(new PassiveMovieClip({ 
    108                     x: Math.random() * _view.stage.stageWidth, 
    109                     y: Math.random() * _view.stage.stageHeight, 
    110                     visible: false 
    111                 }), 0) as PassiveMovieClip; 
    112                 p.addChild(b); 
    113             } 
    114             */ 
    11597        } 
    11698 
  • Theme-2/nobu/src/lib/cloud/CloudViewThread.as

    r28 r29  
    1818 
    1919    /** 
    20      * 
    21      * 
     20     *  Papervision3Dの設定と管理を行うクラス 
    2221     **/ 
    2322    internal class CloudViewThread extends Thread 
    2423    { 
    2524        /** 
    26          * 
    27          * 
     25         *  空間の大きさ 
     26         */ 
     27        public static const SPACE_SIZE:int = 2000; 
     28 
     29        /** 
     30         *  回転率のリミット 
     31         */ 
     32        public static const ROTATION_LIMIT:int = 360; 
     33 
     34        /** 
     35         *  ビュークラスのインスタンス 
    2836         **/ 
    2937        private var _view:CloudView; 
    3038 
    3139        /** 
    32          * 
    33          * 
     40         *  シーンのインスタンス(papervision3d) 
    3441         **/ 
    3542        private var _scene:MovieScene3D; 
    3643 
    3744        /** 
    38          * 
    39          * 
     45         *  カメラのインスタンス(papervision3d) 
    4046         **/ 
    4147        private var _camera:Camera3D; 
    4248 
    4349        /** 
    44          * 
    45          * 
     50         *  表示データの個数 
    4651         **/ 
    4752        private var _length:int; 
    4853 
    4954        /** 
    50          * 
    51          * 
     55         *  表示データのホルダー 
    5256         **/ 
    5357        private var _planes:Dictionary; 
     
    5559        /** 
    5660         * 
     61         *  初期化とレンダリング準備を行う 
    5762         * 
     63         *  @param  p_view  CloudViewのインスタンス 
    5864         **/ 
    5965        public function CloudViewThread(p_view:CloudView) 
     
    6773 
    6874        /** 
    69          * 
    70          * 
     75         *  スレッドの初期化を行う 
    7176         **/ 
    7277        protected override function initialize():void 
     
    8186 
    8287        /** 
    83          * 
    84          * 
     88         *  オブジェクトの生成と描画の更新を行う 
    8589         **/ 
    8690        protected override function execute():void 
     
    116120            _scene.renderCamera(_camera); 
    117121        } 
    118          
     122 
     123        /** 
     124         *  ビットマップからオブジェクトを生成する 
     125         **/ 
    119126        private function createPartial():void 
    120127        { 
     
    126133            var plane:Plane = new Plane(material, 0.5, 0, 2, 2); 
    127134            var goData:DisplayObject3D = new DisplayObject3D(); 
    128             goData.x = Math.random() * 2000 - 1000
    129             goData.y = Math.random() * 2000 - 1000
    130             goData.z = Math.random() * 2000 - 1000
    131             goData.rotationX = Math.random() * 360
    132             goData.rotationY = Math.random() * 360
    133             goData.rotationZ = Math.random() * 360
     135            goData.x = Math.random() * SPACE_SIZE - SPACE_SIZE / 2
     136            goData.y = Math.random() * SPACE_SIZE - SPACE_SIZE / 2
     137            goData.z = Math.random() * SPACE_SIZE - SPACE_SIZE / 2
     138            goData.rotationX = Math.random() * ROTATION_LIMIT
     139            goData.rotationY = Math.random() * ROTATION_LIMIT
     140            goData.rotationZ = Math.random() * ROTATION_LIMIT
    134141            plane.extra = { 
    135142                goto: goData 
     
    147154 
    148155        /** 
     156         *  オブジェクトのロールオーバー処理 
    149157         * 
    150          * 
     158         *  @param  evt マウスイベント 
    151159         **/ 
    152160        private function rollOverListener(evt:MouseEvent):void 
    153161        { 
    154             var plane:Plane = _planes[evt.target]; 
    155             plane.scaleX = 1.1; 
    156             plane.scaleY = 1.1; 
    157             plane.material.lineAlpha = 1; 
     162            _planes[evt.target].material.lineAlpha = 1; 
    158163        } 
    159164 
    160165        /** 
     166         *  オブジェクトのロールアウト処理 
    161167         * 
    162          * 
     168         *  @param  evt マウスイベント 
    163169         **/ 
    164170        private function rollOutListener(evt:MouseEvent):void 
    165171        { 
    166             var plane:Plane = _planes[evt.target]; 
    167             plane.scaleX = 1; 
    168             plane.scaleY = 1; 
    169             plane.material.lineAlpha = 0; 
     172            _planes[evt.target].material.lineAlpha = 0; 
    170173        } 
    171174 
    172175        /** 
     176         *  オブジェクトのマウスダウン処理 
    173177         * 
    174          * 
     178         *  @param  evt マウスイベント 
    175179         **/ 
    176180        private function mouseDownListener(evt:MouseEvent):void 
    177181        { 
    178182            var plane:Plane = _planes[evt.target]; 
    179             plane.scaleX = 1; 
    180             plane.scaleY = 1; 
    181183            plane.material.lineAlpha = 0; 
    182184 
     
    188190            _camera.extra.goTarget.copyPosition(plane); 
    189191        } 
    190  
    191         /** 
    192          * 
    193          * 
    194          **/ 
    195         protected override function finalize():void 
    196         { 
    197              
    198         } 
    199192    } 
    200193}