青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

天行健 君子當自強而不息

Working with Maps and Levels(8)

cTrigger::get_enable_state, cTrigger::set_enable_state, cTrigger::enable, cTrigger::disable

The get_enable_state  function checks the current status of a trigger; by passing the
trigger identification number, you get in return the state of the trigger. If a trigger
is disabled, a call to get_enable_state  returns a value of false. If enabled, the return
value is true. To enable or disable a trigger, call on the enable function, using the
trigger's identification number as the only argument.

Each of the two functions scans the linked list of sTrigger structures. For get_enable_state,
the enabled flag value of the first structure found in the list that has a matching identification
number as the number provided in the ID argument is returned.

For the set_enable_state function, the linked list is scanned, and every instance of a structure
with a matching identification number as passed in the ID argument has its enabled
flag set to the value as provided in the Enable argument. Take a look at each function’s
code:

bool cTrigger::get_enable_state(long id)
{
    
for(sTrigger* trig = m_root_trigger; trig != NULL; trig = trig->next)
    {
        
if(trig->id == id)
            
return trig->enabled;
    }

    
return false;
}

void cTrigger::set_enable_state(long id, bool state)
{
    
for(sTrigger* trigger = m_root_trigger; trigger != NULL; trigger = trigger->next)
    {
        
if(trigger->id == id)
            trigger->enabled = state;
    }
}

cTrigger::get_num_triggers and cTrigger::get_root_trigger

As I like to do with all my classes, I have included two functions that you can use to
retrieve the number of sTrigger structures in the linked list as well as the pointer to
the first structure (the root, or parent, structure) contained with the list.

 

Using Triggers

As I promised in the section, “Using Map Triggers,” you now revisit using files to store triggers
on a map, this time using the cTrigger class created in the section “Creating a Trigger Class.”
In this section, you find out how to define and load a trigger file effectively.

 

Defining a Trigger File

You start with a sample trigger data file (called test.trg):

1 0 1 -900 0 900 620
2 1 0 0 0 0 100 100 100
3 2 1 100 10 200 20 100
4 3 0 10 10 10 -100 -50 0 0 100

The first trigger (ID# 1) is a sphere located at -900,0,900 with a radius of 620. The
second trigger (ID# 2) is a box that covers the area from 0,0,0 to 100,100,100. The
third trigger (ID# 3) is a cylinder; its lower-middle point is at 100,10,200, it has a
radius of 20, and it extends up 100 units. The fourth trigger (ID# 4) is a triangle
that encloses the area from 10,10 to 10,-100 to -50,0; it has a Y-coordinate (the bottom
of the triangle) of 0 and extends 100 units upward. Notice that all other triggers
are disabled by default.

 

Loading a Trigger File

To load the trigger file, instance the cTrigger file and call Load:

cTrigger Trigger;
Trigger.load(“test.trg”);

 

Touching a Trigger

Finally, to see whether a trigger is touched by a character, call GetTrigger with the
character’s coordinates:

long TriggerID;
TriggerID = Trigger.get_trigger(CharXPos, CharYPos, CharZPos);
 

if(TriggerID)
  MessageBox(NULL, “Trigger touched!”, “Message”, MB_OK);

With this admittedly simplified example of loading and using the cTrigger class
under your belt, you might want to work through the Mapping example program
to get more experience with creating, loading, and checking for character-to-trigger
collisions using the cTrigger class.


posted on 2007-12-10 11:34 lovedday 閱讀(165) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發(fā)表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


公告

導航

統(tǒng)計

常用鏈接

隨筆分類(178)

3D游戲編程相關鏈接

搜索

最新評論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲每日更新| 亚洲精品三级| 尤物网精品视频| 国产一区日韩二区欧美三区| 国产日韩精品久久| 国产午夜精品麻豆| 激情欧美一区| 亚洲精品一区二区在线| 在线一区二区日韩| 亚洲一区自拍| 久久久久久久一区| 欧美护士18xxxxhd| 亚洲在线视频| 久久免费偷拍视频| 免费成人av资源网| 午夜精品一区二区三区电影天堂 | 极品裸体白嫩激情啪啪国产精品| 国产综合久久| 亚洲伦理在线免费看| 亚洲欧美日本在线| 欧美电影免费观看大全| 这里只有精品丝袜| 久久久久国色av免费看影院 | 欧美色道久久88综合亚洲精品| 国产日韩一区二区| av成人免费在线| 免费一级欧美片在线播放| 99re这里只有精品6| 久久久人成影片一区二区三区 | 久久影视三级福利片| 亚洲国产综合91精品麻豆| 亚洲精品国产拍免费91在线| 久久精品人人做人人综合| 欧美日韩成人在线观看| 在线观看91久久久久久| 性亚洲最疯狂xxxx高清| 亚洲电影免费观看高清| 久久成人精品视频| 国产精品美女久久久| 一本高清dvd不卡在线观看| 老司机精品久久| 亚洲欧美国产精品桃花| 欧美精品一区在线观看| 亚洲国产成人av| 久久伊人精品天天| 欧美一区二区视频观看视频| 国产精品久久久久77777| 一区二区久久久久| 亚洲欧洲日本在线| 免费亚洲一区二区| 在线国产精品一区| 麻豆免费精品视频| 久久精品一区二区国产| 国产欧美日本在线| 亚洲一区欧美| 一区二区免费在线观看| 欧美日韩你懂的| 制服诱惑一区二区| 99re这里只有精品6| 欧美日本精品| 在线性视频日韩欧美| 亚洲全部视频| 欧美日韩国产成人在线91| 亚洲另类在线一区| 亚洲人成亚洲人成在线观看| 国产精品免费看| 亚洲午夜羞羞片| 日韩亚洲欧美一区二区三区| 欧美激情1区2区3区| 亚洲日韩欧美一区二区在线| 亚洲成色777777女色窝| 欧美国产日韩一区二区在线观看 | 国产日韩成人精品| 久久亚洲国产成人| 久久这里有精品视频| 91久久黄色| 一区二区三区精品视频在线观看 | 国产精品午夜视频| 欧美一区二区三区日韩视频| 欧美一级视频| 激情小说另类小说亚洲欧美| 亚洲国产99精品国自产| 国产精品播放| 老色批av在线精品| 欧美区亚洲区| 久久激情综合| 男人的天堂成人在线| 亚洲视频二区| 久久午夜视频| 亚洲愉拍自拍另类高清精品| 久久成人精品电影| 正在播放亚洲一区| 久久夜色精品| 午夜伦理片一区| 久久人人爽人人| 亚洲图片欧洲图片av| 欧美在线观看视频在线| 亚洲精品婷婷| 欧美淫片网站| 亚洲一区二区综合| 美女主播精品视频一二三四| 亚洲欧美在线视频观看| 麻豆av一区二区三区久久| 午夜精品久久久久久久| 欧美高清在线精品一区| 久久精品久久99精品久久| 欧美日韩成人网| 亚洲电影免费| 在线免费不卡视频| 欧美一区二区三区的| 亚洲性感美女99在线| 老司机67194精品线观看| 一区二区三区精品视频| 狼人社综合社区| 久久综合久久综合九色| 国产精品私人影院| 一区二区欧美视频| 亚洲精品影院| 欧美1区2区3区| 免费在线观看一区二区| 国产色综合网| 亚洲综合国产精品| 亚洲网友自拍| 欧美日韩亚洲一区二区三区四区 | 国产日本欧美视频| 亚洲毛片在线看| 99re热精品| 欧美国产日本| 亚洲国产精品一区二区第四页av | 欧美日本韩国一区二区三区| 欧美大片一区二区| 在线观看日韩av电影| 久久久亚洲人| 美女视频黄a大片欧美| 精品动漫av| 可以免费看不卡的av网站| 免费成人av| 亚洲第一综合天堂另类专| 久久精品日韩| 欧美成人性生活| 日韩视频国产视频| 欧美日韩国产123区| 国产精品99久久久久久久女警| 亚洲一区二区三区高清| 国产精品女同互慰在线看| 亚洲女人天堂av| 久久综合九色综合网站| 91久久精品视频| 欧美日韩一二三四五区| 9l国产精品久久久久麻豆| 亚洲一区3d动漫同人无遮挡| 国产伦精品一区二区三区高清| 欧美一区二区三区久久精品 | 亚洲欧美成人在线| 国产精品香蕉在线观看| 欧美在线国产| 亚洲国产黄色| 在线亚洲精品| 国产欧美日韩视频一区二区| 久久av在线看| 亚洲风情亚aⅴ在线发布| 亚洲精品中文字幕在线观看| 国产精品久久久久久久久久尿 | 久久久青草婷婷精品综合日韩| 免费中文字幕日韩欧美| 日韩亚洲一区二区| 国产精品日韩一区二区三区| 久久高清国产| 亚洲精品久久久久久一区二区| 亚洲欧美综合另类中字| 韩国美女久久| 欧美三级日韩三级国产三级| 欧美在线资源| 亚洲另类在线视频| 久久人人精品| 一区二区三区四区五区精品| 国产在线视频不卡二| 欧美精品不卡| 久久男女视频| 午夜精品久久久| 亚洲人体影院| 蜜臀av在线播放一区二区三区| 亚洲婷婷在线| 亚洲美女av网站| 伊人久久亚洲影院| 欧美日韩一区二区三区在线看 | 午夜精品久久久久久久99水蜜桃| 国产一区亚洲| 欧美日韩精品免费观看| 欧美在线观看日本一区| 日韩午夜免费视频| 亚洲二区精品| 欧美成人中文字幕| 久久久精品国产一区二区三区| 亚洲一品av免费观看| 亚洲精品一二三| 91久久国产综合久久蜜月精品 | 国产精品高潮在线| 欧美jizzhd精品欧美喷水| 久久成人这里只有精品|