- /**
- * ...
- * @author Matthew Casperson
- */
-
- package ;
-
- import sandy.core.scenegraph.Shape3D;
- import sandy.materials.Appearance;
- import sandy.materials.Material;
- import sandy.materials.BitmapMaterial;
- import sandy.primitive.SkyBox;
-
- class SkyBoxObject extends NodeObject
- {
- public function new(engineManager:EngineManager)
- {
- var model:SkyBox = new SkyBox(null, 200, 10, 10);
-
- model.top.appearance = new Appearance(new BitmapMaterial(engineManager.resourceManager.skyboxUpBitmapData));
- model.bottom.appearance = new Appearance(new BitmapMaterial(engineManager.resourceManager.skyboxDownBitmapData));
- model.back.appearance = new Appearance(new BitmapMaterial(engineManager.resourceManager.skyboxBackBitmapData));
- model.front.appearance = new Appearance(new BitmapMaterial(engineManager.resourceManager.skyboxFrontBitmapData));
- model.left.appearance = new Appearance(new BitmapMaterial(engineManager.resourceManager.skyboxLeftBitmapData));
- model.right.appearance = new Appearance(new BitmapMaterial(engineManager.resourceManager.skyboxRightBitmapData));
-
- model.top.scaleX = 1.01;
- model.top.scaleZ = 1.01;
- model.bottom.scaleX = 1.01;
- model.bottom.scaleZ = 1.01;
- model.back.scaleX = 1.01;
- model.back.scaleY = 1.01;
- model.front.scaleX = 1.01;
- model.front.scaleY = 1.01;
- model.left.scaleY = 1.01;
- model.left.scaleZ = 1.01;
- model.right.scaleY = 1.01;
- model.right.scaleZ = 1.01;
-
- model.top.enableClipping = true;
- model.bottom.enableClipping = true;
- model.back.enableClipping = true;
- model.front.enableClipping = true;
- model.left.enableClipping = true;
- model.right.enableClipping = true;
-
- super(engineManager, model);
- }
-
- override public function enterFrame(dt:Float) : Void
- {
- this.node.x = this.engineManager.camera.x;
- this.node.y = this.engineManager.camera.y;
- this.node.z = this.engineManager.camera.z;
-
- engineManager.camera.rotateY += 10 * dt;
- engineManager.camera.rotateX += 15 * dt;
- }
-
- }