Example #1
0
        private void InitJetpackThrust(int bone, Vector3 forward, float offset, MyJetpackThrustDefinition thrustDefinition)
        {
            var thrust = new MyJetpackThrust()
            {
                Bone            = bone,
                Forward         = forward,
                Offset          = offset,
                ThrustMaterial  = thrustDefinition.ThrustMaterial,
                ThrustGlareSize = thrustDefinition.ThrustGlareSize
            };

            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 = thrustDefinition.ThrustColor;
            thrust.Light.Start(MyLight.LightTypeEnum.PointLight, 1);

            m_jetpackThrusts.Add(thrust);
        }
Example #2
0
        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);
            }
        }
        private void InitJetpackThrust(int bone, Vector3 forward, float offset, MyJetpackThrustDefinition thrustDefinition)
        {
            var thrust = new MyJetpackThrust()
            {
                Bone = bone,
                Forward = forward,
                Offset = offset,
                ThrustMaterial = thrustDefinition.ThrustMaterial,
                ThrustGlareSize = thrustDefinition.ThrustGlareSize
            };

            thrust.Light = MyLights.AddLight();
            thrust.Light.ReflectorDirection = Entity.PositionComp.WorldMatrix.Forward;
            thrust.Light.ReflectorUp = Entity.PositionComp.WorldMatrix.Up;
            thrust.Light.ReflectorRange = 1;
            thrust.Light.Color = thrustDefinition.ThrustColor;
            thrust.Light.Start(MyLight.LightTypeEnum.PointLight, 1);

            m_jetpackThrusts.Add(thrust);
        }
        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);
        }