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

天行健 君子當自強而不息

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


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


公告

導航

統計

常用鏈接

隨筆分類(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久久精品牛牛影视| 国产欧美69| 韩国一区电影| 激情久久婷婷| 亚洲视频在线观看一区| 亚洲欧美在线x视频| 久久精品女人天堂| 亚洲国产欧美日韩精品| 亚洲精品欧美专区| 午夜精品福利一区二区三区av| 久久精品夜色噜噜亚洲a∨| 久久精品国产亚洲5555| 欧美日韩在线观看一区二区| 国产精品盗摄一区二区三区| 欧美aaa级| 午夜精品成人在线| 欧美高清视频一二三区| 国产欧美一区二区三区在线老狼| 91久久久久久| 久久久久久穴| 午夜精品久久久久久99热| 欧美日韩国产免费观看| 韩日欧美一区| 久久综合九色九九| 午夜精品久久久久| 国产精品中文字幕在线观看| 午夜精品福利一区二区三区av| 亚洲人成高清| 欧美日韩综合在线| 日韩午夜免费视频| 欧美国产亚洲视频| 欧美电影免费网站| 亚洲另类在线视频| 亚洲精品小视频| 国产精品久久久久久久久免费 | 一区二区三区免费在线观看| 久久久在线视频| 久久久久久夜| 亚洲国产日韩在线一区模特| 91久久精品国产91性色tv| 欧美精品久久一区| 香蕉久久精品日日躁夜夜躁| 一本久久a久久免费精品不卡| 欧美亚日韩国产aⅴ精品中极品| 亚洲人妖在线| 亚洲欧美一级二级三级| 欧美影院成人| 亚洲国产成人porn| 一本久道久久综合中文字幕| 国产日韩欧美中文| 亚洲人体大胆视频| 国产精品mm| 另类尿喷潮videofree| 国产精品日韩在线播放| 欧美成人资源网| 欧美电影免费观看| 国产欧美不卡| 亚洲一区二区三区免费在线观看 | 国产精品av免费在线观看| 欧美在线亚洲综合一区| 欧美日韩精品不卡| 欧美激情a∨在线视频播放| 国产精品久久久久久亚洲毛片| 亚洲国产精品成人综合| 国产尤物精品| 久久久久久综合| 久久久久免费视频| 国产亚洲综合精品| 新67194成人永久网站| 久久国产天堂福利天堂| 国产真实乱偷精品视频免| 欧美一区视频| 米奇777在线欧美播放| 亚洲国产毛片完整版| 久热精品在线| 亚洲日本国产| 最新成人av在线| 欧美日韩视频| 欧美在线精品一区| 亚洲国产精品悠悠久久琪琪| 日韩一区二区高清| 制服丝袜激情欧洲亚洲| 久久国产精品高清| 亚洲精品国产日韩| 欧美亚洲综合另类| 亚洲精品社区| 国产日产亚洲精品| 欧美成人自拍| 久久aⅴ国产欧美74aaa| 99国产精品99久久久久久粉嫩 | 国产精品久久久一本精品| 午夜性色一区二区三区免费视频 | 亚洲图片欧洲图片av| 国产亚洲一级高清| 国产精品福利久久久| 老牛嫩草一区二区三区日本| 亚洲网站在线播放| 亚洲精品日产精品乱码不卡| 久久一区激情| 欧美在线观看视频| 久久aⅴ国产欧美74aaa| 亚洲尤物视频网| 亚洲视频狠狠| 亚洲免费小视频| 亚洲免费在线视频一区 二区| 亚洲国产精品第一区二区| 伊人久久大香线蕉综合热线| 国产毛片一区二区| 国产亚洲综合精品| 在线电影院国产精品| 国产欧美日韩在线观看| 国产精品久久一区二区三区| 国产精品高清网站| 国产精品天天看| 国产一区二区精品久久91| 国产日韩精品在线播放| 国产中文一区二区三区| 在线电影欧美日韩一区二区私密| 欧美一区二区在线视频| 99精品热视频| 日韩午夜精品视频| 亚洲欧美日韩国产综合在线| 欧美在线一区二区三区| 欧美大胆a视频| 国产精品区一区二区三| 在线看不卡av| 99精品免费网| 免费在线观看成人av| 亚洲精品社区| 老司机aⅴ在线精品导航| 国产精品视频不卡| 中文一区在线| 亚洲第一成人在线| 久久久久成人精品| 欧美性久久久| 亚洲另类自拍| 欧美国产先锋| 欧美在线一二三四区| 欧美日韩一区二区在线观看视频| 精品成人在线| 欧美jizz19hd性欧美| 亚洲欧美激情在线视频| 欧美无乱码久久久免费午夜一区 | 欧美激情一区| 激情五月***国产精品| 久久天堂国产精品| 久久精品国产在热久久| 国产一区二区三区四区hd| 欧美一级播放| 久久免费视频在线| 在线观看一区视频| 亚洲国产成人精品视频| 欧美电影在线| 久久精品水蜜桃av综合天堂| 国产精品一区二区男女羞羞无遮挡 | 激情久久影院| 欧美激情日韩| 欧美性猛交视频| 久久精品一区二区| 免费在线欧美黄色| 亚洲一区二区三区高清| 亚洲综合色婷婷| 国内外成人免费视频| 欧美激情一区二区三区高清视频 | 国产亚洲一级高清| 亚洲福利在线看| 国产精品扒开腿做爽爽爽软件| 欧美一区二区三区四区在线| 久久精品国产亚洲高清剧情介绍| 亚洲精品久久久久| 欧美在线视频观看| 亚洲午夜影视影院在线观看| 亚洲欧美www| 亚洲视频免费| 欧美精品久久久久久久免费观看 | 国产精品裸体一区二区三区| 久久这里有精品15一区二区三区| 欧美日产一区二区三区在线观看 | 久久国产一区二区| 亚洲欧美日韩在线一区| 欧美天堂亚洲电影院在线播放 | 亚洲欧美激情视频在线观看一区二区三区| 欧美与欧洲交xxxx免费观看| 亚洲尤物在线视频观看| 欧美成人中文字幕在线| 亚洲人成毛片在线播放| 亚洲国产精品免费| 欧美二区在线播放| 亚洲国产日韩欧美在线99| 久久精品一区二区国产| 久久综合久久综合这里只有精品| 国产日韩欧美一区二区| 久久国产精品第一页| 亚洲成色www久久网站| 一区二区精品| 国产亚洲毛片在线| 久久久欧美精品|