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


C# CelestialBody类代码示例

本文整理汇总了C#中CelestialBody的典型用法代码示例。如果您正苦于以下问题:C# CelestialBody类的具体用法?C# CelestialBody怎么用?C# CelestialBody使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Overlay

        public Overlay(string planet, float altitude, Material scaledMaterial, Material macroMaterial, Vector2 rotation, int layer, Transform celestialTransform, bool mainMenu, bool matchTerrain)
        {
            this.MainMenu = mainMenu;
            this.OverlayGameObject = new GameObject();
            this.Body = planet;
            this.Rotation = rotation;
            this.scaledMaterial = scaledMaterial;
            this.macroMaterial = macroMaterial;
            this.OriginalLayer = layer;
            this.celestialTransform = celestialTransform;
            this.altitude = altitude;
            this.matchTerrain = matchTerrain;

            CelestialBody[] celestialBodies = (CelestialBody[])CelestialBody.FindObjectsOfType(typeof(CelestialBody));
            celestialBody = celestialBodies.First(n => n.bodyName == this.Body);

            if (!mainMenu && matchTerrain)
            {
                IsoSphere.Create(OverlayGameObject, this.altitude, celestialBody);
            }
            else
            {
                IsoSphere.Create(OverlayGameObject, this.Radius, null);
            }

            var mr = OverlayGameObject.AddComponent<MeshRenderer>();
            mr.sharedMaterial = scaledMaterial;
            mr.castShadows = false;
            mr.receiveShadows = false;
            //mr.enabled = mainMenu;
            mr.enabled = true;
        }
开发者ID:TheTriGeo,项目名称:EnvironmentalVisualEnhancements,代码行数:32,代码来源:OverlayMgr.cs

示例2: PowerUpDarkSide

        public PowerUpDarkSide(Simulator simulator)
            : base(simulator)
        {
            Type = PowerUpType.DarkSide;
            Category = PowerUpCategory.Other;
            BuyImage = "darkside";
            BuyPrice = 500;
            BuyTitle = "Dark side (" + BuyPrice + "M$)";
            BuyDescription = "Enemies are hit by a mysterious force when they go behind a planet.";
            NeedInput = false;
            Position = Vector3.Zero;

            CorpsCeleste = new CelestialBody(
                    Simulation,
                    "",
                    Vector3.Zero,
                    Vector3.Zero,
                    0,
                    Size.Small,
                    float.MaxValue,
                    null,
                    0,
                    0,
                    false);
            CorpsCeleste.AttackPoints = 0.5f;

            SfxIn = "sfxDarkSide";
        }
开发者ID:jodigiordano,项目名称:commander,代码行数:28,代码来源:PowerUpDarkSide.cs

示例3: progressBodyCollection

		public progressBodyCollection(CelestialBodySubtree b)
		{
			body = b.Body;

			if (b.Body.isHomeWorld)
			{
				homeworld = true;
			}
			else
			{
				addProgressStandard(ProgressType.FLIGHT, b.Body, b.flight, progressParser.flightDescriptor, progressParser.StandardNote, progressParser.vesselNameFromNode(b.flight));
				addProgressStandard(ProgressType.SUBORBIT, b.Body, b.suborbit, progressParser.suborbitDescriptor, progressParser.StandardNote, progressParser.vesselNameFromNode(b.suborbit));
				addProgressStandard(ProgressType.FLYBY, b.Body, b.flyBy, progressParser.flybyDescriptor);
				addProgressStandard(ProgressType.FLYBYRETURN, b.Body, b.returnFromFlyby, progressParser.returnFlybyDescriptor, progressParser.RecoveryNote, progressParser.vesselNameFromNode(b.returnFromFlyby));
				addProgressStandard(ProgressType.LANDINGRETURN, b.Body, b.returnFromSurface, progressParser.returnLandingDescriptor, progressParser.RecoveryNote, progressParser.vesselNameFromNode(b.returnFromSurface));
			}

			addProgressStandard(ProgressType.ESCAPE, b.Body, b.escape, progressParser.escapeDescriptor);
			addProgressStandard(ProgressType.BASECONSTRUCTION, b.Body, b.baseConstruction, progressParser.baseDescriptor, progressParser.FacilityNote, progressParser.vesselNameFromNode(b.baseConstruction));
			addProgressStandard(ProgressType.CREWTRANSFER, b.Body, b.crewTransfer, progressParser.crewTransferDescriptor);
			addProgressStandard(ProgressType.DOCKING, b.Body, b.docking, progressParser.dockingDescriptor);
			addProgressStandard(ProgressType.FLAGPLANT, b.Body, b.flagPlant, progressParser.flagDescriptor);
			addProgressStandard(ProgressType.LANDING, b.Body, b.landing, progressParser.landingDescriptor, progressParser.StandardNote, progressParser.vesselNameFromNode(b.landing));
			addProgressStandard(ProgressType.ORBIT, b.Body, b.orbit, progressParser.orbitDescriptor, progressParser.StandardNote, progressParser.vesselNameFromNode(b.orbit));
			addProgressStandard(ProgressType.ORBITRETURN, b.Body, b.returnFromOrbit, progressParser.returnOrbitDescriptor, progressParser.RecoveryNote, progressParser.vesselNameFromNode(b.returnFromOrbit));
			addProgressStandard(ProgressType.RENDEZVOUS, b.Body, b.rendezvous, progressParser.rendezvousDescriptor);
			addProgressStandard(ProgressType.SCIENCE, b.Body, b.science, progressParser.scienceDescriptor, progressParser.StandardNote, progressParser.vesselNameFromNode(b.science));
			addProgressStandard(ProgressType.SPACEWALK, b.Body, b.spacewalk, progressParser.spacewalkDescriptor, progressParser.CrewNote, progressParser.crewNameFromNode(b.spacewalk));
			addProgressStandard(ProgressType.SPLASHDOWN, b.Body, b.splashdown, progressParser.splashdownDescriptor);
			addProgressStandard(ProgressType.STATIONCONSTRUCTION, b.Body, b.stationConstruction, progressParser.stationDescriptor, progressParser.FacilityNote, progressParser.vesselNameFromNode(b.stationConstruction));
			addProgressStandard(ProgressType.SURFACEEVA, b.Body, b.surfaceEVA, progressParser.EVADescriptor, progressParser.CrewNote, progressParser.crewNameFromNode(b.surfaceEVA));
		}
开发者ID:DMagic1,项目名称:KSP_Progress_Parser,代码行数:32,代码来源:progressBodyCollection.cs

示例4: DrawMapViewGroundMarker

        public static void DrawMapViewGroundMarker(CelestialBody body, double latitude, double longitude, Color c, double rotation = 0, double radius = 0)
        {
            Vector3d up = body.GetSurfaceNVector(latitude, longitude);
            var height = body.pqsController.GetSurfaceHeight(QuaternionD.AngleAxis(longitude, Vector3d.down) * QuaternionD.AngleAxis(latitude, Vector3d.forward) * Vector3d.right);
            if (height < body.Radius) { height = body.Radius; }
            Vector3d center = body.position + height * up;

            if (IsOccluded(center, body)) return;

            Vector3d north = Vector3d.Exclude(up, body.transform.up).normalized;

            if (radius <= 0) { radius = body.Radius / 15; }

            GLTriangleMap(new Vector3d[]{
                center,
                center + radius * (QuaternionD.AngleAxis(rotation - 10, up) * north),
                center + radius * (QuaternionD.AngleAxis(rotation + 10, up) * north)
            }, c);

            GLTriangleMap(new Vector3d[]{
                center,
                center + radius * (QuaternionD.AngleAxis(rotation + 110, up) * north),
                center + radius * (QuaternionD.AngleAxis(rotation + 130, up) * north)
            }, c);

            GLTriangleMap(new Vector3d[]{
                center,
                center + radius * (QuaternionD.AngleAxis(rotation - 110, up) * north),
                center + radius * (QuaternionD.AngleAxis(rotation - 130, up) * north)
            }, c);
        }
开发者ID:CliftonMarien,项目名称:MechJeb2,代码行数:31,代码来源:GLUtils.cs

示例5: GetModel

        public static VesselAerodynamicModel GetModel(Vessel ship, CelestialBody body)
        {
            foreach (var loadedAssembly in AssemblyLoader.loadedAssemblies)
            {
                try
                {
                    switch (loadedAssembly.name)
                    {
                        case "FerramAerospaceResearch":
                            var FARAPIType = loadedAssembly.assembly.GetType("FerramAerospaceResearch.FARAPI");

                                var FARAPI_CalculateVesselAeroForces = FARAPIType.GetMethodEx("CalculateVesselAeroForces", BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(Vessel), typeof(Vector3).MakeByRefType(), typeof(Vector3).MakeByRefType(), typeof(Vector3), typeof(double) });

                            return new FARModel(ship, body, FARAPI_CalculateVesselAeroForces);

                        //case "MyModAssembly":
                        // implement here your atmo mod detection
                        // return new MyModModel(ship, body, any other parameter);
                    }
                }
                catch (Exception e)
                {
                    Debug.Log("Trajectories: failed to interface with assembly " + loadedAssembly.name);
                    Debug.Log("Using stock model instead");
                    Debug.Log(e.ToString());
                }
            }

            // Using stock model if no other aerodynamic is detected or if any error occured
            return new StockModel(ship, body);
        }
开发者ID:CalebJ2,项目名称:KSPTrajectories,代码行数:31,代码来源:AeroDynamicModelFactory.cs

示例6: GetNorthVector

 public static Vector3 GetNorthVector(Vector3 position, CelestialBody body)
 {
     Vector3 geoPosA = VectorUtils.WorldPositionToGeoCoords(position, body);
     Vector3 geoPosB = new Vector3(geoPosA.x+1, geoPosA.y, geoPosA.z);
     Vector3 north = GetWorldSurfacePostion(geoPosB, body)-GetWorldSurfacePostion(geoPosA, body);
     return Vector3.ProjectOnPlane(north, body.GetSurfaceNVector(geoPosA.x, geoPosA.y)).normalized;
 }
开发者ID:jediminer543,项目名称:BDArmory,代码行数:7,代码来源:VectorUtils.cs

示例7: GetPressure

        public static double GetPressure(Vector3 position, CelestialBody body)
        {
            double latitude = body.GetLatitude(position) / 180.0 * Math.PI;
            double altitude = (position - body.position).magnitude - body.Radius;
            return GetPressure(altitude, latitude, body);

        }
开发者ID:Murdabenne,项目名称:KSPTrajectories,代码行数:7,代码来源:StockAeroUtil.cs

示例8: CreateOrbit

        private static Orbit CreateOrbit(double inc, double e, double sma, double lan, double w, double mEp, double epoch, CelestialBody body)
        {
            if (double.IsNaN(inc))
                inc = 0;
            if (double.IsNaN(e))
                e = 0;
            if (double.IsNaN(sma))
                sma = body.Radius + body.maxAtmosphereAltitude + 10000;
            if (double.IsNaN(lan))
                lan = 0;
            if (double.IsNaN(w))
                w = 0;
            if (double.IsNaN(mEp))
                mEp = 0;
            if (double.IsNaN(epoch))
                mEp = Planetarium.GetUniversalTime();

            if (Math.Sign(e - 1) == Math.Sign(sma))
                sma = -sma;

            if (Math.Sign(sma) >= 0)
            {
                while (mEp < 0)
                    mEp += Math.PI * 2;
                while (mEp > Math.PI * 2)
                    mEp -= Math.PI * 2;
            }

            return new Orbit(inc, e, sma, lan, w, mEp, epoch, body);
        }
开发者ID:ntwest,项目名称:KCT,代码行数:30,代码来源:KCT_OrbitAdjuster.cs

示例9: Start

        void Start() {
            if ( !Target ) {
                var ship = GameObject.Find( "Ship" );
                if ( ship ) {
                    Target = ship.GetComponentInParent<CelestialBody>();
                }
            }
            _defaultTimeScale = SimulationControl.instance.TimeScale;
            if ( timeScaleButtons.Length == 3 ) {
                timeScaleButtons[0].interactable = false;
            }
            if ( !ShipControl ) {
                ShipControl = Target.GetComponent<ShipController>();
            }
            if ( !FuelSlider ) {
				Debug.Log("SpaceGravity2D.ShipGUI: fuel slider ref is null");
            } else {
                FuelSlider.maxValue = ShipControl.MaxFuel;
                FuelSlider.value = ShipControl.Fuel;
            }
            if ( MarkPrefab ) {
                _markApoapsis = Instantiate( MarkPrefab ) as Transform;
                _markApoapsis.name = "apoapsisMark";
                _markApoapsis.GetComponentInChildren<Text>().text = "A";
                _markPeriapsis = Instantiate( MarkPrefab ) as Transform;
                _markPeriapsis.name = "periapsisMark";
                _markPeriapsis.GetComponentInChildren<Text>().text = "P";
            }

        }
开发者ID:frotein,项目名称:TinyUniverse,代码行数:30,代码来源:ShipHUD.cs

示例10: Complex

 public static void Complex(OrbitDriver currentlyEditing, double inclination, double eccentricity,
     double semiMajorAxis, double longitudeAscendingNode, double argumentOfPeriapsis,
     double meanAnomalyAtEpoch, double epoch, CelestialBody body)
 {
     SetOrbit(currentlyEditing, CreateOrbit(inclination, eccentricity, semiMajorAxis,
         longitudeAscendingNode, argumentOfPeriapsis, meanAnomalyAtEpoch, epoch, body));
 }
开发者ID:Kerbas-ad-astra,项目名称:HyperEdit,代码行数:7,代码来源:OrbitEditor.cs

示例11: getMaxAtmosphericAltitude

 public static float getMaxAtmosphericAltitude(CelestialBody body) 
 {
     if (!body.atmosphere) return 0;
     
     //return (float)-body.atmosphereScaleHeight * 1000.0f * Mathf.Log(1e-6f);
     return (float)-body.atmosphereDepth * 1000.0f * Mathf.Log(1e-6f);
 }
开发者ID:Yitscar,项目名称:KSPInterstellar,代码行数:7,代码来源:ORSHelper.cs

示例12: CelestialBodyCoverageParameter

 public CelestialBodyCoverageParameter(double coverage, CelestialBody targetBody, string title = null)
     : base(title)
 {
     this.coverage = coverage;
     this.targetBody = targetBody;
     disableOnStateChange = false;
 }
开发者ID:linuxgurugamer,项目名称:ContractConfigurator,代码行数:7,代码来源:CelestialBodyCoverageParameter.cs

示例13: PerformOrbitalSurvey

        public PerformOrbitalSurvey(string title,  CelestialBody targetBody)
            : base(title)
        {
            disableOnStateChange = true;

            this.targetBody = targetBody;
        }
开发者ID:Kerbas-ad-astra,项目名称:ContractConfigurator,代码行数:7,代码来源:PerformOrbitalSurvey.cs

示例14: Start

		protected override void Start()
		{
			//Initialize the map object
			Visible = SCANcontroller.controller.bigMapVisible;
			if (v == null)
				v = FlightGlobals.ActiveVessel;
			if (b == null)
				b = v.mainBody;
			if (bigmap == null)
			{
				bigmap = new SCANmap(b, true);
				bigmap.setProjection((MapProjection)SCANcontroller.controller.projection);
				bigmap.setWidth(SCANcontroller.controller.map_width);
			}
			WindowRect.x = SCANcontroller.controller.map_x;
			WindowRect.y = SCANcontroller.controller.map_y;
			currentColor = SCANcontroller.controller.colours == 0;
			lastColor = currentColor;
			lastResource = SCANcontroller.controller.map_ResourceOverlay;
			WindowCaption = string.Format("Map of {0}", b.theName);
			data = SCANUtil.getData(b);
			if (data == null)
			{
				data = new SCANdata(b);
				SCANcontroller.controller.addToBodyData(b, data);
			}
			bigmap.setBody(b);
			if (SCANconfigLoader.GlobalResource)
			{
				loadedResources = SCANcontroller.setLoadedResourceList();
			}
			TooltipsEnabled = SCANcontroller.controller.toolTips;
		}
开发者ID:DBT85,项目名称:SCANsat,代码行数:33,代码来源:SCANbigMap.cs

示例15: LocationAndSituationParameter

 public LocationAndSituationParameter()
 {
     targetSituation = Vessel.Situations.ESCAPING;
     targetBody = null;
     noun = "potato";
     this.successCounter = 0;
 }
开发者ID:kevin-ye,项目名称:FinePrint,代码行数:7,代码来源:LocationAndSituationParameter.cs


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