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

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

Working with Maps and Levels(11)

Adding Barriers with cBarrier

Even though the barrier class marks areas on the map using geometric shapes in
exactly the same way as the trigger class does, the barrier class also positions meshes.
Looking again at the cBarrier class declaration, notice that each of the add barrier
functions — add_sphere, add_box, add_cylinder, and add_triangle—have a set of coordinates
that position and rotate the barrier’s mesh before being rendered.

To determine where the mesh is positioned, set the x_pos, y_pos, and z_pos arguments
of the add barrier functions to where you want the mesh rendered. You also need
to set the x_rot, y_rot, and z_rot arguments to the rotational values to draw the mesh.

For example, say that you want to add a spherical barrier that already has a mesh
assigned. The barrier is positioned at coordinates 10,20,30 (with a radius of 40),
while the mesh is positioned at 10,0,30 using no rotational values. To add the barrier,
you call the add_sphere function as follows:

cBarrier::add_sphere(1, TRUE,
                     10.0f, 0.0f, 30.0f, 0.0f, 0.0f, 0.0f,
                     10.0f, 20.0f, 30.0f, 40.0f);

You get a better understanding of adding and using barriers in the next section.

 

Using the Barrier Class

Using the barrier class is not difficult; it’s much like using the trigger class. The
biggest difference is that you have to add object placement data to the barrier data
files and assign the appropriate meshes and animations.

 

Creating the Barrier Data File

The barrier data files are arranged just like trigger data files, except that you start
each barrier definition with the identification number, type, enabled flag, placement
coordinates (X, Y, Z), and rotations (X-rotation, Y-rotation, and Z-rotation) to
place the barrier graphics object. Finish each definition with the respective barrier
type’s data.

The following defines two barriers to use (contained in a file called test.bar). Note
that the coordinates and rotational values of the barrier are shown in bold:

1 1 1 -900 0 0 0 0 0 -1154 0 10 -645 100 -10
2 1 0 0 0 -900 0 1.57 0 -10 0 -1154 10 100 -645

Here are two barriers, both using a box shape. The first barrier’s graphics object is
placed at -900,0,0 and has rotational values of 0,0,0. The first box covers the area
from -1154,0,10 to -645,100, -10.

The second barrier has a graphics object placed at 0,0, -900 and has rotational values
of 0,1.57,0. The second barrier covers the area from -10,0,-1154 to 10,100,-645.

 

Loading the Barrier Data

In order to load and use a barrier data file, instance the cBarrier class, load the data
file and appropriate meshes, and assign the meshes:

cBarrier Barrier;

// Load a barrier data file
Barrier.Load(“test.bar”);

// Load a mesh and animation to use
cMesh Mesh;
cAnimation Anim;
Mesh.Load(“barrier.x”);
Anim.Load(“barrier.x”, &Mesh);

// Assign mesh and animation to both barriers loaded
Barrier.SetMesh(1, &Mesh);
Barrier.SetMesh(2, &Mesh);
Barrier.SetAnim(1, &Anim, “AnimationName”, 0);
Barrier.SetAnim(2, &Anim, “AnimationName”, 0);

 

Checking Barrier Collisions

To see whether an area on the map is blocked, call get_barrier with the character
coordinates. If a value of TRUE is returned, passage is blocked, and you should take
appropriate actions. Take the following example that checks a character’s coordinates
against all barriers loaded from the barrier list.

You use a trio of values that represents the direction the character is moving in
each axis to determine beforehand whether the movement is blocked by a barrier.
Say that a character is moving 10 units in the position Z-axis, meaning that the
upcoming ZMove variable will be set to 10. That ZMove variable is added to the character’s
current position, and if intersecting with a barrier, that ZMove variable is cleared
out, thus not allowing such a movement along the axis, as shown here:

// XPos, YPos, ZPos = character coordinates
// XMove, YMove, ZMove = character movement values
if(Barrier.get_barrier(XPos+XMove,YPos+YMove,ZPos+ZMove)) {
  // Passage not allowed, clear movement variables
  XMove = YMove = ZMove = 0.0f;
}

 

Rendering Barriers

Last, you only need to call cBarrier::Render to draw all barrier objects within view:

// Frustum = pre-initialize cFrustum object
Barrier.render(timeGetTime(), &Frustum);

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


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


公告

導(dǎo)航

統(tǒng)計(jì)

常用鏈接

隨筆分類(178)

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

搜索

最新評(píng)論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            欧美成人免费网站| 欧美在线3区| 在线日韩av片| 欧美日韩三区四区| 午夜国产不卡在线观看视频| 亚洲激情自拍| 新狼窝色av性久久久久久| 国产麻豆9l精品三级站| 欧美怡红院视频一区二区三区| 欧美一二区视频| 国产精品婷婷午夜在线观看| 蜜桃精品久久久久久久免费影院| 亚洲人成网在线播放| 久久9热精品视频| 国产精品尤物福利片在线观看| 一本大道久久a久久综合婷婷| 亚洲另类自拍| 亚洲高清电影| 欧美日韩免费观看一区=区三区| 久久国产精品久久w女人spa| 亚洲精品韩国| 国产精品一区一区| 亚洲国产精品精华液2区45| 永久久久久久| 国产精品一区视频网站| 亚洲人体1000| 亚洲在线成人精品| 一本综合久久| 免费久久精品视频| 欧美中文字幕不卡| 欧美一级精品大片| 欧美伊人久久久久久午夜久久久久| 亚洲你懂的在线视频| 亚洲国产精品久久久久婷婷老年| 亚洲视频欧美在线| 99热精品在线观看| 亚洲第一福利在线观看| 国内外成人在线| 欧美日韩午夜剧场| 欧美精品久久久久久久久老牛影院| 久久蜜桃精品| 久久久人成影片一区二区三区观看| 亚洲一二三区在线| 一区二区三区欧美视频| 亚洲综合成人在线| 亚洲一区二区视频在线观看| 国产精品99久久99久久久二8| 亚洲在线一区二区| 久久躁日日躁aaaaxxxx| 1024日韩| 久久网站热最新地址| 日韩手机在线导航| 老司机午夜精品视频| 国产精品综合| 国产一区二区日韩| 欧美一区二区性| 亚洲精品免费在线| 一本一道久久综合狠狠老精东影业 | 销魂美女一区二区三区视频在线| 久久综合色88| 亚洲精品四区| 蜜桃av一区二区| 欧美夜福利tv在线| 久久综合色8888| 亚洲欧美视频在线观看视频| 欧美另类视频| 亚洲午夜精品网| 欧美亚洲日本一区| 国产欧美 在线欧美| 久久久噜噜噜久久| 久久爱www久久做| 1769国产精品| 欧美一区二区国产| 欧美视频在线一区二区三区| 亚洲国产一二三| 国产一区二区三区精品久久久| 亚洲视频专区在线| 久久精品成人一区二区三区蜜臀| 国产视频一区二区三区在线观看| 久久婷婷蜜乳一本欲蜜臀| 久久久人成影片一区二区三区| 亚洲人成小说网站色在线| 亚洲乱码国产乱码精品精可以看| 欧美欧美全黄| 亚洲伊人伊色伊影伊综合网| 欧美aⅴ一区二区三区视频| 久久久女女女女999久久| 国产精品免费看片| 亚洲国产精品传媒在线观看| 国语自产精品视频在线看8查询8 | 欧美激情一区二区三区在线视频观看 | 99国产精品视频免费观看一公开 | 亚洲毛片在线看| 久久精品国产99| 亚洲成人原创| 欧美系列亚洲系列| 亚洲性感美女99在线| 欧美一区二区三区的| 国产日韩欧美精品| 久久久蜜桃一区二区人| 国产乱码精品一区二区三| 欧美日韩第一区日日骚| 91久久精品久久国产性色也91| 欧美aⅴ一区二区三区视频| 猫咪成人在线观看| 欧美一区二区三区免费大片| 久久久久久久久久久久久女国产乱| 亚洲国产欧美日韩精品| 国产精品99久久久久久www| 狠狠色噜噜狠狠色综合久| 韩国一区二区三区在线观看| 欧美黑人在线观看| 国语自产在线不卡| 日韩视频一区二区三区在线播放| 国产区亚洲区欧美区| 日韩午夜激情av| 亚洲精品视频一区二区三区| 亚洲一区二区av电影| 亚洲国产精品黑人久久久| 亚洲欧美日韩一区二区在线| 99天天综合性| 另类春色校园亚洲| 久久一区二区三区超碰国产精品| 欧美午夜www高清视频| 久久一综合视频| 国产在线精品成人一区二区三区| 亚洲女同在线| 一区二区欧美视频| 欧美激情性爽国产精品17p| 美国十次了思思久久精品导航| 国产精品久久亚洲7777| 亚洲人成亚洲人成在线观看| 久久综合给合久久狠狠色| 红桃视频国产一区| 亚洲欧美日韩视频二区| 国产毛片久久| 女人天堂亚洲aⅴ在线观看| 亚洲女性裸体视频| 亚洲精品国久久99热| 亚洲高清在线精品| 亚洲综合电影| 亚洲欧美日韩国产一区二区| 欧美高清视频在线| 亚洲福利视频三区| 欧美在线短视频| 在线日韩中文| 欧美视频二区| 久久久蜜臀国产一区二区| 一二三区精品| 欧美不卡视频| 亚洲精品五月天| 亚洲欧美国内爽妇网| 国产一区二区三区日韩| 久热综合在线亚洲精品| 亚洲国产清纯| 麻豆成人小视频| 久久琪琪电影院| 日韩视频在线免费观看| 免费在线亚洲欧美| 欧美成人蜜桃| 在线一区二区视频| 在线观看91精品国产麻豆| 亚洲人成7777| 久久精品人人爽| 91久久极品少妇xxxxⅹ软件| 欧美理论电影网| 久久综合九色99| 亚洲视频在线观看视频| 亚洲精品久久久久久久久久久| 久久香蕉精品| 欧美在线综合| 一本高清dvd不卡在线观看| 国产一区二区三区在线观看免费 | 欧美日韩在线播放一区| 午夜亚洲影视| 久久亚洲精品一区| 久久九九热免费视频| 亚洲欧美视频在线| 亚洲欧美日韩在线观看a三区 | 亚洲第一在线综合网站| 最近中文字幕mv在线一区二区三区四区| 久久美女艺术照精彩视频福利播放| 久久久激情视频| 亚洲综合第一| 欧美精品v日韩精品v国产精品| 欧美国产日产韩国视频| 久久国产精品一区二区三区四区| 国产日本欧美一区二区三区| 欧美片网站免费| 欧美大片在线观看一区| 欧美午夜精品理论片a级按摩| 玖玖国产精品视频| 欧美日韩国产精品一区二区亚洲| 亚洲美女黄色| 欧美在线1区| 嫩模写真一区二区三区三州| 免费观看不卡av| 午夜电影亚洲| 一区二区三区高清在线| 免费视频久久|