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

天行健 君子當(dā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 閱讀(200) 評論(0)  編輯 收藏 引用


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


公告

導(dǎo)航

統(tǒng)計

常用鏈接

隨筆分類(178)

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

搜索

最新評論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            亚洲福利免费| 亚洲黄色成人久久久| 亚洲视频香蕉人妖| 欧美日韩国产一级| 99视频精品| 日韩视频免费观看高清完整版| 欧美乱大交xxxxx| 亚洲免费一级电影| 欧美一级视频| 在线色欧美三级视频| 亚洲国产精品精华液网站| 欧美激情一区二区三区蜜桃视频| 日韩午夜精品| 亚洲欧美另类在线观看| 欲香欲色天天天综合和网| 亚洲国产精品一区二区第四页av| 欧美裸体一区二区三区| 先锋亚洲精品| 另类激情亚洲| 亚洲欧美日韩一区| 玖玖在线精品| 亚洲综合999| 久久久久久黄| 亚洲在线免费视频| 久热re这里精品视频在线6| 一区二区三区高清视频在线观看| 亚洲小说欧美另类婷婷| 影音先锋中文字幕一区| 一本在线高清不卡dvd| 精品二区视频| 亚洲一区二区在| 亚洲区第一页| 久久精品91久久久久久再现| 亚洲精品一区二区三区婷婷月 | 韩国福利一区| 亚洲欧洲偷拍精品| 极品少妇一区二区三区| 亚洲天堂久久| 亚洲精品乱码久久久久久| 亚洲一区日韩| 亚洲色图制服丝袜| 免费观看成人www动漫视频| 亚洲欧美国产日韩中文字幕| 久久综合给合久久狠狠狠97色69| 久久香蕉国产线看观看网| 亚洲午夜av在线| 噜噜噜久久亚洲精品国产品小说| 亚洲欧美成人| 欧美精品少妇一区二区三区| 久久午夜电影网| 国产精品一区二区久激情瑜伽| 亚洲国产欧美一区二区三区同亚洲 | 欧美在线视频在线播放完整版免费观看 | 亚洲欧洲av一区二区三区久久| 夜夜嗨一区二区| 美女性感视频久久久| 久久影院午夜论| 国产欧美一区二区三区国产幕精品 | 亚洲婷婷综合久久一本伊一区| 亚洲美女尤物影院| 免费永久网站黄欧美| 老鸭窝毛片一区二区三区| 国产亚洲欧美一级| 久久成人羞羞网站| 久久综合久久久久88| 国内久久视频| 久久久久久尹人网香蕉| 蜜臀久久99精品久久久画质超高清| 国产伦理一区| 欧美一级淫片aaaaaaa视频| 午夜伦欧美伦电影理论片| 国产精品毛片| 香蕉国产精品偷在线观看不卡| 欧美在线视频一区二区| 国产欧美一区二区三区视频| 亚洲一区二区视频在线| 久久黄色网页| 亚洲高清不卡av| 欧美激情一区二区三区在线| 亚洲精品影视在线观看| 亚洲中字黄色| 国产一区二区三区无遮挡| 久久久久在线观看| 亚洲七七久久综合桃花剧情介绍| 亚洲美女av电影| 国产精品久久久久久久久久尿| 午夜激情久久久| 蜜臀av性久久久久蜜臀aⅴ| 亚洲激情成人| 国产精品第一区| 久久精品人人做人人爽| 欧美国产专区| 亚洲一区二区三区在线| 韩国成人精品a∨在线观看| 欧美aⅴ99久久黑人专区| 99精品欧美一区二区蜜桃免费| 久久成人精品| 亚洲欧洲综合另类| 国产精品资源| 欧美第十八页| 亚洲欧美激情精品一区二区| 欧美国产1区2区| 香蕉久久一区二区不卡无毒影院| 精品69视频一区二区三区| 欧美日韩欧美一区二区| 久久精品国亚洲| 国产精品99久久久久久有的能看| 久久久蜜桃一区二区人| 99视频在线精品国自产拍免费观看| 国产精品每日更新| 欧美粗暴jizz性欧美20| 欧美一区激情| 一个人看的www久久| 噜噜噜躁狠狠躁狠狠精品视频| 亚洲无线视频| 亚洲人成亚洲人成在线观看| 国产日韩久久| 欧美日韩国产在线看| 久久久久久色| 久久er精品视频| 亚洲手机在线| 亚洲三级毛片| 亚洲福利电影| 欧美fxxxxxx另类| 久久精品国产2020观看福利| 亚洲天堂黄色| 这里只有精品视频| 亚洲美女av黄| 亚洲人久久久| 亚洲人成网站精品片在线观看| 国内精品久久久久影院薰衣草| 欧美午夜精品一区二区三区| 欧美韩国日本综合| 欧美xart系列高清| 免费日韩av片| 噜噜噜91成人网| 蜜桃久久av| 老司机午夜免费精品视频| 久久精品综合网| 久久久久国产免费免费| 久久精品一区二区三区四区| 亚洲欧美久久久久一区二区三区| 中日韩高清电影网| 亚洲少妇在线| 午夜精品久久久99热福利| 亚洲一二区在线| 亚洲香蕉伊综合在人在线视看| 亚洲视频成人| 欧美一区二区女人| 欧美在线观看你懂的| 久久疯狂做爰流白浆xx| 久久国产精品99国产精| 久久久亚洲国产天美传媒修理工| 欧美专区一区二区三区| 久久综合999| 欧美国产欧美综合 | 一本到高清视频免费精品| 日韩一二三在线视频播| 在线亚洲观看| 欧美一区二区三区视频在线| 久久不射2019中文字幕| 久久伊人精品天天| 欧美激情一区二区三区四区| 欧美日韩免费高清| 国产免费一区二区三区香蕉精| 国产乱码精品一区二区三区五月婷 | 午夜日韩激情| 久久综合给合| 亚洲国产三级网| 99re成人精品视频| 午夜精品久久久久久久99水蜜桃| 欧美在线一区二区三区| 久久影音先锋| 国产精品福利在线| 精品福利电影| 亚洲亚洲精品在线观看| 久久久精品国产免大香伊| 欧美国产欧美亚洲国产日韩mv天天看完整 | 美女露胸一区二区三区| 亚洲人成网站影音先锋播放| 亚洲一区二区在线免费观看视频 | 亚洲大胆人体在线| 亚洲小少妇裸体bbw| 久久精品一区二区三区四区| 欧美啪啪成人vr| 国产日韩成人精品| 日韩一区二区精品视频| 久久米奇亚洲| 99国产精品久久久久久久久久| 久久99在线观看| 欧美日本国产精品| 一区二区视频欧美| 先锋影音久久| 亚洲精品一区二区三区蜜桃久| 欧美一二三区精品| 欧美日韩国产精品自在自线| 国内视频一区| 午夜精品福利电影| 亚洲人体影院| 蜜臀av一级做a爰片久久|