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

天行健 君子當自強而不息

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>
            国产一区二区三区在线免费观看| 一本久久a久久精品亚洲| 国产一区二区三区高清在线观看| 欧美日韩精品免费| 欧美日韩ab| 欧美深夜影院| 欧美日韩亚洲综合一区| 欧美人与禽猛交乱配视频| 欧美精品一区二区在线播放| 欧美日韩视频专区在线播放| 欧美视频在线视频| 国产精品入口日韩视频大尺度| 国产欧美日韩综合| 在线观看欧美| 这里只有视频精品| 久久精品国产久精国产一老狼 | 欧美黄色日本| 亚洲精品小视频在线观看| 亚洲一区二区高清视频| 欧美一级理论性理论a| 美女视频网站黄色亚洲| 欧美午夜寂寞影院| 精品99一区二区三区| 一区二区日韩欧美| 久久亚洲视频| 亚洲精品中文字| 午夜在线不卡| 欧美日韩国产亚洲一区| 国产一区白浆| 亚洲一区二区欧美日韩| 美腿丝袜亚洲色图| 亚洲一二三区在线观看| 免费观看成人| 国产人成一区二区三区影院| 亚洲日韩欧美视频| 久久人人97超碰国产公开结果| 日韩亚洲视频在线| 免费成人你懂的| 亚洲成人直播| 亚洲高清自拍| 午夜精品久久久久久久男人的天堂| 久久综合五月| 亚洲一区在线免费| 欧美日韩国产精品一区| 亚洲欧洲综合另类| 久久综合色播五月| 午夜精品视频| 国产精品美女久久久久aⅴ国产馆| 亚洲精品欧美日韩| 欧美大学生性色视频| 欧美影院一区| 国产日韩精品在线| 欧美一区二区三区四区在线观看地址| 亚洲人成亚洲人成在线观看| 欧美一区二区三区日韩视频| 国产精品久久中文| 亚洲免费网址| 亚洲色无码播放| 欧美视频在线观看一区| 在线视频你懂得一区| 最新高清无码专区| 欧美日本乱大交xxxxx| 99国内精品久久| 亚洲人屁股眼子交8| 欧美日韩黄视频| 亚洲午夜一区二区| 亚洲综合精品一区二区| 国产亚洲日本欧美韩国| 久久免费少妇高潮久久精品99| 欧美在线视频网站| 在线精品一区| 亚洲激情亚洲| 欧美视频在线一区| 欧美在线观看www| 久久精视频免费在线久久完整在线看| 黄色综合网站| 91久久黄色| 国产精品国产精品国产专区不蜜| 先锋影音久久久| 欧美在线精品免播放器视频| 亚洲第一在线| 一区二区三区四区蜜桃| 国产一区二区在线观看免费播放| 免费成人高清在线视频| 欧美精品黄色| 欧美主播一区二区三区美女 久久精品人| 欧美伊久线香蕉线新在线| 在线观看中文字幕不卡| 亚洲激情专区| 国产欧美精品日韩区二区麻豆天美 | 亚洲欧洲日韩在线| 亚洲精品视频免费| 国产精品高清在线| 美女精品自拍一二三四| 欧美精品午夜| 久久精品国产欧美激情| 欧美a级大片| 欧美一区二区三区在线播放| 欧美日韩视频专区在线播放| 欧美有码在线视频| 久久婷婷一区| 亚洲一区二区三区在线观看视频| 亚洲欧美日韩中文播放| 亚洲乱码国产乱码精品精可以看 | 久久国产精品99久久久久久老狼| 久久中文精品| 久久av最新网址| 欧美日韩精品不卡| 欧美freesex交免费视频| 国产精品美女久久久浪潮软件 | 欧美日韩国产小视频在线观看| 久久久一二三| 国产精品日韩一区| 亚洲精品免费观看| 亚洲第一福利视频| 午夜久久美女| 亚洲欧美成人在线| 欧美美女bb生活片| 欧美激情区在线播放| 韩国av一区二区三区在线观看| 一区二区精品在线观看| 99在线精品视频在线观看| 久久久久国色av免费观看性色| 午夜精品福利视频| 国产精品国产自产拍高清av| 亚洲韩国青草视频| 最新69国产成人精品视频免费| 欧美在线观看你懂的| 久久国产福利| 国产亚洲欧洲一区高清在线观看 | 亚洲国产成人porn| 在线观看欧美日本| 久久精品国产欧美激情| 欧美在线视频二区| 国产欧美精品日韩| 性欧美长视频| 久久久久久欧美| 好看的av在线不卡观看| 久久精品视频网| 免费成人激情视频| 亚洲经典在线看| 麻豆精品在线视频| 欧美激情亚洲激情| 日韩午夜精品视频| 欧美日韩色婷婷| 一区二区三区精密机械公司| 亚洲一区二区在线播放| 欧美性色综合| 午夜精品久久久久99热蜜桃导演| 久久电影一区| 一区二区在线观看av| 玖玖国产精品视频| 亚洲精品日韩激情在线电影| 亚洲一区视频| 国产欧美在线看| 久久伊伊香蕉| 一本色道久久88综合亚洲精品ⅰ| 亚洲欧美在线免费观看| 亚洲性xxxx| 欧美精品激情| 这里是久久伊人| 久久久国产精彩视频美女艺术照福利 | 日韩亚洲综合在线| 欧美日韩四区| 欧美一级专区| 欧美激情精品久久久久久变态| 亚洲激情专区| 国产精品久久二区二区| 欧美一区二区女人| 亚洲国产三级| 欧美在线亚洲| 99re6这里只有精品视频在线观看| 欧美视频一区在线| 久久精品中文字幕免费mv| 亚洲精品永久免费精品| 久久精品一区| 一区二区三区 在线观看视| 国产欧美一区二区视频| 欧美久久99| 久久精品91久久久久久再现| 亚洲日本乱码在线观看| 久久久久久久久久久一区| 一区二区三区高清不卡| 国产亚洲精品资源在线26u| 欧美精品自拍| 久久天堂精品| 欧美一区二区视频在线观看2020 | 欧美一区午夜精品| 亚洲狠狠婷婷| 另类av一区二区| 香蕉久久一区二区不卡无毒影院| 亚洲电影第1页| 国产亚洲精品7777| 国产精品xvideos88| 欧美激情综合在线| 欧美成人免费网站| 噜噜噜噜噜久久久久久91| 亚洲欧美日韩爽爽影院| 一区二区三区成人| 亚洲精品视频二区|