Exemple #1
0
        public void Apply3D(Cue cue, Listener listener, Emitter emitter)
        {
            m_x3dAudio.Calculate(listener, emitter, CalculateFlags.Matrix | CalculateFlags.Doppler | CalculateFlags.EmitterAngle, m_dsp);

            cue.SetMatrixCoefficients(m_dsp.SourceChannelCount, m_dsp.DestinationChannelCount, m_dsp.MatrixCoefficients);
            cue.SetVariable(MyCueVariableEnum.Distance, m_dsp.EmitterToListenerDistance);
            cue.SetVariable(MyCueVariableEnum.DopplerPitchScalar, m_dsp.DopplerFactor);
            cue.SetVariable(MyCueVariableEnum.OrientationAngleDegrees, m_dsp.EmitterToListenerAngle * 57.29578f); // From radians to degrees
        }
        public static void SetVariable(Cue cue, MyCueVariableEnum variableEnum, float value)
        {
            var varInfo = m_cueVariables[(int)variableEnum];

            if (varInfo.VariableIndex == -1 || CacheEnabled == false)
            {
                varInfo.VariableIndex = cue.GetVariableIndex(varInfo.VariableName);
                m_cueVariables[(int)variableEnum].VariableIndex = varInfo.VariableIndex;
            }
            cue.SetVariable(varInfo.VariableIndex, value);
        }
 private static void CheckVar(MyCueVariableEnum variableEnum, Cue cue)
 {
     var index = MyXactVariables.GetVariableIndex(variableEnum);
     var cindex = cue.GetVariableIndex(MyXactVariables.GetVariableName(variableEnum));
     if (index == -1)
     {
         MyXactVariables.SetVariableIndex(variableEnum, cindex);
     }
     else
     {
         System.Diagnostics.Debug.Assert(index == cindex, "Variable index invalid");
     }
 }
Exemple #4
0
 static private bool IsCueFinished(Cue cue)
 {
     return cue.IsPlaying() == false;
 }
Exemple #5
0
 public void OnInit(Cue cue, MySoundCuesEnum cueEnum)
 {
     Cue.m_cue = cue;
     Cue.CueEnum = cueEnum;
 }