본문 바로가기

공부

총알물리! 입문

collision Configuration

Dispatcher
For the computer science function, see Dynamic dispatch. For the short-term scheduler in computer multitasking, also called dispatcher, see scheduling (computing).
http://en.wikipedia.org/wiki/Dispatcher

Another component involved in the CPU-scheduling function is the dispatcher. The dispatcher is the module that gives control of the CPU to the process selected by the short-term scheduler. This function involves the following:

  • Switching context
  • Switching to user mode
  • Jumping to the proper location in the user program to restart that program

The dispatcher should be as fast as possible, since it is invoked during every process switch. The time it takes for the dispatcher to stop one process and start another running is known as the dispatch latency. [Gravin, 155].
http://en.wikipedia.org/wiki/Scheduling_(computing)

Dispatcher 란, 대충 보니까, CPU 를 효율적으로 쓰기 위해서 스케쥴링 해주는 것 같다. 다음에 뭐할지~ 정하는거 (물론 다음타임에 실행가능한 일이어야겠지). 
일단 default collision dispatcher 를 쓰지만, parallel processing을 위해서, 다른 dispatcher 를 쓸 수도있다. (see Extras/BulletMultiThreaded) 

** 책참고 p.32 dispatcher: 
narrow phase 에 있어서 충돌감지를 행하는 대상의 조합 ( sphere & sphere, sphere & box, etc) 등, 조합에 따라 각각 다른 알고리즘을 적용시키는데, 조합을 보고 그것에 적합한 알고리즘을 적용하는 프로그램을 dispatcher 라고 한다.



 

Broadphase
충돌감지(collision detection) 에 쓰이는 방법? 같다. broad phase collision detection 으로 구글링하면 많은 자료가 나온다. collision detection 은 정말 유용한만큼 엄청나게 깊은 세계가 그 안에 펼쳐져 있다 ~_~ 그거슨 Computer Science의 세계! 
일단 btDbvtBroadphase는 좋은 일반목적 브로드페이즈라고 써져는 있는데, 자기말이니 뭐.. 믿거나 말거나.. broad-phase 랑 상반되는 개념으로는 narrow phase가 있는듯. 참고자료는 아래의 수업자료를 보면 될 것 같다.
http://www.cas.mcmaster.ca/~carette/SE3GB3/2006/notes/cd_pres.pdf

bullet에서는 Dynamic AABB tree 랑 Sweep and Prune(SAP) 이 제공되어 지는덧 하다.
http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=BtDbvt_dynamic_aabb_tree
btDbvtBroadphase 가 전자, btAxisSweep3 and bt32AxisSweep3가 후자. 
 
http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Broadphase 
http://en.wikipedia.org/wiki/Sweep_and_prune 

책 p.32 를 참고로 했을 때, 
broad phase: object 를 크게 몇그룹으로 나누는 알고리즘 
narrow phase: 그 그f룹안에서의 충돌을 감지하는 알고리즘


Constraint solver
parallel processing 하기위해, 다른 solver (see Extras/BulletMultiThreaded) 를 쓸 수 있다고 한다.



이렇게 해서, 환경설정? 을 대충 마치고, Discrete Dynamic World 를 만드는 것 같다.



그다음엔, 중력도 만들어 주고, 몇개 rigid bodies 도 만들어 주고 해야지!

collision shape
아 충돌에 쓰는 shape 인덧!! 그러니까 음 실체 object 랑 다른 그거 있잖아... 설명하기 어렵네.
뭐 box, cone, cylinder, convex hull, triangle mesh 등등이 있었던 것 같다. blender에선.
암튼 아래 링크에 가면, 이것저것 소스코드도 써있고 참고하길!!
http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Collision_Shapes
나중에 내가 시뮬레이션을 만들면 어떤걸 써서 어떻게 만들어야 할지 잘 생각해보자~