コード例 #1
0
ファイル: Helicopter.cs プロジェクト: myjere/helisharp
        protected Helicopter()
        {
            Wind = Vector <double> .Build.Zero3();

            Gravity = new StaticForce(Vector <double> .Build.Dense3(0, 0, Mass * 9.81));
            SetModel("Gravity", Gravity);
            Atmosphere = new Atmosphere();
        }
コード例 #2
0
ファイル: Helicopter.cs プロジェクト: myjere/helisharp
        public override void Update(double dt)
        {
            // Update atmospheric properties
            Atmosphere.Position = Translation;
            Atmosphere.Update(dt);
            if (Fuselage != null)
            {
                Fuselage.Density = Atmosphere.Density;
            }

            // Update FCS
            FCS.HorizonVelocity = Matrix <double> .Build.RotationZ(-Attitude.z()) * (Rotation * Velocity);

            FCS.Velocity        = Velocity;
            FCS.AngularVelocity = AngularVelocity;
            FCS.Attitude        = Attitude;
            FCS.Update(dt);

            PreUpdate(dt);
            base.Update(dt);
            PostUpdate(dt);
        }