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

            天行健 君子當自強而不息

            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 閱讀(219) 評論(0)  編輯 收藏 引用

            公告

            導航

            統計

            常用鏈接

            隨筆分類(178)

            3D游戲編程相關鏈接

            搜索

            最新評論

            久久久久人妻一区精品果冻| 一本久道久久综合狠狠爱| 久久国产亚洲高清观看| 久久精品人人做人人爽电影| 久久国产精品久久| 亚洲国产香蕉人人爽成AV片久久 | 久久久久av无码免费网| 欧美日韩久久中文字幕| 精品乱码久久久久久久| 日本欧美国产精品第一页久久| 亚洲精品午夜国产VA久久成人 | 亚洲欧美成人久久综合中文网| 亚洲国产精品狼友中文久久久| 久久99精品久久久久久动态图| 精品久久久无码中文字幕| 亚洲AV日韩精品久久久久久久| 国产三级观看久久| 国产精品免费看久久久| 亚洲国产精品综合久久网络| 欧美激情精品久久久久| 日韩精品久久无码中文字幕| 亚洲乱码日产精品a级毛片久久 | 很黄很污的网站久久mimi色| 欧美黑人又粗又大久久久| 亚洲精品乱码久久久久久蜜桃 | 久久久国产精品福利免费| 麻豆精品久久久久久久99蜜桃| 狠狠人妻久久久久久综合蜜桃| 77777亚洲午夜久久多喷| 狠狠综合久久综合88亚洲| 亚洲精品美女久久久久99小说| 国产免费久久精品99久久| 国产精品99久久久久久猫咪| 日本福利片国产午夜久久| 国产精品9999久久久久| 精品久久久久久无码专区| 久久精品国产亚洲av麻豆色欲| 久久久精品2019免费观看| 久久夜色精品国产欧美乱| 波多野结衣AV无码久久一区| 精品国产青草久久久久福利|