• <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>

            天行健 君子當(dāng)自強(qiáng)而不息

            Working with Maps and Levels(3)

            Sphere Triggers

            You define sphere triggers (see Figure 17.1) by a set of coordinates and a radius.
            Sphere triggers have two unique benefits:

            ■ Spheres are perfect for defining large areas of a map as a trigger, only using
            the center coordinates and a radius to define the location of the sphere.

            ■ The sphere trigger is one of the fastest ways to check for character-to-trigger
            collisions in the map trigger engine.

            Box Triggers

            A box trigger uses bounding boxes to work its magic. Box triggers are the fastest triggers
            to process when looking for character-to-trigger collisions, but on the downside,
            box triggers can exist only parallel to the world’s axis (the boxes can’t be rotated to
            fit your needs). You define box triggers by the coordinates of its opposing corners, as
            illustrated in Figure 17.2.

             

            Cylinder Triggers

            Cylinder triggers are much like sphere triggers, except that with a cylinder trigger,
            you can limit the height of the covered area (unlike a sphere trigger, which extends
            higher as the radius increases). Cylinder triggers are most effective when used for circular
            areas in which you want to keep the height of the trigger from extending into
            higher or lower levels. Check out an illustration of cylinder triggers in Figure 17.3.

             

            Triangle Triggers

            A triangle trigger is similar to a polygon in that both are defined by three points; however,
            a triangle trigger’s three points are defined only by their X- and Z-coordinates.
            This makes the triangle two-dimensional. To make the triangle work in a 3-D world,
            you must assign a single Y-coordinate at which all three points of the triangle are
            placed, as well as the height in which the triangular area extends upward. It helps to
            think of a triangle trigger as a three-sided box, as shown in Figure 17.4.

             

            Triggering a Trigger

            After you place the trigger shapes on the map, it’s a simple matter to determine
            which trigger is touched by a character. Each trigger has its special way of determining
            these character-to-trigger collisions. A sphere uses distance checks, a box
            uses bounding box calculations, and a cylinder uses bounding and distance
            checks—although the triangle trigger uses bounding checks and also makes sure
            that the point in question is contained within the triangle.

            When you determine that a trigger has sprung, what do you do? Because each trigger
            is assigned an identification number, you can use that number to determine
            which action to perform. You can execute a matching script or perform
            another hard-coded function. In fact, in the later section “Using Triggers,” you
            find out how useful it is to use triggers.

            posted on 2007-12-09 15:14 lovedday 閱讀(222) 評(píng)論(0)  編輯 收藏 引用


            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問(wèn)   Chat2DB   管理


            公告

            導(dǎo)航

            統(tǒng)計(jì)

            常用鏈接

            隨筆分類(lèi)(178)

            3D游戲編程相關(guān)鏈接

            搜索

            最新評(píng)論

            蜜桃麻豆www久久国产精品| 97久久精品国产精品青草| 久久综合丁香激情久久| 久久亚洲高清观看| 综合久久给合久久狠狠狠97色| 国产99久久久国产精品小说| 中文字幕热久久久久久久| 99久久777色| 狠狠色丁香婷婷久久综合| 久久天天躁狠狠躁夜夜avapp| 国产精品一久久香蕉国产线看| 狠狠久久综合伊人不卡| 精品无码久久久久国产动漫3d | 无码人妻久久久一区二区三区 | 日韩va亚洲va欧美va久久| 人妻精品久久无码专区精东影业 | 日韩va亚洲va欧美va久久| 久久精品aⅴ无码中文字字幕不卡 久久精品aⅴ无码中文字字幕重口 | 久久最近最新中文字幕大全 | 无码人妻少妇久久中文字幕蜜桃| 国内精品久久久久久久coent| 无码国内精品久久人妻蜜桃| 国产ww久久久久久久久久| 97精品依人久久久大香线蕉97| 国产亚州精品女人久久久久久 | 99999久久久久久亚洲| 一本一道久久a久久精品综合| 久久亚洲精品中文字幕三区| 亚洲成色WWW久久网站| 99精品国产免费久久久久久下载| 国产成人久久777777| 91久久福利国产成人精品| 久久夜色精品国产亚洲| 久久精品一区二区国产| …久久精品99久久香蕉国产| 色欲综合久久中文字幕网 | 国产69精品久久久久9999| 人人狠狠综合久久亚洲88| 国产精品天天影视久久综合网| 久久精品国产清高在天天线| 久久精品aⅴ无码中文字字幕重口 久久精品a亚洲国产v高清不卡 |