Permalink
Browse files

major update

  • Loading branch information...
keyemkey committed Mar 5, 2013
1 parent 39f0c82 commit 5292313906000bc94655f54cbb8c9a797e586de1
Showing with 95,239 additions and 858 deletions.
  1. BIN awaybuilder-core/src/assets/disclosureClosedIcon.png
  2. BIN awaybuilder-core/src/assets/disclosureOpenIcon.png
  3. +195 −142 awaybuilder-core/src/awaybuilder/controller/ReadDocumentDataCommand.as
  4. +2 −2 awaybuilder-core/src/awaybuilder/events/HelpEvent.as
  5. +22 −0 awaybuilder-core/src/awaybuilder/events/SceneEvent.as
  6. +22 −0 awaybuilder-core/src/awaybuilder/model/DocumentModel.as
  7. +1 −1 awaybuilder-core/src/awaybuilder/model/EditorModel.as
  8. +8 −2 awaybuilder-core/src/awaybuilder/model/IDocumentModel.as
  9. +1 −1 awaybuilder-core/src/awaybuilder/model/{ → vo}/ObjectPickerCategoryItem.as
  10. +2 −3 awaybuilder-core/src/awaybuilder/model/{ → vo}/SampleItem.as
  11. +4 −1 awaybuilder-core/src/awaybuilder/model/vo/ScenegraphTreeVO.as
  12. +15 −6 awaybuilder-core/src/awaybuilder/scene/controllers/Scene3DManager.as
  13. +0 −52 awaybuilder-core/src/awaybuilder/utils/ZoomUtil.as
  14. +18 −0 awaybuilder-core/src/awaybuilder/utils/logging/ArrayUtil.as
  15. +1 −28 awaybuilder-core/src/awaybuilder/{ → utils}/printing/FlexPrintJob.as
  16. +0 −16 awaybuilder-core/src/awaybuilder/utils/sliderValueToZoomValue.as
  17. +0 −11 awaybuilder-core/src/awaybuilder/utils/zoomValueToSliderValue.as
  18. +86 −0 awaybuilder-core/src/awaybuilder/view/components/CollapsiblePanel.as
  19. +52 −24 awaybuilder-core/src/awaybuilder/view/components/CoreEditor.mxml
  20. +26 −28 awaybuilder-core/src/awaybuilder/view/components/EditStatusBar.mxml
  21. +8 −7 awaybuilder-core/src/awaybuilder/view/components/EditToolBar.mxml
  22. +0 −101 awaybuilder-core/src/awaybuilder/view/components/EditorGrid.as
  23. +20 −0 awaybuilder-core/src/awaybuilder/view/components/SwitchButton.as
  24. +18 −0 awaybuilder-core/src/awaybuilder/view/components/events/CoreEditorEvent.as
  25. +0 −13 awaybuilder-core/src/awaybuilder/view/components/propertyEditors/IObjectPropertyEditor.as
  26. +73 −0 awaybuilder-core/src/awaybuilder/view/components/propertyEditors/MeshPropertyEditor.mxml
  27. +0 −90 awaybuilder-core/src/awaybuilder/view/components/propertyEditors/ShapePropertyEditor.mxml
  28. +26 −0 awaybuilder-core/src/awaybuilder/view/components/tree/Tree.as
  29. +22 −4 awaybuilder-core/src/awaybuilder/view/components/tree/TreeItemRenderer.mxml
  30. +128 −7 awaybuilder-core/src/awaybuilder/view/mediators/CoreEditorMediator.as
  31. +6 −3 awaybuilder-core/src/awaybuilder/view/mediators/EditStatusBarMediator.as
  32. +1 −1 awaybuilder-core/src/awaybuilder/view/mediators/SamplePickerMediator.as
  33. +3 −4 ...re/src/awaybuilder/view/skins/{ObjectPickerCollapseButtonSkin.mxml → CollapseLeftButtonSkin.mxml}
  34. +155 −0 awaybuilder-core/src/awaybuilder/view/skins/CollapseRightButtonSkin.mxml
  35. +119 −0 awaybuilder-core/src/awaybuilder/view/skins/CollapsiblePanelSkin.mxml
  36. +117 −0 awaybuilder-core/src/awaybuilder/view/skins/CollapsibleRightPanelSkin.mxml
  37. +0 −160 awaybuilder-core/src/awaybuilder/view/skins/ObjectPickerCategoryCollapseButtonSkin.mxml
  38. +126 −0 awaybuilder-core/src/awaybuilder/view/skins/PropertyFormItemSkin.mxml
  39. +65 −0 awaybuilder-core/src/awaybuilder/view/skins/PropertyFormSkin.mxml
  40. +0 −33 awaybuilder-core/src/awaybuilder/view/skins/TreeSkin.mxml
  41. 0 awaybuilder-core/src/awaybuilder/view/skins/{ → fxg}/CollapseArrowDownSkin.fxg
  42. 0 awaybuilder-core/src/awaybuilder/view/skins/{ → fxg}/CollapseArrowLeftSkin.fxg
  43. 0 awaybuilder-core/src/awaybuilder/view/skins/{ → fxg}/CollapseArrowRightSkin.fxg
  44. 0 awaybuilder-core/src/awaybuilder/view/skins/{ → fxg}/CollapseArrowUpSkin.fxg
  45. +8 −1 awaybuilder-core/src/defaults.css
  46. +2 −3 awaybuilder-desktop/src/AwayBuilderApplication.mxml
  47. +1 −1 awaybuilder-desktop/src/awaybuilder/desktop/DesktopAppContext.as
  48. +39 −42 awaybuilder-desktop/src/awaybuilder/desktop/services/FileSystemDocumentService.as
  49. +15 −14 awaybuilder-desktop/src/awaybuilder/desktop/view/mediators/DesktopAppMediator.as
  50. +1 −1 awaybuilder-desktop/src/awaybuilder/desktop/view/mediators/WelcomeWindowMediator.as
  51. +1 −11 awaybuilder-desktop/src/awaybuilder/desktop/view/skins/DesktopAppSkin.mxml
  52. +1 −45 awaybuilder-desktop/src/awaybuilder/desktop/view/skins/WindowSkin.mxml
  53. BIN exampleScenes/3ds/soldier_ant.3ds
  54. BIN exampleScenes/3ds/texture.jpg
  55. BIN {awaybuilder-core/src/assets → exampleScenes/awd}/bear/PolarBear.awd
  56. BIN exampleScenes/awd/bear/polarbear_diffuse.jpg
  57. BIN exampleScenes/awd/bear/polarbear_normals.jpg
  58. BIN exampleScenes/awd/bear/polarbear_specular.jpg
  59. BIN exampleScenes/awd/level.awd
  60. BIN exampleScenes/awd/onkba/floor_diffuse.jpg
  61. BIN exampleScenes/awd/onkba/floor_normals.jpg
  62. BIN exampleScenes/awd/onkba/floor_specular.jpg
  63. BIN exampleScenes/awd/onkba/gun_diffuse.jpg
  64. BIN exampleScenes/awd/onkba/gun_lightmap.jpg
  65. BIN exampleScenes/awd/onkba/gun_normals.jpg
  66. BIN exampleScenes/awd/onkba/onkba.awd
  67. BIN exampleScenes/awd/onkba/onkba_diffuse.png
  68. BIN exampleScenes/awd/onkba/onkba_lightmap.jpg
  69. BIN exampleScenes/awd/onkba/onkba_normals.jpg
  70. BIN exampleScenes/awd/sponza/arch_ddn.jpg
  71. BIN exampleScenes/awd/sponza/arch_diff.jpg
  72. BIN exampleScenes/awd/sponza/arch_spec.jpg
  73. BIN exampleScenes/awd/sponza/atf/arch_ddn.atf
  74. BIN exampleScenes/awd/sponza/atf/arch_diff.atf
  75. BIN exampleScenes/awd/sponza/atf/arch_spec.atf
  76. BIN exampleScenes/awd/sponza/atf/background.atf
  77. BIN exampleScenes/awd/sponza/atf/background_ddn.atf
  78. BIN exampleScenes/awd/sponza/atf/bricks_a_ddn.atf
  79. BIN exampleScenes/awd/sponza/atf/bricks_a_diff.atf
  80. BIN exampleScenes/awd/sponza/atf/bricks_a_spec.atf
  81. BIN exampleScenes/awd/sponza/atf/ceiling_a_diff.atf
  82. BIN exampleScenes/awd/sponza/atf/ceiling_a_spec.atf
  83. BIN exampleScenes/awd/sponza/atf/chain_texture.atf
  84. BIN exampleScenes/awd/sponza/atf/chain_texture_ddn.atf
  85. BIN exampleScenes/awd/sponza/atf/column_a_ddn.atf
  86. BIN exampleScenes/awd/sponza/atf/column_a_diff.atf
  87. BIN exampleScenes/awd/sponza/atf/column_a_spec.atf
  88. BIN exampleScenes/awd/sponza/atf/column_b_ddn.atf
  89. BIN exampleScenes/awd/sponza/atf/column_b_diff.atf
  90. BIN exampleScenes/awd/sponza/atf/column_b_spec.atf
  91. BIN exampleScenes/awd/sponza/atf/column_c_ddn.atf
  92. BIN exampleScenes/awd/sponza/atf/column_c_diff.atf
  93. BIN exampleScenes/awd/sponza/atf/column_c_spec.atf
  94. BIN exampleScenes/awd/sponza/atf/curtain_blue_diff.atf
  95. BIN exampleScenes/awd/sponza/atf/curtain_diff.atf
  96. BIN exampleScenes/awd/sponza/atf/curtain_green_diff.atf
  97. BIN exampleScenes/awd/sponza/atf/curtain_spec.atf
  98. BIN exampleScenes/awd/sponza/atf/details_diff.atf
  99. BIN exampleScenes/awd/sponza/atf/details_spec.atf
  100. BIN exampleScenes/awd/sponza/atf/fabric_blue_diff.atf
  101. BIN exampleScenes/awd/sponza/atf/fabric_diff.atf
  102. BIN exampleScenes/awd/sponza/atf/fabric_green_diff.atf
  103. BIN exampleScenes/awd/sponza/atf/fabric_spec.atf
  104. BIN exampleScenes/awd/sponza/atf/flagpole_diff.atf
  105. BIN exampleScenes/awd/sponza/atf/flagpole_spec.atf
  106. BIN exampleScenes/awd/sponza/atf/floor_a_diff.atf
  107. BIN exampleScenes/awd/sponza/atf/floor_a_spec.atf
  108. BIN exampleScenes/awd/sponza/atf/gi_flag.atf
  109. BIN exampleScenes/awd/sponza/atf/hourglass_cubemap2.atf
  110. BIN exampleScenes/awd/sponza/atf/lion.atf
  111. BIN exampleScenes/awd/sponza/atf/lion2_ddn.atf
  112. BIN exampleScenes/awd/sponza/atf/r2d2-texture.atf
  113. BIN exampleScenes/awd/sponza/atf/roof_diff.atf
  114. BIN exampleScenes/awd/sponza/atf/thorn_ddn.atf
  115. BIN exampleScenes/awd/sponza/atf/thorn_diff.atf
  116. BIN exampleScenes/awd/sponza/atf/thorn_spec.atf
  117. BIN exampleScenes/awd/sponza/atf/vase_ddn.atf
  118. BIN exampleScenes/awd/sponza/atf/vase_dif.atf
  119. BIN exampleScenes/awd/sponza/atf/vase_hanging.atf
  120. BIN exampleScenes/awd/sponza/atf/vase_plant.atf
  121. BIN exampleScenes/awd/sponza/atf/vase_plant_spec.atf
  122. BIN exampleScenes/awd/sponza/atf/vase_round.atf
  123. BIN exampleScenes/awd/sponza/atf/vase_round_ddn.atf
  124. BIN exampleScenes/awd/sponza/atf/vase_round_spec.atf
  125. BIN exampleScenes/awd/sponza/background.jpg
  126. BIN exampleScenes/awd/sponza/background_ddn.jpg
  127. BIN exampleScenes/awd/sponza/bricks_a_ddn.jpg
  128. BIN exampleScenes/awd/sponza/bricks_a_diff.jpg
  129. BIN exampleScenes/awd/sponza/bricks_a_spec.jpg
  130. BIN exampleScenes/awd/sponza/ceiling_a_diff.jpg
  131. BIN exampleScenes/awd/sponza/ceiling_a_spec.jpg
  132. BIN exampleScenes/awd/sponza/chain_texture.png
  133. BIN exampleScenes/awd/sponza/chain_texture_ddn.jpg
  134. BIN exampleScenes/awd/sponza/column_a_ddn.jpg
  135. BIN exampleScenes/awd/sponza/column_a_diff.jpg
  136. BIN exampleScenes/awd/sponza/column_a_spec.jpg
  137. BIN exampleScenes/awd/sponza/column_b_ddn.jpg
  138. BIN exampleScenes/awd/sponza/column_b_diff.jpg
  139. BIN exampleScenes/awd/sponza/column_b_spec.jpg
  140. BIN exampleScenes/awd/sponza/column_c_ddn.jpg
  141. BIN exampleScenes/awd/sponza/column_c_diff.jpg
  142. BIN exampleScenes/awd/sponza/column_c_spec.jpg
  143. BIN exampleScenes/awd/sponza/curtain_blue_diff.jpg
  144. BIN exampleScenes/awd/sponza/curtain_diff.jpg
  145. BIN exampleScenes/awd/sponza/curtain_green_diff.jpg
  146. BIN exampleScenes/awd/sponza/curtain_spec.jpg
  147. BIN exampleScenes/awd/sponza/details_diff.jpg
  148. BIN exampleScenes/awd/sponza/details_spec.jpg
  149. BIN exampleScenes/awd/sponza/fabric_blue_diff.jpg
  150. BIN exampleScenes/awd/sponza/fabric_diff.jpg
  151. BIN exampleScenes/awd/sponza/fabric_green_diff.jpg
  152. BIN exampleScenes/awd/sponza/fabric_spec.jpg
  153. BIN exampleScenes/awd/sponza/flagpole_diff.jpg
  154. BIN exampleScenes/awd/sponza/flagpole_spec.jpg
  155. BIN exampleScenes/awd/sponza/floor_a_diff.jpg
  156. BIN exampleScenes/awd/sponza/floor_a_spec.jpg
  157. BIN exampleScenes/awd/sponza/gi_flag.jpg
  158. BIN exampleScenes/awd/sponza/lion.jpg
  159. BIN exampleScenes/awd/sponza/lion2_ddn.jpg
  160. BIN exampleScenes/awd/sponza/r2d2 texture.jpg
  161. BIN exampleScenes/awd/sponza/roof_diff.jpg
  162. BIN exampleScenes/awd/sponza/sponza.awd
  163. BIN exampleScenes/awd/sponza/thorn_ddn.jpg
  164. BIN exampleScenes/awd/sponza/thorn_diff.jpg
  165. BIN exampleScenes/awd/sponza/thorn_diff.png
  166. BIN exampleScenes/awd/sponza/thorn_spec.jpg
  167. BIN exampleScenes/awd/sponza/vase_ddn.jpg
  168. BIN exampleScenes/awd/sponza/vase_dif.jpg
  169. BIN exampleScenes/awd/sponza/vase_hanging.jpg
  170. BIN exampleScenes/awd/sponza/vase_plant.png
  171. BIN exampleScenes/awd/sponza/vase_plant_spec.jpg
  172. BIN exampleScenes/awd/sponza/vase_round.jpg
  173. BIN exampleScenes/awd/sponza/vase_round_ddn.jpg
  174. BIN exampleScenes/awd/sponza/vase_round_spec.jpg
  175. BIN exampleScenes/md2/ogre/igdosh.jpg
  176. BIN exampleScenes/md2/ogre/ogre.md2
  177. BIN exampleScenes/md2/ogre/ogre_normals.png
  178. BIN exampleScenes/md2/ogre/ogre_specular.jpg
  179. +2,556 −0 exampleScenes/md5/attack2.md5anim
  180. +3,020 −0 exampleScenes/md5/attack3.md5anim
  181. +956 −0 exampleScenes/md5/chest.md5anim
  182. +748 −0 exampleScenes/md5/headpain.md5anim
  183. +8,033 −0 exampleScenes/md5/hellknight.md5mesh
  184. BIN exampleScenes/md5/hellknight_diffuse.jpg
  185. BIN exampleScenes/md5/hellknight_normals.png
  186. BIN exampleScenes/md5/hellknight_specular.png
  187. +6,836 −0 exampleScenes/md5/idle2.md5anim
  188. +360 −0 exampleScenes/md5/ik_pose.md5anim
  189. +244 −0 exampleScenes/md5/initial.md5anim
  190. +2,459 −0 exampleScenes/md5/leftslash.md5anim
  191. +626 −0 exampleScenes/md5/pain1.md5anim
  192. +748 −0 exampleScenes/md5/pain_luparm.md5anim
  193. +828 −0 exampleScenes/md5/pain_ruparm.md5anim
  194. +4,721 −0 exampleScenes/md5/range_attack2.md5anim
  195. +3,251 −0 exampleScenes/md5/roar1.md5anim
  196. +6,836 −0 exampleScenes/md5/stand.md5anim
  197. +2,036 −0 exampleScenes/md5/turret_attack.md5anim
  198. +2,604 −0 exampleScenes/md5/walk7.md5anim
  199. +2,641 −0 exampleScenes/md5/walk7_left.md5anim
  200. +44,326 −0 exampleScenes/obj/head.obj
  201. BIN exampleScenes/obj/head_diffuse.jpg
  202. BIN exampleScenes/obj/head_normals.jpg
  203. BIN exampleScenes/obj/head_specular.jpg
Binary file not shown.
Binary file not shown.
@@ -3,14 +3,22 @@ package awaybuilder.controller
import flash.net.URLRequest;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import away3d.animators.AnimationSetBase;
import away3d.animators.AnimationStateBase;
import away3d.animators.nodes.AnimationNodeBase;
import away3d.containers.ObjectContainer3D;
import away3d.core.base.Geometry;
import away3d.core.base.SubGeometry;
import away3d.entities.Mesh;
import away3d.events.AssetEvent;
import away3d.events.LoaderEvent;
import away3d.library.AssetLibrary;
import away3d.library.assets.AssetType;
import away3d.loaders.parsers.Parsers;
import away3d.materials.TextureMaterial;
import away3d.utils.Cast;
import away3d.textures.BitmapTexture;
import awaybuilder.events.ReadDocumentDataEvent;
import awaybuilder.model.IDocumentModel;
@@ -23,9 +31,7 @@ package awaybuilder.controller
public class ReadDocumentDataCommand extends Command
{
private static const FUTURE_VERSION_ERROR:String = "Unable to open file. This document appears to have been created in a newer version of awaybuilder.";
private static const INVALID_FORMAT_ERROR:String = "Unable to open file. Cannot parse data.";
[Inject]
public var document:IDocumentModel;
@@ -38,159 +44,206 @@ package awaybuilder.controller
[Inject]
public var event:ReadDocumentDataEvent;
private var _scenegraph:ArrayCollection;
private var _sceneObjects:ArrayCollection;
private var _materialObjects:ArrayCollection;
private var _animationObjects:ArrayCollection;
private var _geometryObjects:ArrayCollection;
private var _lightObjects:ArrayCollection;
override public function execute():void
{
// scenegraph = new ArrayCollection();
_scenegraph = new ArrayCollection();
_sceneObjects = new ArrayCollection();
_materialObjects = new ArrayCollection();
_animationObjects = new ArrayCollection();
_geometryObjects = new ArrayCollection();
_lightObjects = new ArrayCollection();
document.name = event.name;
Parsers.enableAllBundled();
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete);
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, assetCompleteHandler);
AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETE, resourceCompleteHandler);
AssetLibrary.addEventListener(LoaderEvent.LOAD_ERROR, loadErrorHandler);
AssetLibrary.load(new URLRequest(event.path));
}
[Embed(source="assets/bear/polarbear_diffuse.jpg")]
private var BearDiffuse:Class;
[Embed(source="assets/bear/polarbear_normals.jpg")]
private var BearNormal:Class;
[Embed(source="assets/bear/polarbear_specular.jpg")]
private var BearSpecular:Class;
// private var tm:Number;
private var bear:Mesh;
private function loadErrorHandler( event:LoaderEvent ):void
{
Alert.show( event.message, "Resource not loaded" );
}
private function onAssetComplete(e:AssetEvent):void
private function resourceCompleteHandler( event:LoaderEvent ):void
{
if( _animationObjects.length )
{
var animationItem:ScenegraphTreeVO = new ScenegraphTreeVO( "Animation", null );
animationItem.children = _animationObjects;
_scenegraph.addItemAt( animationItem, 0 );
}
if( _geometryObjects.length )
{
var geometryItem:ScenegraphTreeVO = new ScenegraphTreeVO( "Geometry", null );
geometryItem.children = _geometryObjects;
_scenegraph.addItemAt( geometryItem, 0 );
}
if( _sceneObjects.length )
{
var sceneItem:ScenegraphTreeVO = new ScenegraphTreeVO( "Scene", null );
sceneItem.children = _sceneObjects;
_scenegraph.addItemAt( sceneItem, 0 );
}
var lightsItem:ScenegraphTreeVO = new ScenegraphTreeVO( "Lights", null );
_scenegraph.addItem( lightsItem );
document.scenegraph = _scenegraph;
document.sceneObjects = _sceneObjects;
// trace( _mesh.parent );
// if( _mesh.material ) {
// Scene3DManager.addMesh( _mesh );
// }
// else {
// Alert.show( "Mesh was not added to scene, material is undefined", "Warning" );
// }
}
private function assetCompleteHandler( event:AssetEvent ):void
{
var scenegraph = new ArrayCollection();
var item:ScenegraphTreeVO = new ScenegraphTreeVO( "Mesh" );
scenegraph.addItem( item );
item = new ScenegraphTreeVO( "ObjectContainer3D" );
item.children = new ArrayCollection();
item.children.addItem( new ScenegraphTreeVO( "subitem1" ) );
item.children.addItem( new ScenegraphTreeVO( "subitem2" ) );
item.children.addItem( new ScenegraphTreeVO( "subitem3" ) );
item.children.addItem( new ScenegraphTreeVO( "subitem4" ) );
item.children.addItem( new ScenegraphTreeVO( "subitem42" ) );
scenegraph.addItem( item );
item = new ScenegraphTreeVO( "Material" );
scenegraph.addItem( item );
item = new ScenegraphTreeVO( "Geometry" );
scenegraph.addItem( item );
item = new ScenegraphTreeVO( "Animator" );
scenegraph.addItem( item );
item = new ScenegraphTreeVO( "AnimationSet" );
scenegraph.addItem( item );
item = new ScenegraphTreeVO( "AnimationNode" );
scenegraph.addItem( item );
item = new ScenegraphTreeVO( "Texture" );
scenegraph.addItem( item );
item = new ScenegraphTreeVO( "LightPicker" );
scenegraph.addItem( item );
item = new ScenegraphTreeVO( "Light" );
scenegraph.addItem( item );
item = new ScenegraphTreeVO( "ShadowMapper" );
scenegraph.addItem( item );
item = new ScenegraphTreeVO( "ShadowMethod" );
scenegraph.addItem( item );
item = new ScenegraphTreeVO( "EffectsMethod" );
scenegraph.addItem( item );
item = new ScenegraphTreeVO( "Camera" );
scenegraph.addItem( item );
document.scenegraph = scenegraph;
// -- ObjectContainer3D
// | |
// | -- ObjectContainer3D...
// | -- Camera §
// | -- Light §
// | -- Mesh...
// | -- Mesh...
// | -- Mesh
// | |
// | -- Material §
// | -- Geometry §
// | -- Animator §
// | -- SubMesh...
// | -- SubMesh...
// | -- SubMesh
// | |
// | -- Material §
// | -- SubGeometry §
// |
// -- Material
// | |
// | -- LightPicker §
// | -- DiffuseTexture §
// | -- DiffuseMethod
// | -- SpecularTexture §
// | -- SpecularMethod
// | -- NormalTexture §
// | -- NormalMethod
// | -- ShadowMethod §
// | -- EffectsMethod §
// | -- EffectsMethod §
// | -- EffectsMethod §...
// |
// -- Geometry
// | |
// | -- SubGeometry
// | -- SubGeometry
// | -- SubGeometry...
// |
// -- Animator
// | |
// | -- AnimationSet §
// |
// -- AnimationSet
// | |
// | -- AnimationNode
// | -- AnimationNode
// | -- AnimationNode...
// |
// -- AnimationNode
// |
// -- Texture
// |
// -- LightPicker
// | |
// | -- Light §
// |
// -- Light
// | |
// | -- ShadowMapper §
// |
// -- ShadowMapper
// |
// -- ShadowMethod
// |
// -- EffectsMethod
// |
// -- Camera
trace( event.asset.assetType );
if (e.asset.assetType == AssetType.MESH)
{
bear = e.asset as Mesh;
var meshMaterial:TextureMaterial = new TextureMaterial(Cast.bitmapTexture(BearDiffuse));
//bearMaterial.shadowMethod = filteredShadowMapMethod;
meshMaterial.normalMap = Cast.bitmapTexture(BearNormal);
meshMaterial.specularMap = Cast.bitmapTexture(BearSpecular);
meshMaterial.gloss = 50;
meshMaterial.specular = 0.5;
meshMaterial.ambientColor = 0xAAAAAA;
meshMaterial.ambient = 0.5;
//var meshMaterial:ColorMaterial = new ColorMaterial();
// var _light:DirectionalLight = new DirectionalLight(-1, -1, 1);
//// _direction = new Vector3D(-1, -1, 1);
// var _lightPicker:StaticLightPicker = new StaticLightPicker([_light]);
// Scene3DManager.addLight( _light );
//
var item:ScenegraphTreeVO;
if (event.asset.assetType == AssetType.MESH)
{
var mesh:Mesh = event.asset as Mesh;
item = new ScenegraphTreeVO( mesh.name , mesh );
_sceneObjects.addItem( item );
bear.material = meshMaterial;
bear.castsShadows = true;
bear.rotationY = 45;
if( mesh.material ) {
Scene3DManager.addMesh( mesh );
}
else {
Alert.show( "Mesh was not added to scene, material is undefined", "Warning" );
}
Scene3DManager.addMesh(bear);
Scene3DManager.addLightToMesh(bear, "SunLight");
// mesh.castsShadows = true;
}
else if (event.asset.assetType == AssetType.CONTAINER)
{
var c:ObjectContainer3D = event.asset as ObjectContainer3D;
item = new ScenegraphTreeVO( "Container (" + c.name +")", c );
item.children = new ArrayCollection();
_sceneObjects.addItem( item );
}
else if (event.asset.assetType == AssetType.MATERIAL)
{
var material:TextureMaterial = event.asset as TextureMaterial;
item = new ScenegraphTreeVO( "Material (" + material.name +")", material );
item.children = new ArrayCollection();
if( material.lightPicker ) {
item.children.addItem( new ScenegraphTreeVO( "LightPicker (" + material.lightPicker.name +")", material.lightPicker ) );
}
if( material.diffuseMethod ) {
item.children.addItem( new ScenegraphTreeVO( "DiffuseMethod", material.diffuseMethod ) );
}
if( material.normalMethod ) {
item.children.addItem( new ScenegraphTreeVO( "NormalMethod", material.normalMethod ) );
}
/*item.children.addItem( new ScenegraphTreeVO( "Material (" + material.name +")" ) );
item.children.addItem( new ScenegraphTreeVO( "Material (" + material.name +")" ) );
item.children.addItem( new ScenegraphTreeVO( "Material (" + material.name +")" ) );
item.children.addItem( new ScenegraphTreeVO( "Material (" + material.name +")" ) );*/
_scenegraph.addItem( item );
}
else if (event.asset.assetType == AssetType.TEXTURE)
{
var texture:BitmapTexture = event.asset as BitmapTexture;
item = new ScenegraphTreeVO( "Texture (" + texture.originalName.split("/").pop() +")", texture );
_scenegraph.addItem( item );
}
else if (event.asset.assetType == AssetType.GEOMETRY)
{
var geometry:Geometry = event.asset as Geometry;
item = new ScenegraphTreeVO( geometry.name ,geometry );
_geometryObjects.addItem( item );
item.children = new ArrayCollection();
for each( var g:SubGeometry in geometry.subGeometries ) {
item.children.addItem( new ScenegraphTreeVO( "SubGeometry",g ) );
}
}
else if (event.asset.assetType == AssetType.ANIMATION_SET)
{
var animationSet:AnimationSetBase = event.asset as AnimationSetBase;
item = new ScenegraphTreeVO( "Animation Set (" + animationSet.name +")",animationSet );
_animationObjects.addItem( item );
}
else if (event.asset.assetType == AssetType.ANIMATION_STATE)
{
var animationState:AnimationStateBase = event.asset as AnimationStateBase;
item = new ScenegraphTreeVO( "Animation State (" + animationState.name +")",animationState );
_animationObjects.addItem( item );
}
else if (event.asset.assetType == AssetType.ANIMATION_NODE)
{
var animationNode:AnimationNodeBase = event.asset as AnimationNodeBase;
item = new ScenegraphTreeVO( "Animation Node (" + animationNode.name +")",animationNode );
_animationObjects.addItem( item );
}
// switch( event.asset.assetType ) {
// case AssetType.MESH:
// var mesh:Mesh = event.asset as Mesh;
//// mesh.castsShadows = true;
// Scene3DManager.addMesh(mesh);
// break;
// case AssetType.MATERIAL:
// var material:TextureMaterial = event.asset as TextureMaterial;
//// material.shadowMethod = new FilteredShadowMapMethod(_light);
//// material.lightPicker = _lightPicker;
// material.gloss = 30;
// material.specular = 1;
// material.ambientColor = 0x303040;
// material.ambient = 1;
//// Scene3DManager.a
// break;
// }
// if (e.asset.assetType == AssetType.MESH)
// {
// bear = e.asset as Mesh;
//
// var meshMaterial:TextureMaterial = new TextureMaterial(Cast.bitmapTexture(BearDiffuse));
// //bearMaterial.shadowMethod = filteredShadowMapMethod;
// meshMaterial.normalMap = Cast.bitmapTexture(BearNormal);
// meshMaterial.specularMap = Cast.bitmapTexture(BearSpecular);
// meshMaterial.gloss = 50;
// meshMaterial.specular = 0.5;
// meshMaterial.ambientColor = 0xAAAAAA;
// meshMaterial.ambient = 0.5;
//
// //var meshMaterial:ColorMaterial = new ColorMaterial();
//
// bear.material = meshMaterial;
// bear.castsShadows = true;
// bear.rotationY = 45;
//
// Scene3DManager.addMesh(bear);
// Scene3DManager.addLightToMesh(bear, "SunLight");
//
// }
}
}
@@ -4,8 +4,8 @@ package awaybuilder.events
public class HelpEvent extends Event
{
public static const SHOW_SAMPLES:String = "showSamples";
public static const HIDE_SAMPLES:String = "hideSamples";
public static const SHOW_WELCOME:String = "showWelcome";
public static const HIDE_WELCOME:String = "hideWelcome";
public function HelpEvent(type:String)
{
Oops, something went wrong.

0 comments on commit 5292313

Please sign in to comment.