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

牽著老婆滿街逛

嚴以律己,寬以待人. 三思而后行.
GMail/GTalk: yanglinbo#google.com;
MSN/Email: tx7do#yahoo.com.cn;
QQ: 3 0 3 3 9 6 9 2 0 .

COLLISION DETECTION

來源:http://www.cs.brown.edu/courses/gs007/lect/sim/web/murat.html


COLLISION DETECTION

Importance

Why is collision detection slow?

Explosive Growth

Using the formula: Number of collision tests = (n² -n)/2

Objects                Collision Tests
2                          1
3                          3
4                          6
.                          .
.                          .
.                          .
20                          190

 

O(n²)

Eliminating Collision Tests

  • Redundant Tests

     

  • Game Rules

    • e.g. spaceship game where you don't want the aliens to shoot each
      other, so you don't care about collision detection between the alien
      misiles and alien ships.
  • Eleminations based on spatial positioning such as axis sorting and the sector method

    • Axis Sorting

      Sprite Number 		X-Coordinate		Sprite Width
              1			    10 			    10
              2			    15			    5
              3 			    18			    8
              4 			    40			    10
              5			    45			    10
              

       

    • Sector Method
  • Collision Testing
    • Bounding Based
    • Pixel Based
    To find more detailed information on these just click here.



    Two collision-detection algorithms that we are going to discuss




    I-COLLIDE- An incremental algorithm for collision detection between solid models.

    • I collide is based on temporal and geometric coherence

      • What is temporal and geometric coherence?

        • Property that the state of the application does not change significantly between successive time steps or simulation frames.

         

      • By exploiting coherence we are able to trim down the number of pairwise object and feature tests involved in each iteration.

         

      • For n objects,the worst case running time for any collision detection algorithm is O(n²) this is also true for I-collide.

         

      • However, running time of I-Collide for n objects is O(n+m) where m is the number of objects very close to each other.
    Two objects are very close if their axis aligned bounding boxes overlap.

    What are bounding boxes?

    • Fixed-Size Bounding Cubes:

      • We compute the size of the fixed cube to be large enough to contain the object at any orientation ?

         

      • The cube is defined by a center and radius.

         

      • Easy to recompute as the position changes.

         

      • Well suited for dynamic enviroments. Works well with objects which are nearly spherical.

         

      • At each time step the cube is recomputed as follows:
        • 1. Transform the center by using one vector matrix multiplication.

           

        • 2. Compute the min and max x , y, z coordinates by subtracting and adding the radius from the coordinates of the center.

           

        • step 1 is only one vector matrix multiplication

           

        • step 2 is just 3 additions and 3 subtructions
      e.g.



    • Dynamically Rectangular Bounding Boxes:

      • We compute the size of the rectangular bounding box to be the thightest axis aligned box contain the object at a particular orientation.
      • It is defined by its min and max x, y and z coordinates (up to 6 of its vertices).As an object moves, its minima and maxima is recalculated
      • For oblong objects rectangular objects fit better than cubes resulting in fever overlaps.
      • This is an advantage as long as only few objects ore moving.

        e.g.


    Sweep and Prune

    • Sorting the bounding boxes surrunding the objects is the key to the sweep and prune approach.

       

    • It is not intuitively obvious how to sort bounding boxes in 3 space.

       

    • One way is dimension reduction approach.
      • First thing we do is to project each 3-dimensional bounding box onto the x,y and z axes.

         

      • We are interested in overlaps. Because a pair of bounding boxes can overlap if and only if their intervals overlap in all three dimensions.

         

      • We construct 3 lists, one for each dimension.

         

      • Each list contains the value of the end-points of the intervals corresponding to that dimension.

         

      • By sorting these lists, we can determine which intervals overlap.

         

      • In general such a sort will take O(n log n) time However we can reduce this time if we keep the sorted lists from the previous frame, changing only the values of the interval endpoints.

         

      • Since there will be relatively small movements between frames the lists will be nearly sorted so we can sort in expected O(n) time using Insertion Sort.


    • Two- Dimensional Intersection Tests

      • Project each 3-dimesional axis-aligned bounding box onto any of the two of the x-y, y-z, x-z planes.

         

      • Each of these projections are rectangles in 2 space so there are fewer overlaps of these 2-D rectangles than the 1-D intervals used by the Sweep and Prune Technique.

         

      • In cases where projection on the one-dimension causes densly clustered intervals the two dimensiona technique is more efficient.



    • Other Alternatives:

      • Binary Space Partitioning (BSP trees), octrees, etc..

         

      • Several practical and efficient algorithms are based on uniform space division.
          Divide Space into Unit Cells: To check for collision, examine the cells occupied by each object. However choosing a near-optimal cell size is difficult and failing to do so results in large memory usage and computational inefficiency



    This page is created by Murat Gorguner

    IMPULSED BASED SIMULATION

    The two fundamental requirements you want in dynamic simulation:

    • physical accuracy
    • computational efficiency - can it run in real time
    Impulsed based simulation attempts to fulfill these two requirements

    Constraint based vs. impulsed based simulation

    dealing with contact

    In constraint based simulation:

    Example - ball rolling along a table top

    • -force which table exerts on ball is a constraint force that doesn't do work on the ball but exerts a non-penetration constaint

       

    • -force isn't modeled explicit but accounted for by a constraint on the ball - one of the ball`s coordinates is held constant

       

    • -problem - constaints may change over time, e.g. ball rolls off the table, hits an object on the table
      • -keeping track of the changing constraints in order to calculate the correct motion of the ball can get complicated

       

    • -also, impacts create impulses, not constraint forces and must be handled separately

       

    In impulsed based simulation

    Example - ball resting on table top

    • -no constraints are placed on moving objects

      =7F

    • -unification of all types of contact under a single model
      • -model used for collisions can be used for instances where an object is rolling or resting on another object
      • -not necessary to classify different contact types or deal with them in different ways

       

    • -in the example, ball is experiencing many tiny collisions with the table - microcollisions

      Does impulsed based simulation result in physically accurate simulations?

    • Yes, microcollision contact produces correct behavior

      Is it fast enough for simulation purposes?

    • Yes, the large number of collisions which must be calculated does not prohibit real-time simulation

    Procedure for implementing impulsed based simulation

    First, you assume objects travel in ballistic trajectories when not colliding with anything

    For each object, a bounding box is created to enclose the path of an object over a time interval, this is done at the beginning of each frame -a good interval is the frame rate =3D 1/30 seconds

    Intersections between the boxes are found, calculated to take O(n(1 + log R)) time where R is ratio of largest to smallest box size

    If two boxes don't intersect, objects won't collide in the next frame so no distance or time of impact calcuations have to be done

    If they do, the Lin-Canny closest features algorithm is used - same one as in I_COLLIDE -the shortest possible time to collision is calclulated

    Each pair is inserted in a heap sorted by time of collision, e.g. pair that= =20 will collide first will be at the top

    Time step is inceremented until the time of collision of the top pair

    L in-Canny algorithm is done again to find distance between the two objects - collision when distance falls below an epsilon which is at least 3 orders of magnitude smaller than the dimensions of the objects

    • if collision, do collision resolution, calculate new bounding volumes= =20 for the objects, intersect =09 these new boxes with the others and update the heap accordingly

    Drawbacks to this detection system:

    Since ballistic trajectory is assumed you can't have any forces all of a=20 sudden affect an =09 object's trajectory - no user interface possible after the initial forces

    This is OK for a pool game but not for most other games

    Solution:=7F Calculate bounding box that will encompass the maximum displacement an=20 object =09 can go over the time interval

    Consequences: More collision detection needed since boxes may be bigger and a it's=20 possible most =09 of the intersecting volumes will produce no collisions when thought was=20 expected =09 since the position of the object in the box varies on the forces enacted

    But User Interaction can happen!

    Computing collision impulses

    When two bodies collide, an impulse must be applied to a body so there is no= =20 interpenetration; the impulse applied to the other body is the negative of the impulse

    Once impulse is knowm, you can compute the linear velocity for center of=20 mass and angular velocity and algorith can continune

    You don't want to assume frictionless collisions or perfectly elastic=20 collisions, we want to model the real world, unless you're in space

    3 assumptions for collisions:

    1) Infinitesimal collision time

    - The duration of a collision is= =20 negligible compared to the time over which simulated objects move.

    Therefore

    a)the configurations of two objects may be taken as constant over the= =20 entire collision - even in simulations, it's just overkill to calculate the deformity and=20 rebounding of an object during a collision

    b)the effect of one object on another can be described as an impulse which= =20 gives rise to instantaneous change in linear and angular velocities of an object

    2) Poisson's hypothesis

    P_total =3D (1 + e) * P_max_compression

    e =3D constant between 0 and 1, dependent on object's material, called= =20 coefficient of restitution

    P_total =3D magnitude of normal component of the impulse done by one=20 object onto the other overthe entire collision

    =09 P_max =3D magnitude of normal component of the impulse done by one object= onto the other up to the point of maximum compression

    if e =3D 1, collision is totally elastic

    if e =3D 0, collision is totally plastic, objects stick together afer= collision

    P_max_compression is easy to characterize, it's the point at which the= normal component of the relative contact velocity vanishes.

    3)Coulomb friction

    u =3D contact velocity of object 1 realtive to object 2

    u_t =3D tangential component of u

    u_^t =3D unit vector in direction of u_t

    f_n =3D normal component of force exerted by object 2 on object= 1

    f_t =3D tangentialcomponent of force exerted by object 2 on= object 1

    m =3D coefficient of friction

    if u_t !=3D 0 ----> f_t =3D -m * abs(f_n) * u_^t

    if u_t =3D 0c ----> abs(f_t) <=3D m * abs(f_n)

  • posted on 2008-01-15 15:30 楊粼波 閱讀(455) 評論(0)  編輯 收藏 引用


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


    青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            久久亚洲私人国产精品va| 久久中文久久字幕| 国产精品久久久久久久久借妻| 亚洲精品一区二区三区婷婷月| 亚洲第一偷拍| 欧美精品在线观看| 在线午夜精品自拍| 亚洲免费视频网站| 国产一区日韩二区欧美三区| 免费不卡在线观看av| 欧美jizz19性欧美| 亚洲专区欧美专区| 久久国产加勒比精品无码| 亚洲国内自拍| 一本色道综合亚洲| 激情另类综合| 日韩视频精品在线观看| 国产精品久久久久久久7电影 | 国产精品久久久久久久久久久久久| 亚洲婷婷综合久久一本伊一区| 亚洲与欧洲av电影| 亚洲黄色影院| 亚洲视频综合| 在线观看国产欧美| 99国产精品久久久久久久成人热| 国产伦精品一区二区三区照片91 | 亚洲激情一区| 亚洲精品一区二区三区不| 国产精品久久久久国产精品日日| 久久精品人人做人人爽电影蜜月 | 亚洲午夜精品福利| 激情成人av| 日韩视频在线观看国产| 国外视频精品毛片| 一区二区精品国产| 亚洲大胆视频| 午夜精品电影| 一区二区欧美视频| 久久久久99| 午夜精品影院在线观看| 欧美不卡三区| 久久精品论坛| 国产精品外国| 亚洲毛片在线| 亚洲精品久久久久久久久| 欧美在线日韩| 性欧美暴力猛交另类hd| 欧美激情影音先锋| 免费亚洲电影| 国产亚洲精品一区二区| 亚洲视频一二| 亚洲视频在线一区观看| 欧美va亚洲va国产综合| 久久亚洲免费| 国产在线精品成人一区二区三区 | 免费不卡中文字幕视频| 国产精品视频第一区| 亚洲精品久久久久中文字幕欢迎你 | 午夜精品久久久久久久蜜桃app | 亚洲国产欧美精品| 欧美专区日韩专区| 午夜亚洲福利| 国产精品色一区二区三区| 亚洲毛片一区二区| 夜夜狂射影院欧美极品| 欧美电影免费网站| 欧美激情按摩在线| 亚洲级视频在线观看免费1级| 久久青青草综合| 免费日韩精品中文字幕视频在线| 精品91在线| 久久青草欧美一区二区三区| 蜜桃av一区二区| 亚洲国产黄色| 欧美久久久久久久久| 日韩午夜激情电影| 亚洲一区二区三区免费观看| 欧美三级黄美女| 亚洲视频一区在线观看| 欧美亚洲午夜视频在线观看| 国产日韩精品视频一区| 欧美一区二区在线| 蜜乳av另类精品一区二区| 亚洲电影有码| 欧美日韩www| 亚洲欧美文学| 免费不卡亚洲欧美| 一本色道久久综合狠狠躁篇的优点 | 欧美日韩免费高清一区色橹橹| 99精品国产在热久久下载| 亚洲欧美另类在线观看| 国产日韩久久| 欧美成人午夜激情在线| 亚洲精品一区二区网址| 翔田千里一区二区| 黄色成人91| 欧美日韩亚洲一区二区三区| 亚洲欧美成aⅴ人在线观看| 久久女同互慰一区二区三区| 亚洲人成小说网站色在线| 欧美日韩一区二区三区四区五区| 亚洲少妇自拍| 欧美激情精品久久久久久蜜臀| 亚洲午夜精品视频| 一区二区在线不卡| 欧美日韩一本到| 久久久久网站| 亚洲视频大全| 亚洲福利国产| 久久蜜桃精品| 亚洲一本视频| 亚洲第一二三四五区| 国产精品国产三级国产普通话三级 | 老司机久久99久久精品播放免费| 亚洲精品一级| 黑人极品videos精品欧美裸| 欧美激情综合五月色丁香| 性欧美精品高清| 亚洲免费av观看| 欧美aa在线视频| 欧美一区二视频| 99热免费精品| 亚洲第一久久影院| 国产毛片一区二区| 欧美性一区二区| 欧美大片在线看| 久久久999| 久久国产一区二区三区| 亚洲少妇自拍| 在线视频欧美日韩精品| 亚洲黄一区二区三区| 久久免费黄色| 久久久久久久久综合| 亚洲综合色在线| 一本色道久久综合亚洲精品不卡 | 国产精品久久久久久久久久久久 | 国产精品wwwwww| 欧美日韩视频免费播放| 欧美成人综合一区| 另类欧美日韩国产在线| 久久久国产亚洲精品| 久久精品国产69国产精品亚洲 | 欧美电影在线观看| 久久综合给合久久狠狠色| 久久精品国产亚洲一区二区三区| 亚洲欧美韩国| 欧美一区二区日韩一区二区| 午夜在线不卡| 久久精品日产第一区二区三区| 午夜日本精品| 久久久国产一区二区| 久久九九久精品国产免费直播| 久久成人av少妇免费| 久久九九99| 欧美~级网站不卡| 欧美国产第一页| 亚洲人成7777| 99精品国产在热久久| 亚洲一区二区精品视频| 亚洲欧美日韩天堂一区二区| 午夜亚洲激情| 久久久综合网站| 欧美精品久久久久久久久老牛影院 | 老牛影视一区二区三区| 美女精品一区| 欧美视频日韩视频在线观看| 国产九九精品| 亚洲国产日韩一级| 在线一区视频| 久久黄金**| 欧美电影免费网站| 日韩视频一区二区在线观看| 亚洲男女自偷自拍| 久久精品国产第一区二区三区最新章节| 欧美一区=区| 免费在线观看成人av| 欧美视频手机在线| 国产在线成人| 亚洲少妇在线| 久久一区二区三区国产精品 | 日韩亚洲一区在线播放| 亚洲男人第一网站| 美国十次成人| 国产精品久久久久久一区二区三区| 国产在线成人| 亚洲视频一区二区| 久久婷婷国产麻豆91天堂| 亚洲人成亚洲人成在线观看图片| 亚洲一区二区三区免费观看 | 欧美午夜在线视频| 在线观看亚洲视频啊啊啊啊| 亚洲视频中文字幕| 美女主播一区| 亚洲女优在线| 欧美日韩亚洲国产一区| 在线播放国产一区中文字幕剧情欧美| 在线中文字幕不卡| 欧美激情精品久久久久久免费印度| 亚洲一区二区三区久久| 欧美国产精品va在线观看|