Exemple #1
0
        /// <summary>
        /// Updates emitter position, forward, up and velocity
        /// </summary>
        public static void UpdateValues(this Emitter emitter, Vector3 position, Vector3 forward, Vector3 up, Vector3 velocity, MyObjectBuilder_CueDefinition cue, int channelsCount)
        {
            emitter.Position    = SharpDXHelper.ToSharpDX(position);
            emitter.OrientFront = SharpDXHelper.ToSharpDX(forward);
            emitter.OrientTop   = SharpDXHelper.ToSharpDX(up);
            emitter.Velocity    = SharpDXHelper.ToSharpDX(velocity);

            emitter.DopplerScaler       = 1f;
            emitter.CurveDistanceScaler = cue.MaxDistance;
            if (m_currVolumeCurve != cue.VolumeCurve)
            {
                emitter.VolumeCurve = m_curves[(int)cue.VolumeCurve];
                m_currVolumeCurve   = cue.VolumeCurve;
            }

            emitter.InnerRadius      = (channelsCount > 2) ? cue.MaxDistance : 0f;
            emitter.InnerRadiusAngle = (channelsCount > 2) ? 0.5f * SharpDX.AngleSingle.RightAngle.Radians : 0f;
        }
        /// <summary>
        /// Updates emitter position, forward, up and velocity
        /// </summary>
        public static void UpdateValues(this Emitter emitter, Vector3 position, Vector3 forward, Vector3 up, Vector3 velocity, MyObjectBuilder_CueDefinition cue, int channelsCount)
        {
            emitter.Position = SharpDXHelper.ToSharpDX(position);
            emitter.OrientFront = SharpDXHelper.ToSharpDX(forward);
            emitter.OrientTop = SharpDXHelper.ToSharpDX(up);
            emitter.Velocity = SharpDXHelper.ToSharpDX(velocity);

            emitter.DopplerScaler = 1f;
            emitter.CurveDistanceScaler = cue.MaxDistance;
            if (m_currVolumeCurve != cue.VolumeCurve)
            {
                emitter.VolumeCurve = m_curves[(int)cue.VolumeCurve];
                m_currVolumeCurve = cue.VolumeCurve;
            }

            emitter.InnerRadius = (channelsCount > 2) ? cue.MaxDistance : 0f;
            emitter.InnerRadiusAngle = (channelsCount > 2) ? 0.5f * SharpDX.AngleSingle.RightAngle.Radians : 0f;
        }