人生ゲーム漬けなダメ人間のBlog

ページ内情報

プロフィール

ページ内検索




カレンダー
    123
45678910
11121314151617
18192021222324
252627282930 
<< June 2017 >>



月ごとで検索


カテゴリーで検索




最近の日記一覧

コンテンツ

【awayjs】独学でこれ以上進むのは無理ぽ…

来るべき時に備えて以前flashで作っていた
こいつをjsに書き換えるのに苦労しているのです…

以前swf向けに作ったものが流用ききやすいと聞いて
node.jsも導入してtypeScriptでの作業をしています。


|д'゚) …が、コンパイルはとおるが、どうにも先に進まない


というわけで、とりあえずコードとエラー文だけ
本分で晒して救済してもらおうという生業…


(´・ω・`) おいらの明日はあるのかー! ←次週はないです


※本文はコードエラーコードだけです。
|д゚)ノシ オコシイタダキ アリガトヤシタ

今回のコード


/// /// /// /// /// /// /// import ContextGLProfile = require("awayjs-stagegl/lib/base/ContextGLProfile"); import View = require("awayjs-display/lib/containers/View"); import Scene = require("awayjs-display/lib/containers/Scene"); import Vector3D = require("awayjs-core/lib/geom/Vector3D"); import IAsset = require("awayjs-core/lib/library/IAsset"); import DefaultRenderer = require("awayjs-renderergl/lib/DefaultRenderer"); import MethodMaterial = require("awayjs-methodmaterials/lib/MethodMaterial"); //import IRenderer = require("awayjs-display/lib/IRenderer"); //import ImageBase = require("awayjs-core/lib/data/ImageBase"); import Stage = require("awayjs-stagegl/lib/base/Stage"); import ProgramData = require("awayjs-stagegl/lib/pool/ProgramData"); import IAnimationSet = require("awayjs-display/lib/animators/IAnimationSet"); import AnimationSetBase = require("awayjs-renderergl/lib/animators/AnimationSetBase"); import AnimationNodeBase = require("awayjs-display/lib/animators/nodes/AnimationNodeBase"); import RequestAnimationFrame = require("awayjs-core/lib/utils/RequestAnimationFrame"); import SkeletonAnimationSet = require("awayjs-renderergl/lib/animators/SkeletonAnimationSet"); import SkeletonAnimator = require("awayjs-renderergl/lib/animators/SkeletonAnimator"); import Skeleton = require("awayjs-renderergl/lib/animators/data/Skeleton"); import SkeletonClipNode = require("awayjs-renderergl/lib/animators/nodes/SkeletonClipNode"); import CrossfadeTransition = require("awayjs-renderergl/lib/animators/transitions/CrossfadeTransition"); import Camera = require("awayjs-display/lib/entities/Camera"); import HoverController = require("awayjs-display/lib/controllers/HoverController"); import DirectionalLight = require("awayjs-display/lib/entities/DirectionalLight"); import StaticLightPicker = require("awayjs-display/lib/materials/lightpickers/StaticLightPicker"); import DirectionalLightNode = require ("awayjs-display/lib/partition/DirectionalLightNode"); import AssetLibrary = require("awayjs-core/lib/library/AssetLibrary"); import IAssetClass = require("awayjs-core/lib/library/IAssetClass"); import LoaderSession = require("awayjs-core/lib/library/LoaderSession"); import LoaderContext = require("awayjs-core/lib/library/LoaderContext"); import URLRequest = require("awayjs-core/lib/net/URLRequest"); import AWD3Parser = require("awayjs-parsers/lib/AWD3Parser"); //import AWDParser = require("awayjs-parsers/lib/AWDParser"); import AssetLibraryBundle = require("awayjs-core/lib/library/AssetLibraryBundle"); import Loader = require("awayjs-display/lib/containers/Loader"); import Error = require("awayjs-core/lib/errors/Error"); import AssetEvent = require("awayjs-core/lib/events/AssetEvent"); import AnimationStateEvent = require("awayjs-renderergl/lib/events/AnimationStateEvent"); import LoaderEvent = require("awayjs-core/lib/events/LoaderEvent"); import Mesh = require("awayjs-display/lib/entities/Mesh"); class Main { private NORMAL_ANIM:string = "cube_wait"; private ACTION_ANIM:string = "cube_jump"; //諸々指定 //var loader:Loader3D = new Loader3D(); //private _sharecontext:Boolean = true; //private _programData: private _stage:Stage; private _contextGLprofile:boolean = true; private renderer:DefaultRenderer = new DefaultRenderer(this._stage,this._contextGLprofile); private _loader:Loader; private _loaderContext:LoaderContext; private _mesh:Mesh; private _material:MethodMaterial; private _light:DirectionalLight; private _lightPicker:StaticLightPicker; private _skeleton:Skeleton; private _animator:SkeletonAnimator; private _node:SkeletonClipNode; private _view:View; private _scene:Scene; private _camera:Camera; private _timer:RequestAnimationFrame; private _time:number = 0; //アニメーションのフェードアウト係数設定 private _stateTransition:CrossfadeTransition = new CrossfadeTransition(0.5); //何度も使う場合は先に埋め込む //[Embed(source="../resource/testscene_mami_solo.awd",mimeType="application/octet-stream")] //private mami_3d:Class; //[Embed(source="../resource/box_Gometry.awd",mimeType="application/octet-stream")] //private MyBox_3d:Class; //private _Resource_list:string = "../resource3d/test_BattleScene.awd"; private _Resource_list:string = "../resource3d/test_CubeAnim_scene.awd"; //console.log("start: "+ loader); constructor() { this.init(); } private init():void { this.initEngine(); this.initListener(); } private initEngine():void{ //Viewとsceneとcamera定義 //var View:View3D = new View3D(); this._view = new View(this.renderer); this._view.backgroundColor = 0x1e2125; window.onresize = (event:UIEvent) => this.resize(); this.resize(); //var arcane:shareContext; //this._view.shareContext = true; this._scene = this._view.scene; this._loader = new Loader(); this._loader.transform.scale = new Vector3D(10, 10, 10); this._loader.z = -200; this._view.scene.addChild(this._loader); } private initListener():void{ //パーサ定義 //AssetLibrary.enableParser(AWD2Parser); //AssetLibrary.enableParser(AWDParser); AssetLibrary.enableParser(AWD3Parser); //ロードイベント //AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, (event:AssetEvent) => this.onAssetComplete(event)); this._loader.addEventListener(AssetEvent.ASSET_COMPLETE, (event:AssetEvent) => this.onAssetComplete(event)); AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event) ); //loader.loadData( new mami_3d() ); //loader.loadData( new MyBox_3d() ); //AssetLibrary.load(new URLRequest(this._Resource_list)); this._loaderContext = new LoaderContext(); this._loader.load(new URLRequest(this._Resource_list),this._loaderContext,null,new AWD3Parser()); } //アセットも読み終わったら表示開始 private onResourceComplete(event:LoaderEvent):void{ //AssetLibrary.removeEventListener(LoaderEvent.RESOURCE_COMPLETE, onResourceComplete ); //console.log("loadComplete"); //addEventListener(Event.ENTER_FRAME, (event:Event) => this.onEnterFrame); this._timer = new RequestAnimationFrame(this.onEnterFrame, this); this._timer.start(); } private onAssetComplete(event:AssetEvent):void{ var _asset:IAsset = event.asset; //forEachの如く呼び出されたアセットをひたすら潜って拾う模様。変な処理を書くと悲劇になるので注意w //AssetLibrary.removeEventListener(AssetEvent.ASSET_COMPLETE, this.onAssetComplete ); //trace(event.asset.name +" : "+ event.asset.assetType); //console.log(_asset.name +" : "+ _asset.assetType); /* if (_asset.assetType == Scene.assetType){ //this._scene = _asset as Scene; this._scene = _asset; this._view.scene = this._scene; }*/ if (_asset.assetType == Camera.assetType){ //this._camera = _asset as Camera; this._camera = _asset; //読んできたカメラをアタッチする this._view.camera = this._camera; } if (_asset.assetType == DirectionalLight.assetType){ //マテリアルにLightPicerとShadowLight設定がないと反映されないので注意 //陰影は概ねDirectionalでつくが影マップはバイポリゴンで算出なので綺麗ではない //this._light = event.asset as DirectionalLight; this._light = _asset; this._view.scene.addChild(this._light); } if (_asset.assetType == Mesh.assetType){ //this._mesh = _asset as Mesh; this._mesh = _asset; this._view.scene.addChild(this._mesh); } if (_asset.assetType == Skeleton.assetType){ //this._skeleton = event.asset as Skeleton; this._skeleton = _asset; } if (_asset.assetType == SkeletonAnimator.assetType){ //this._animator = _asset as SkeletonAnimator; this._animator = _asset ; //再生 this._animator.play(this.NORMAL_ANIM); //trace("Read end: "+ loader); } else if (_asset.assetType == SkeletonClipNode.assetType){ //this._node = _asset as SkeletonClipNode; this._node = _asset; if (this._node.name != this.NORMAL_ANIM) { this._node.looping = false; //シーンに永続させないといけない系のイベントの模様遷移時消し忘れ注意 this._node.addEventListener(AnimationStateEvent.PLAYBACK_COMPLETE,(event:AnimationStateEvent) => this.onPlaybackComplete(event)); } } } //カメラの調整 private onEnterFrame(dt:number):void{ this._time += dt; this._view.render(); } //アニメーション切替え private ChengeAnim():void{ //再生(オフセット指定しないと適当なところから再生しようとする。酷い仕様だこれw) this._animator.play(this.ACTION_ANIM,this._stateTransition,0); } private onPlaybackComplete(event:AnimationStateEvent):void{ //自分のステートがアクティブかとうかを一旦みないといけないらしい。無いとうまく動かない。 if (this._animator.activeState != event.animationState) return; this._animator.play(this.NORMAL_ANIM, this._stateTransition,0); } private resize(event:UIEvent = null):void { this._view.y = 0; this._view.x = 0; this._view.width = window.innerWidth; this._view.height = window.innerHeight; } } window.onload = function (){ new Main(); }

エラー文


ProgramWebGL.ts:39 Uncaught Error: ERROR: 0:12: 'va1' : undeclared identifier ERROR: 0:12: 'x' : field selection requires structure or vector on left hand side ERROR: 0:13: 'x' : field selection requires structure or vector on left hand side ERROR: 0:14: 'x' : field selection requires structure or vector on left hand side ERROR: 0:18: 'y' : field selection requires structure or vector on left hand side ERROR: 0:19: 'y' : field selection requires structure or vector on left hand side ERROR: 0:20: 'y' : field selection requires structure or vector on left hand side ERROR: 0:24: 'z' : field selection requires structure or vector on left hand side ERROR: 0:25: 'z' : field selection requires structure or vector on left hand side ERROR: 0:26: 'z' : field selection requires structure or vector on left hand side

っ⌒っ・ω・っ おわり〜



| ここな | 駄文 | comments(0) | trackbacks(0) |


<< 【HP更新】トップページと見えないところを細々更新しました | main | 【awayjs】【toyStudio】【unwrap3D】いろいろやってみたけどだめやった(´・ω・`) >>



Comment











Trackback
url: http://kurobee.kokona.lomo.jp/trackback/1038059

その他情報

管理者ページ / RSS1.0 / Atom0.3 / Powered by ロリポブログ

無料ブログ作成サービス JUGEM
(C) 2017 ブログ JUGEM Some Rights Reserved.