public override void OnAddedToContainer() { base.OnAddedToContainer(); m_thrust = Container.Entity as MyThrust; }
private static bool IsOverridden(MyThrust thrust) { var thruster = thrust as MyThrust; if (thruster == null) return false; bool autopilotEnabled = false; MyEntityThrustComponent thrustComp; if (thruster.CubeGrid.Components.TryGet(out thrustComp)) autopilotEnabled = thrustComp.AutopilotEnabled; return thruster.Enabled && thruster.IsFunctional && thruster.ThrustOverride > 0 && !autopilotEnabled; }
public MyDebugRenderComponentThrust(MyThrust thrust) : base(thrust) { m_thrust = thrust; }
private float GetThrusterMaxForce(MyThrust thruster) { float thrusterForce = thruster.BlockDefinition.ForceMagnitude * (thruster as IMyThrust).ThrustMultiplier; if (thruster.BlockDefinition.NeedsAtmosphereForInfluence) if (m_airDensity <= thruster.BlockDefinition.MinPlanetaryInfluence) thrusterForce *= thruster.BlockDefinition.EffectivenessAtMinInfluence; else if (m_airDensity >= thruster.BlockDefinition.MaxPlanetaryInfluence) thrusterForce *= thruster.BlockDefinition.EffectivenessAtMaxInfluence; else { float effectRange = thruster.BlockDefinition.EffectivenessAtMaxInfluence - thruster.BlockDefinition.EffectivenessAtMinInfluence; float influenceRange = thruster.BlockDefinition.MaxPlanetaryInfluence - thruster.BlockDefinition.MinPlanetaryInfluence; float effectiveness = (m_airDensity - thruster.BlockDefinition.MinPlanetaryInfluence) * effectRange / influenceRange + thruster.BlockDefinition.EffectivenessAtMinInfluence; //myLogger.debugLog("for thruster " + thruster.DisplayNameText + ", effectiveness: " + effectiveness + ", max force: " + thrusterForce + ", effect range: " + effectRange + ", influence range: " + influenceRange, "CalcForceInDirection()"); thrusterForce *= effectiveness; } return thrusterForce; }
public override void OnAddedToContainer(MyComponentContainer container) { base.OnAddedToContainer(container); m_thrust = Entity as MyThrust; }
public MySyncThruster(MyThrust block) { m_block = block; }