1. package
  2. {
  3. import away3d.extrusions.Elevation;
  4. import away3d.extrusions.SkinExtrude;
  5.  
  6. public class ApplicationManager extends BaseObject
  7. {
  8. public static const SUBDIVIDE_X:int = 20;
  9. public static const SUBDIVIDE_Y:int = 20;
  10. public static const SCALE_X:int = 5;
  11. public static const SCALE_Y:int = 5;
  12. public static const SCALE_Z:int = 1;
  13.  
  14. protected var mesh:MeshObject = null;
  15. protected var moveableCamera:MoveableCamera = null;
  16.  
  17. public function ApplicationManager()
  18. {
  19. super();
  20. }
  21.  
  22. public function startupApplicationManager(engineManager:EngineManager):ApplicationManager
  23. {
  24. super.startupBaseObject(engineManager);
  25.  
  26. var elevate:Elevation = new Elevation();
  27. var extrude:SkinExtrude = new SkinExtrude(
  28. elevate.generate(engineManager.MyResourceManager.HeightmapTex, "r", SUBDIVIDE_X, SUBDIVIDE_Y, SCALE_X, SCALE_Y, SCALE_Z),
  29. {
  30. material:engineManager.MyResourceManager.TerrainTex,
  31. recenter:true,
  32. closepath:false,
  33. coverall:true,
  34. subdivision:1,
  35. bothsides:false,
  36. flip:false
  37. }
  38. );
  39. extrude.rotationX = 90;
  40. extrude.x = extrude.z = 0;
  41. extrude.y = 0;
  42.  
  43. mesh = new MeshObject().startupObject3DMeshObject(engineManager, extrude);
  44.  
  45. moveableCamera = new MoveableCamera().startupMoveableCamera(engineManager);
  46.  
  47. return this;
  48. }
  49.  
  50. public override function shutdown():void
  51. {
  52. super.shutdown();
  53. }
  54.  
  55. public override function enterFrame(dt:Number):void
  56. {
  57.  
  58. }
  59.  
  60. }
  61. }