本文整理汇总了C#中Vessel.GetHeightFromTerrain方法的典型用法代码示例。如果您正苦于以下问题:C# Vessel.GetHeightFromTerrain方法的具体用法?C# Vessel.GetHeightFromTerrain怎么用?C# Vessel.GetHeightFromTerrain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vessel
的用法示例。
在下文中一共展示了Vessel.GetHeightFromTerrain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAltitude
public static double GetAltitude(Vessel v)
{
v.GetHeightFromTerrain();
double alt = v.heightFromTerrain;
if (alt < 0)
{
alt = v.mainBody.GetAltitude(v.CoM);
}
return alt;
}
示例2: BuildAndLaunchCraft
internal void BuildAndLaunchCraft ()
{
// build craft
ShipConstruct nship = new ShipConstruct ();
nship.LoadShip (craftConfig);
int numParts = builder.vessel.parts.Count;
if (craftType != CraftType.SubAss)
numParts = 0;
string landedAt = "External Launchpad";
string flag = flagname;
Game game = FlightDriver.FlightStateCache;
VesselCrewManifest crew = new VesselCrewManifest ();
Box vessel_bounds = GetVesselBox (nship);
launchTransform = builder.PlaceShip (nship, vessel_bounds);
EnableExtendingLaunchClamps (nship);
ShipConstruction.AssembleForLaunch (nship, landedAt, flag, game,
crew);
var FlightVessels = FlightGlobals.Vessels;
craftVessel = FlightVessels[FlightVessels.Count - 1];
FlightGlobals.ForceSetActiveVessel (craftVessel);
if (builder.capture) {
craftVessel.Splashed = craftVessel.Landed = false;
} else {
bool loaded = craftVessel.loaded;
bool packed = craftVessel.packed;
craftVessel.loaded = true;
craftVessel.packed = false;
craftVessel.GetHeightFromTerrain ();
Debug.Log (String.Format ("[EL] hft {0}", craftVessel.heightFromTerrain));
craftVessel.loaded = loaded;
craftVessel.packed = packed;
}
Vector3 offset = craftVessel.transform.position - launchTransform.position;
craftOffset = launchTransform.InverseTransformDirection (offset);
SetupCraftResources (craftVessel);
Staging.beginFlight ();
if (builder.capture) {
FlightGlobals.overrideOrbit = true;
(builder as PartModule).StartCoroutine (CaptureCraft ());
} else {
state = State.Idle;
}
}