Exemple #1
0
 public PlaneView FindStoragePlaneView(StoragePlane sp)
 {
     return(storagePlanes.Find(delegate(PlaneView pv) { return pv.Plane == sp; }));
 }
Exemple #2
0
        public void InitStoragePlaneOnCarrier(StoragePlane plane)
        {
            PlaneView planeView;

            switch (plane.PlaneType)
            {
            case PlaneType.F4U:
                planeView = new F4UPlaneView(plane, framework, sceneMgr.RootSceneNode);
                break;

            case PlaneType.B25:
                planeView = new B25PlaneView(plane, framework, sceneMgr.RootSceneNode);
                break;

            default:
            case PlaneType.P47:
                planeView = new P47PlaneView(plane, framework, sceneMgr.RootSceneNode);
                break;
            }


            storagePlanes.Add(planeView);
            int index = storagePlanes.Count;

            if (EngineConfig.DisplayingMinimap)
            {
                planeView.MinimapItem.Hide();
            }
            SceneNode planeNode = planeView.OuterNode;

            if (index == 1)
            {
                planeNode.Yaw(new Radian(Math.HALF_PI));
                planeNode.Pitch(0.1f);
                planeNode.Roll(0.03f);
                if (plane.PlaneType == PlaneType.B25)
                {
                    planeNode.Yaw(0.03f);
                }
                //p47Node.Translate(new Vector3(5.9f, 0.33f, 0));
                planeNode.Translate(new Vector3(5.9f, -0.23f, 0));
            }
            if (index == 2)
            {
                planeNode.Yaw(new Radian(Math.HALF_PI / 2.0f));
                planeNode.Pitch(0.1f);
                //p47Node.Translate(new Vector3(5.9f, 0.24f, 0));
                planeNode.Translate(new Vector3(5.9f, -0.14f, 0));
                if (plane.PlaneType == PlaneType.B25)
                {
                    planeNode.Translate(new Vector3(0f, 0f, 2.9f));
                }
            }

            if (plane.PlaneType == PlaneType.B25)
            {
                planeNode.SetScale(0.4f, 0.4f, 0.4f);
                planeNode.Translate(new Vector3(1.5f, 0f, -0.5f));
            }
            //   planeView.AnimationMgr.switchToGearUpDown(false);
            //   planeView.AnimationMgr.CurrentAnimation.
            planeView.ResetWheels();

            //Ustawia zlozone skrzydla
            planeView.PlaneEntity.GetAnimationState("storage").Enabled = true;
        }