Class: PhysicsManager

씬 객체에 물리효과를 적용하는 책임은 PhysicsManager이 맡는다. 물리효과를 적용할 객체들에게만 물리효과를 적용한다. 참고한 사이트 https://github.com/tutsplus/ImpulseEngine/ https://github.com/Kareus/SP2C/ https://kareus.tistory.com/15

Usage

                    
                        new PhysicsManager()
                    
                

Members

Methods

(static) update(scene, deltaTime)

씬 객체 내에 존재하는 오브젝트들중 물리효과가 켜진 오브젝트들에게 물리효과를 계산해 적용한다.

Parameters:
Name Type Description
scene GameObject

현재 씬

deltaTime number

이전 프레임과 현재 프레임의 시간차

(static) collectPhysicsEnabledGameObjectToList(scene)

씬 객체 내에 존재하는 모든 오브젝트들중 물리효과를 받는 오브젝트들만 모아 리스트에 담는다. 모든 객체를 조사해야하기 때문에 재귀호출하여 탐색한다.

Parameters:
Name Type Description
scene GameObject

현재 씬

(static) positionalCorrection(manifold)

충돌처리가 되었지만 서서히 빠져버리는 버그를 해결하기 위해 충돌된 위치에서 정해진 값만큼 강제로 떨어지게 한다.

Parameters:
Name Type Description
manifold Manifold

충돌체크의 결과