private void InitJetpackThrust(int bone, Vector3 forward, float offset, ref MyObjectBuilder_ThrustDefinition thrustProperties) { var thrust = new MyJetpackThrust() { Bone = bone, Forward = forward, Offset = offset, ThrustMaterial = thrustProperties.FlamePointMaterial, ThrustGlareSize = thrustProperties.FlameGlareSize }; thrust.Light = MyLights.AddLight(); thrust.Light.ReflectorDirection = Container.Entity.PositionComp.WorldMatrix.Forward; thrust.Light.ReflectorUp = Container.Entity.PositionComp.WorldMatrix.Up; thrust.Light.ReflectorRange = 1; thrust.Light.Color = thrustProperties.FlameIdleColor; thrust.Light.Start(MyLight.LightTypeEnum.PointLight, 1); m_jetpackThrusts.Add(thrust); }
protected override void Init(MyObjectBuilder_DefinitionBase builder) { base.Init(builder); MyObjectBuilder_ThrustDefinition definition = builder as MyObjectBuilder_ThrustDefinition; this.ResourceSinkGroup = MyStringHash.GetOrCompute(definition.ResourceSinkGroup); this.FuelConverter = definition.FuelConverter; this.SlowdownFactor = definition.SlowdownFactor; this.ForceMagnitude = definition.ForceMagnitude; this.ThrusterType = MyStringHash.GetOrCompute(definition.ThrusterType); this.MaxPowerConsumption = definition.MaxPowerConsumption; this.MinPowerConsumption = definition.MinPowerConsumption; this.FlameDamageLengthScale = definition.FlameDamageLengthScale; this.FlameDamage = definition.FlameDamage; this.FlameLengthScale = definition.FlameLengthScale; this.FlameFullColor = definition.FlameFullColor; this.FlameIdleColor = definition.FlameIdleColor; this.FlamePointMaterial = definition.FlamePointMaterial; this.FlameLengthMaterial = definition.FlameLengthMaterial; this.FlameFlare = definition.FlameFlare; this.FlameVisibilityDistance = definition.FlameVisibilityDistance; this.FlameGlareQuerySize = definition.FlameGlareQuerySize; this.MinPlanetaryInfluence = definition.MinPlanetaryInfluence; this.MaxPlanetaryInfluence = definition.MaxPlanetaryInfluence; this.EffectivenessAtMinInfluence = definition.EffectivenessAtMinInfluence; this.EffectivenessAtMaxInfluence = definition.EffectivenessAtMaxInfluence; this.NeedsAtmosphereForInfluence = definition.NeedsAtmosphereForInfluence; this.ConsumptionFactorPerG = definition.ConsumptionFactorPerG; this.PropellerUse = definition.PropellerUsesPropellerSystem; this.PropellerEntity = definition.PropellerSubpartEntityName; this.PropellerFullSpeed = definition.PropellerRoundsPerSecondOnFullSpeed; this.PropellerIdleSpeed = definition.PropellerRoundsPerSecondOnIdleSpeed; this.PropellerAcceleration = definition.PropellerAccelerationTime; this.PropellerDeceleration = definition.PropellerDecelerationTime; this.PropellerMaxDistance = definition.PropellerMaxVisibleDistance; this.InvDiffMinMaxPlanetaryInfluence = 1f / (this.MaxPlanetaryInfluence - this.MinPlanetaryInfluence); if (!this.InvDiffMinMaxPlanetaryInfluence.IsValid()) { this.InvDiffMinMaxPlanetaryInfluence = 0f; } }
private void InitJetpackThrust(int bone, Vector3 forward, float offset, ref MyObjectBuilder_ThrustDefinition thrustProperties) { MyJetpackThrust thrust1 = new MyJetpackThrust(); thrust1.Bone = bone; thrust1.Forward = forward; thrust1.Offset = offset; thrust1.ThrustPointMaterial = MyStringId.GetOrCompute(thrustProperties.FlamePointMaterial); thrust1.ThrustLengthMaterial = MyStringId.GetOrCompute(thrustProperties.FlameLengthMaterial); thrust1.ThrustGlareSize = 1f; MyJetpackThrust item = thrust1; item.Light = MyLights.AddLight(); if (item.Light != null) { item.Light.ReflectorDirection = (Vector3)base.Container.Entity.PositionComp.WorldMatrix.Forward; item.Light.ReflectorUp = (Vector3)base.Container.Entity.PositionComp.WorldMatrix.Up; item.Light.ReflectorRange = 1f; item.Light.Color = thrustProperties.FlameIdleColor; item.Light.Start(base.Entity.DisplayName + " Jetpack " + this.m_jetpackThrusts.Count); item.Light.Falloff = 2f; this.m_jetpackThrusts.Add(item); } }
public ThrusterDefinition(MyObjectBuilder_ThrustDefinition definition) : base(definition) { }
public ThrusterDefinition(MyObjectBuilder_ThrustDefinition definition) : base(definition) { }
private void InitJetpackThrust(int bone, Vector3 forward, float offset, ref MyObjectBuilder_ThrustDefinition thrustProperties) { var thrust = new MyJetpackThrust() { Bone = bone, Forward = forward, Offset = offset, ThrustMaterial = thrustProperties.FlamePointMaterial, ThrustGlareSize = thrustProperties.FlameGlareSize }; thrust.Light = MyLights.AddLight(); thrust.Light.ReflectorDirection = Container.Entity.PositionComp.WorldMatrix.Forward; thrust.Light.ReflectorUp = Container.Entity.PositionComp.WorldMatrix.Up; thrust.Light.ReflectorRange = 1; thrust.Light.Color = thrustProperties.FlameIdleColor; thrust.Light.Start(MyLight.LightTypeEnum.PointLight, 1); m_jetpackThrusts.Add(thrust); }
public virtual void Init(MyObjectBuilder_Character characterBuilder) { if (characterBuilder != null) { MyFuelConverterInfo fuelConverter; this.CurrentAutoEnableDelay = characterBuilder.AutoenableJetpackDelay; if (this.ThrustComp != null) { base.Character.Components.Remove <MyJetpackThrustComponent>(); } MyObjectBuilder_ThrustDefinition thrustProperties = base.Character.Definition.Jetpack.ThrustProperties; this.FuelConverterDefinition = null; if (MyFakes.ENABLE_HYDROGEN_FUEL) { fuelConverter = base.Character.Definition.Jetpack.ThrustProperties.FuelConverter; } else { MyFuelConverterInfo info1 = new MyFuelConverterInfo(); info1.Efficiency = 1f; fuelConverter = info1; } this.FuelConverterDefinition = fuelConverter; MyDefinitionId defId = new MyDefinitionId(); if (!this.FuelConverterDefinition.FuelId.IsNull()) { defId = thrustProperties.FuelConverter.FuelId; } MyGasProperties definition = null; if (MyFakes.ENABLE_HYDROGEN_FUEL) { MyDefinitionManager.Static.TryGetDefinition <MyGasProperties>(defId, out definition); } MyGasProperties properties2 = definition; if (definition == null) { MyGasProperties local1 = definition; MyGasProperties properties1 = new MyGasProperties(); properties1.Id = MyResourceDistributorComponent.ElectricityId; properties1.EnergyDensity = 1f; properties2 = properties1; } this.FuelDefinition = properties2; this.ForceMagnitude = thrustProperties.ForceMagnitude; this.MinPowerConsumption = thrustProperties.MinPowerConsumption; this.MaxPowerConsumption = thrustProperties.MaxPowerConsumption; this.MinPlanetaryInfluence = thrustProperties.MinPlanetaryInfluence; this.MaxPlanetaryInfluence = thrustProperties.MaxPlanetaryInfluence; this.EffectivenessAtMinInfluence = thrustProperties.EffectivenessAtMinInfluence; this.EffectivenessAtMaxInfluence = thrustProperties.EffectivenessAtMaxInfluence; this.NeedsAtmosphereForInfluence = thrustProperties.NeedsAtmosphereForInfluence; this.ConsumptionFactorPerG = thrustProperties.ConsumptionFactorPerG; MyEntityThrustComponent component = new MyJetpackThrustComponent(); component.Init(); base.Character.Components.Add <MyEntityThrustComponent>(component); this.ThrustComp.DampenersEnabled = characterBuilder.DampenersEnabled; foreach (Vector3I vectori in Base6Directions.IntDirections) { this.ThrustComp.Register(base.Character, vectori, null); } component.ResourceSink(base.Character).TemporaryConnectedEntity = base.Character; base.Character.SuitRechargeDistributor.AddSink(component.ResourceSink(base.Character)); this.TurnOnJetpack(characterBuilder.JetpackEnabled, true, true); } }