collition detection n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Collition Detection PowerPoint Presentation
Download Presentation
Collition Detection

Loading in 2 Seconds...

play fullscreen
1 / 14

Collition Detection - PowerPoint PPT Presentation


  • 147 Views
  • Uploaded on

Collition Detection. Agung Toto Wibowo http://gameprogramming.blog.ittelkom.ac.id. Pendahuluan. Collision detection komponen dasar dari game 3D/2D. Tanpa Collision detection, karakter mungkin saja menembus walls atau halangan lain. Aksi yang terjadi setelah collision detection :

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

Collition Detection


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
collition detection

Collition Detection

Agung Toto Wibowo

http://gameprogramming.blog.ittelkom.ac.id

pendahuluan
Pendahuluan
  • Collision detection komponendasardari game 3D/2D.
  • Tanpa Collision detection, karaktermungkinsajamenembus walls atauhalangan lain.
  • Aksi yang terjadisetelah collision detection :
    • Rule
    • Collision response
basic game loop
Basic Game Loop

while(1){

process_input();

update_objects();

render_world();

}

update_objects(){

for (each_object)

save_old_position();

calc new_object_position

{based on velocity accel. etc.}

if (collide_with_other_objects())

new_object_position = old_position();

{or if destroyed object remove it etc.}

}

rectangles collision detection
Rectangles collision detection
  • menggukan bound berbentukpersegi
  • Objekmemilikiruangkosong yang besardengan bound
    • Terkadangtidaktabrakandianggaptabrakan
  • boolIsSeparate( const CBox& box1, const CBox& box2 )
  • {
  • if ( ( box1.xMin > box2.xMax ) ||
  • ( box2.xMin > box1.xMax ) ||
  • ( box1.yMin > box2.yMax ) ||
  • ( box2.yMin > box1.yMax ) )
  • {
  • return true;
  • }
  • else
  • {
  • return false;
  • }
  • }
reduced size bounding box
Reduced size bounding box
  • kotakbatasnyadiperkecil : mengurangiukuran sprite sebenarnya
  • ruangkosongdapatdikurangi
multi bounding box
Multi Bounding Box
  • menggunakanbeberapa bounding box secarabersamaanpada sprite atauobjek
  • ruangkosonglebihdapatdikurangilagi
  • Konsekuensiwaktulebih lama
circle collision detection
Circle collision detection
  • batasberbentuklingkaran
  • Membandingkanjarakkeduaobjekdenganjumlah radius masing-masing bound
  • (ax-bx)2+(ay-by)2 < (ar+br)2
perpotongan garis
PerpotonganGaris
  • Note : Atw Issues
  • Objekakanbertabrakanjikaadagaris yang berpotongan.
  • Algortima ???
total sudut
Total Sudut
  • Perhatikansifatdari point yang adadidalamruangan
  • Total sudut = 360°
3d collision detection
3D Collision Detection
  • HOW????
  • Rectangles collision detection
  • Reduced size bounding box
  • Multi Bounding Box
  • Circle collision detection
  • PerpotonganGaris
  • Total Sudut
collision response
Collision Response
  • Rule
    • Batalkanpergerakan
    • Object mati/menghilang
  • Momentum
    • Kekekalanenergikinetik (hukumnewton)
  • Elastisitas
momentum
Momentum
  • Contohpadatabrakanmobil/motor/bola
  • Sumber : http://en.wikipedia.org/wiki/Elastic_collision
momentum1
Momentum
  • Untuk 2D/3D
diskusi
Diskusi
  • Pseudo code algorithm???
  • Problem???
    • Answer???
  • Dimana collision detection pada game anda?