当前位置: 首页>>代码示例>>C#>>正文


C# Vessel.AttachPatchedConicsSolver方法代码示例

本文整理汇总了C#中Vessel.AttachPatchedConicsSolver方法的典型用法代码示例。如果您正苦于以下问题:C# Vessel.AttachPatchedConicsSolver方法的具体用法?C# Vessel.AttachPatchedConicsSolver怎么用?C# Vessel.AttachPatchedConicsSolver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vessel的用法示例。


在下文中一共展示了Vessel.AttachPatchedConicsSolver方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Print_Vessel_info


//.........这里部分代码省略.........
            //Output += "\n atmDensity:" + v.atmDensity;
            //Output += "\n CoM:" + v.CoM;
            Output += "\n ctrlState:" + v.ctrlState;
            //Output += "\n currentStage:" + v.currentStage;
            //Output += "\n geeForce:" + v.geeForce;
            //Output += "\n geeForce_immediate:" + v.geeForce_immediate;
            //Output += "\n heightFromSurface:" + v.heightFromSurface;
            //Output += "\n heightFromTerrain:" + v.heightFromTerrain;
            //Output += "\n horizontalSrfSpeed:" + v.horizontalSrfSpeed;
            Output += "\n id:" + v.id;
            //Output += "\n isEVA:" + v.isEVA;
            //Output += "\n Landed:" + v.Landed;
            //Output += "\n LandedAt:" + v.landedAt;
            Output += "\n Latitude:" + v.latitude;
            Output += "\n LaunchTime:" + v.launchTime;
            Output += "\n loaded:" + v.loaded;
            //Output += "\n LocalCoM:" + v.localCoM;
            //Output += "\n missionTime:" + v.missionTime;
            //Output += "\n MOI:" + v.MOI;
            //Output += "\n obt_speed:" + v.obt_speed;
            //Output += "\n obt_velocity:" + v.obt_velocity;
            //			Output += "\n A:" + v.OnFlyByWire;
            Output += "\n orbitDriver:" + v.orbitDriver;
            Output += "\n orbitTargeter:" + v.orbitTargeter;
            Output += "\n packed:" + v.packed;
            //Output += "\n parts:" + v.parts;
            Output += "\n patchedConicRenderer:" + v.patchedConicRenderer;
            Output += "\n patchedConicSolver:" + v.patchedConicSolver;
            //Output += "\n perturbation:" + v.perturbation;
            //Output += "\n pqsAltitude:" + v.pqsAltitude;
            Output += "\n protoVessel:" + v.protoVessel;
            //Output += "\n rb_velocity:" + v.rb_velocity;
            //Output += "\n referenceTransformId:" + v.referenceTransformId;
            //Output += "\n rootPart:" + v.rootPart;
            Output += "\n situation:" + v.situation;
            //Output += "\n specificAcceleration:" + v.specificAcceleration;
            //Output += "\n Splashed:" + v.Splashed;
            //Output += "\n srf_velocity:" + v.srf_velocity;
            //Output += "\n srfRelRotation:" + v.srfRelRotation;
            Output += "\n state:" + v.state;
            //Output += "\n staticPressurekPa:" + v.staticPressurekPa;
            //Output += "\n terrainAltitude:" + v.terrainAltitude;
            //Output += "\n terrainNormal:" + v.terrainNormal;
            //Output += "\n upAxis:" + v.upAxis;
            Output += "\n verticalSpeed:" + v.verticalSpeed;
            Output += "\n vesselName:" + v.vesselName;
            Output += "\n vesselType:" + v.vesselType;

            //Properties (get/set)
            //Output += "\n ActionGroups:" + v.ActionGroups;
            Output += "\n DiscoveryInfo:" + v.DiscoveryInfo.ToString(); //@@@TODO: add Function

            Output += "\n HoldPhysics:" + v.HoldPhysics;
            Output += "\n isActiveVessel:" + v.isActiveVessel;
            Output += "\n isCommandable:" + v.isCommandable;
            Output += "\n IsControllable:" + v.IsControllable;
            Output += "\n isPersistent:" + v.isPersistent;
            Output += "\n LandedOrSplashed:" + v.LandedOrSplashed;
            Output += "\n orbit:" + v.orbit;

            //functions
            Output += "\n PatchedConicsAttached:" + v.PatchedConicsAttached;

            //			Debug.Log(v.GetComponents<Component> ());

            //tests
            if(v.PatchedConicsAttached){
                ///@@@TODO: Add another funtion for PatchConic Solver Dump
                Output += "\n maxTotalPatches:" + v.patchedConicSolver.maxTotalPatches;
            }
            Debug.Log(Output);
            Print_Discovery_info (v.DiscoveryInfo);
            Print_Orbit_info (v.orbit);

            if (!v.PatchedConicsAttached) {
                Debug.Log("No PatchedConicSolver. Creating a New One. ");
                //v.patchedConicSolver = new PatchedConicSolver ();
                try {
                    v.AttachPatchedConicsSolver ();
                    v.patchedConicSolver.Update ();
                    v.patchedConicSolver.IncreasePatchLimit ();
                    v.patchedConicSolver.Update ();
                    v.patchedConicSolver.IncreasePatchLimit ();
                    v.patchedConicSolver.Update ();
                    v.patchedConicSolver.IncreasePatchLimit ();
                    v.patchedConicSolver.Update ();
                    Print_Orbit_info (v.orbit);
                }
                catch(Exception ex)
                {
                    Debug.Log("Could not attach patchedConicSolver. Exception:" + ex);
                    AttachedConicsAtStart = true;
                    //v.DetachPatchedConicsSolver ();
                }
            }

            if (!AttachedConicsAtStart) {
                v.DetachPatchedConicsSolver ();
            }
        }
开发者ID:ve2dmn,项目名称:AsteroidScanner,代码行数:101,代码来源:MyScanner.cs

示例2: OnOrbitChange

        private void OnOrbitChange(Vessel ActiveVessel)
        {
            //if(ActiveVessel.id !=
            Debug.Log("Running  OnOrbitChange() / check for periapsis for  :" +  ActiveVessel.GetName() );
            if (!ActiveVessel.PatchedConicsAttached)
            {
                Debug.Log ("No PatchedConicSolver. Creating a New One. ");
                try
                {
                    //v.patchedConicSolver = new PatchedConicSolver ();
                    ActiveVessel.AttachPatchedConicsSolver ();
                    ActiveVessel.patchedConicSolver.IncreasePatchLimit ();
                    ActiveVessel.patchedConicSolver.Update ();
                } catch (Exception ex)
                {
                    Debug.Log ("Could not attach patchedConicSolver. Exception:" + ex);
                    //DontdetachConics = true;
                    //v.DetachPatchedConicsSolver ();
                }
            }
            Orbit o = ActiveVessel.orbit;
            while(o.activePatch)
            {
            //@@@TODO: Make Altitude variable. 70k for now
                Debug.Log("Check Orbit" );
                if (o.referenceBody.name == FlightGlobals.Bodies [1].bodyName)  // Around Kerbin
                {
                    if(o.PeA >= 70000 )
                    {
                        base.SetComplete();
                        return;
                    }
                    if(o.PeA < 70000 )
                    {
                        base.SetIncomplete();
                        return;
                    }

                }
                o = o.nextPatch;

            }
        }
开发者ID:ve2dmn,项目名称:AsteroidScanner,代码行数:43,代码来源:AsteroidRedirectParameters.cs

示例3: CheckVessel

        /// <summary>
        /// Stuff
        /// </summary>
        private static bool CheckVessel(Vessel v)
        {
            bool answer = false;
            Debug.Log("Cheking Intersection for Vessel " + v.name );
            bool DontdetachConics = v.PatchedConicsAttached;

            //Debug Output
            string Output = "";

            Output = "Name:" + v.name + "; Of type:" +  v.vesselType +  "; doing: " + v.RevealSituationString () +
                "; Unobserved for: " + v.DiscoveryInfo.unobservedLifetime + "sec; Orbiting:" + v.orbit.referenceBody.name ;

            Debug.Log(Output);

            if (!v.PatchedConicsAttached) {
                Debug.Log("No PatchedConicSolver. Creating a New One. ");
                try {
                    //v.patchedConicSolver = new PatchedConicSolver ();
                    v.AttachPatchedConicsSolver();
                    v.patchedConicSolver.IncreasePatchLimit ();
                    v.patchedConicSolver.Update ();
                }
                catch(Exception ex)
                {
                    Debug.Log("Could not attach patchedConicSolver. Exception:" + ex);
                    //DontdetachConics = true;
                    //v.DetachPatchedConicsSolver ();
                }
            }

            answer = CheckOrbits (v.orbit);

            if (!DontdetachConics && v.PatchedConicsAttached && v.patchedConicSolver != null) {
                v.DetachPatchedConicsSolver ();
            }
            return answer;
        }
开发者ID:ve2dmn,项目名称:AsteroidScanner,代码行数:40,代码来源:MyScanner.cs


注:本文中的Vessel.AttachPatchedConicsSolver方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。