当前位置: 首页>>代码示例>>C++>>正文


C++ Trigger::UsingTriggerDir方法代码示例

本文整理汇总了C++中Trigger::UsingTriggerDir方法的典型用法代码示例。如果您正苦于以下问题:C++ Trigger::UsingTriggerDir方法的具体用法?C++ Trigger::UsingTriggerDir怎么用?C++ Trigger::UsingTriggerDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Trigger的用法示例。


在下文中一共展示了Trigger::UsingTriggerDir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

void SoundManager::UpdateUI
   (
   void
   )
   {
   if ( current )
      {
      gi.Cvar_Set( "snd_multifaceted", "" );
      gi.Cvar_Set( "snd_currentfacet", "" );
      gi.Cvar_Set( "snd_onetime", "0" );
      gi.Cvar_Set( "snd_useangles", "0" );
      gi.Cvar_Set( "snd_yaw", "0" );

      gi.Cvar_Set( "snd_origin", va( "%.2f %.2f %.2f", current->origin[ 0 ], current->origin[ 1 ], current->origin[ 2 ] ) );
      gi.Cvar_Set( "snd_targetname", current->targetname.c_str() );
      if ( current->isSubclassOf( TriggerSpeaker ) )
         {
         TriggerSpeaker * speaker;

         speaker = ( TriggerSpeaker * )current;
         if ( speaker->volume != DEFAULT_VOL )
            {
            gi.Cvar_Set( "snd_volume", va( "%.1f", speaker->volume ) );
            }
         else
            {
            gi.Cvar_Set( "snd_volume", "Default" );
            }
         if ( speaker->min_dist != DEFAULT_MIN_DIST )
            {
            gi.Cvar_Set( "snd_mindist", va( "%.1f", speaker->min_dist ) );
            }
         else
            {
            gi.Cvar_Set( "snd_mindist", "Default" );
            }

         // setup the sound
         gi.Cvar_Set( "ui_pickedsound", speaker->Noise().c_str() );

         if ( current->isSubclassOf( RandomSpeaker ) )
            {
            RandomSpeaker * random;

            random = ( RandomSpeaker * )current;
            gi.Cvar_Set( "snd_mindelay", va( "%.1f", random->mindelay ) );
            gi.Cvar_Set( "snd_maxdelay", va( "%.1f", random->maxdelay ) );
            gi.Cvar_Set( "snd_channel", va( "%d", random->channel ) );
            gi.Cvar_Set( "snd_chance", va( "%.1f", random->chance ) );
            gi.Cvar_Set( "snd_type", "RandomSpeaker" );
            }
         else
            {
            gi.Cvar_Set( "snd_type", "Speaker" );
            }
         }
      else if ( current->isSubclassOf( TriggerMusic )  || current->isSubclassOf( TriggerReverb ) )
         {
         int      multiFaceted;
         Trigger  *trigger;

         trigger = ( Trigger * )current;
         gi.Cvar_Set( "snd_width", va( "%.0f", trigger->maxs[ 0 ] ) );
         gi.Cvar_Set( "snd_length", va( "%.0f", trigger->maxs[ 1 ] ) );
         gi.Cvar_Set( "snd_height", va( "%.0f", trigger->maxs[ 2 ] ) );
         if ( trigger->UsingTriggerDir() )
            {
            gi.Cvar_Set( "snd_useangles", "1" );
            }
         else
            {
            gi.Cvar_Set( "snd_useangles", "0" );
            }
         gi.Cvar_Set( "snd_yaw", va( "%.0f", trigger->angles[ 1 ] ) );
         multiFaceted = trigger->GetMultiFaceted();
         if ( multiFaceted )
            {
            if ( multiFaceted == 1 )
               {
               gi.Cvar_Set( "snd_multifaceted", "North/South" );
               if ( currentFacet )
                  {
                  gi.Cvar_Set( "snd_currentfacet", "South" );
                  }
               else
                  {
                  gi.Cvar_Set( "snd_currentfacet", "North" );
                  }
               }
            else
               {
               gi.Cvar_Set( "snd_multifaceted", "East/West" );
               if ( currentFacet )
                  {
                  gi.Cvar_Set( "snd_currentfacet", "West" );
                  }
               else
                  {
                  gi.Cvar_Set( "snd_currentfacet", "East" );
                  }
//.........这里部分代码省略.........
开发者ID:kingtiger01,项目名称:openmohaa-1,代码行数:101,代码来源:soundman.cpp


注:本文中的Trigger::UsingTriggerDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。