Beispiel #1
0
        public FighterGeometry()
        {
            var nose            = new Nose(0.5f, 0.6f, 26, 0.4f);
            var cockpitFuselage = new CockpitFuselage(nose, 1.2f, 1.2f, 3f);
            var mainFuselage    = new MainFuselage(cockpitFuselage);
            var intake          = new EngineIntake(cockpitFuselage);
            var underside       = new Underside(intake);
            var canopy          = new Canopy(0.65f, 0.5f, 3f, 16);
            var wing            = new Wing(4.5f, 4.5f);
            var rear            = new Rear(mainFuselage, underside);
            var tailFin         = new TailFin();
            var stabilizer      = new Stabilizer();
            var exhaust         = new Exhaust(rear, 0.6f);
            var bottomFin       = new BottomFin();

            var path      = exhaust.FlangeEndXSection;
            var graySlide = new Vec3(1f).Interpolate(new Vec3(0f), path.Vertices.Length);

            path.Vertices.Color(graySlide);
            Paths = EnumerableExt.Enumerate(path);

            Fighter = Composite.Create(Stacking.StackBackward(cockpitFuselage.Fuselage, mainFuselage.Fuselage)
                                       .Concat(EnumerableExt.Enumerate(intake.Intake, intake.Belly, underside.Geometry, canopy.Geometry,
                                                                       wing.Geometry, wing.Geometry.ReflectX(), rear.Geometry, exhaust.Geometry,
                                                                       exhaust.StabilizerFlange, exhaust.StabilizerFlange.ReflectX(),
                                                                       tailFin.Geometry, stabilizer.Geometry, stabilizer.Geometry.ReflectX(),
                                                                       bottomFin.Geometry, bottomFin.Geometry.ReflectX())))
                      .Smoothen(0.85f)
                      .Center();
        }
Beispiel #2
0
 public void Dispose()
 {
     DisposePropertyChangedEvent();
     Top.Dispose();
     Front.Dispose();
     Left.Dispose();
     Rear.Dispose();
     Right.Dispose();
 }
 public Shield()
 {
     Front frontPanel = new Front();
     Rear rearPanel = new Rear();
     Top topPanel = new Top();
     Bottom bottomPanel = new Bottom();
     Right rightPanel = new Right();
     Left leftPanel = new Left();
 }
Beispiel #4
0
        public override void Render(double time)
        {
            lock (_RenderLock)
            {
                GL.PushMatrix();
                {
                    if (_FollowTarget != null)
                    {
                        CalculatePan((float)time);
                    }
                    GL.Translate(Math.Round(_ViewPosition.X), Math.Round(_ViewPosition.Y), Math.Round(_ViewPosition.Z));
                    Background.Render(time);
                    Rear.Render(time);
                    // <edit>
                    GL.PushMatrix();
                    {
                        double dx = 0.5 * ViewWidth;
                        double dy = 0.5 * ViewHeight;
                        GL.Translate(dx, dy, -100.0);

                        GL.Rotate(-60, 1.0, 0.0, 0.0);
                        GL.Rotate(MainTimer.Elapsed.TotalSeconds * 6.0, 0.0, 0.0, 1.0);

                        //double dx1 = 0.5 * FloorR;
                        //double dy1 = 0.5 * FloorR;
                        //GL.Translate(-dx1, -dy1, 0.0);

                        Stage.Render(time);
                    }
                    GL.PopMatrix();
                    // </edit>
                    Tests.Render(time);
                    Front.Render(time);
                    if (Configuration.DrawBlueprints)
                    {
                        WorldBlueprint.Render(time);
                    }
                }
                GL.PopMatrix();
                HUD.Render(time);
                if (Configuration.DrawBlueprints)
                {
                    HUDBlueprint.Render(time);
                }
                if (Configuration.ShowDebugVisuals)
                {
                    HUDDebug.Render(time);
                }
            }
        }
Beispiel #5
0
            public Exhaust(Rear rear, float length)
            {
                var plateSide = Quadrilateral <V> .Trapezoid(0.38f, length, 0f, -0.1f);

                //var nozzlePlate = Composite.Create (plateSide, plateSide.ReflectZ ());
                var nozzlePlate = plateSide.Extrude(0.05f);
                var plateCnt    = 12;
                var plates      = new Geometry <V> [plateCnt];
                var angle       = 0f;

                for (int i = 0; i < plateCnt; i++, angle += MathHelper.TwoPi / plateCnt)
                {
                    plates[i] = nozzlePlate
                                .Translate(0f, length / 2f, 0f)
                                .RotateX(-105f.Radians())
                                .Translate(0f, 0.62f, 0f)
                                .RotateZ(angle);
                }
                var snapToVertex = rear.Geometry.Vertices.Furthest(Dir3D.Back).Furthest(Dir3D.Up).First();
                var exhaust      = Composite.Create(plates);

                Geometry = exhaust
                           .SnapTo(exhaust.Vertices.Furthest(Dir3D.Up).First().position, snapToVertex.position,
                                   Axes.Y | Axes.Z)
                           .Translate(0f, -0.02f, 0.02f)
                           .Color(VertexColor <Vec3> .BlackPlastic);

                FlangeXSection = new Path <P, Vec3> (
                    from n in rear.RearXSection.Vertices
                    where n.position.X < -0.65f && n.position.Y < 0.4f
                    select n)
                                 .Close();
                FlangeEndXSection = new Path <P, Vec3> (
                    from n in FlangeXSection.Vertices
                    select new P()
                {
                    position = new Vec3(n.position.X, n.position.Y.Clamp(-0.2f, 0.1f), n.position.Z)
                });
                var center = FlangeEndXSection.Vertices.Center <P, Vec3> ();

                StabilizerFlange = FlangeXSection.MorphTo(FlangeEndXSection,
                                                          EnumerableExt.Range(0f, -1.25f, -0.25f).Select(s => Mat.Translation <Mat4> (0f, 0f, s) *
                                                                                                         Mat.Scaling <Mat4> (1f, 1f - (s * 0.3f).Pow(2f)).RelativeTo(center)))
                                   .Extrude <V, P> (false, true)
                                   .Color(_color);
            }