コード例 #1
0
        public ShipScene(GameState gameState) : base(gameState)
        {
            this.backgroundColor = Color.DarkOrange;

            ship          = new Ship();
            ship.Scale    = new TGCVector3(8, 12, 16);
            ship.Position = new TGCVector3(200, 700, -300);

            //var shipRigidBody = new BoxFactory().Create(shipMesh.BoundingBox);
            //AquaticPhysics.Instance.Add(shipRigidBody);
            lifeBelt          = new Things.LifeBelt();
            lifeBelt.Position = new TGCVector3(285, 1000, 250);
            lifeBelt.RotateY(-(float)Math.PI * 0.1f);

            seat          = new Things.Seat();
            seat.Position = new TGCVector3(550, 710, 1440);
            seat.RotateY((float)Math.PI / 2);
            seat.Scale = new TGCVector3(2f, 2f, 2f);

            crafter = new Things.Crafter(OpenCrafter);
            crafter.relativeScales = new List <float>(new float[3] {
                1, .6f, .38f
            });
            crafter.relativePositions = new List <TGCVector3>(new TGCVector3[3] {
                new TGCVector3(0, 0, 0),
                new TGCVector3(42, 49, 30),
                new TGCVector3(43, 177, 31)
            });
            crafter.Scale    = new TGCVector3(.5f, .5f, .5f);
            crafter.Position = new TGCVector3(560, 950, -250);

            hatch = new Things.Hatch(() => {
                this.GameState.character.StopUsingShipAmbientShader();
                onGoToWaterCallback(this.GameState);
            });
            hatch.Position = new TGCVector3(600, 720, 450);

            SetCamera();
            AquaticPhysics.Instance.Add(Camera.RigidBody);

            selectableThings.Add(crafter);
            selectableThings.Add(hatch);

            inventoryScene = new InventoryScene();

            RegisterSubscene(inventoryScene);
            initCraftingScene();

            TurnExploreCommandsOn();

            pressed[Key.P] = () =>
            {
                onPauseCallback();
            };

            GameState.character.UseShipAmbientShader();
        }
コード例 #2
0
        public void Open(Character character, Camera shipCamera, Things.Crafter crafter)
        {
            this.physicalCrafter = crafter;
            this.Character       = character;
            this.ShipCamera      = shipCamera;
            this.initialPosition = shipCamera.Position;
            this.initialLookAt   = shipCamera.LookAt;
            this.targetPosition  = crafter.Center + new TGCVector3(0, 0, 250);
            this.targetLookAt    = crafter.Center;

            ShipCamera.UseManually();

            ShipCamera.SetCamera(ShipCamera.Position, crafter.Center);

            updater = BeginningAnimation;
        }