본문 바로가기
Bullet Physics

Actions: Vehicles & Character Controller

by ses jeon 2020. 12. 3.

Action Interface

In certain cases it is useful to process some custom physics game code inside the physics pipeline. Although it is possible to use a tick callback, when there are several objects to be updated, it can be more convenient to derive your custom class from btActionInterface. And implement the btActionInterface::updateAction(btCollisionWorld* world, btScalar deltaTime);  There are built-in examples, btRaycastVehicle and btKinematicCharacterController, that are using this btActionInterace. 

어떤 경우에는 물리 파이프 라인 내에서 커스텀 물리 게임 코드를 처리하는 것이 유용합니다. 틱 콜백을 사용할 수 있지만 업데이트 할 개체가 여러 개있는 경우 btActionInterface에서 사용자 지정 클래스를 파생하는 것이 더 편리 할 수 있습니다. 그리고 btActionInterface :: updateAction (btCollisionWorld * world, btScalar deltaTime); 이 btActionInterace를 사용하는 내장 예제, btRaycastVehicle 및 btKinematicCharacterController가 있습니다.

 

Raycast Vehicle

For arcade style vehicle simulations, it is recommended to use the simplified Bullet vehicle model as provided in btRaycastVehicle. Instead of simulation each wheel and chassis as separate rigid bodies, connected by constraints, it uses a simplified model. This simplified model has many benefits, and is widely used in commercial driving games. 

The entire vehicle is represented as a single rigidbody, the chassis. The collision detection of the wheels is approximated by ray casts, and the tire friction is a basic anisotropic friction model.  

See src/BulletDynamics/Vehicle  and examples/ForkLiftDemo for more details, or check the Bullet forums. 

Kester Maddock shared an interesting document about Bullet vehicle simulation here:

아케이드 스타일 차량 시뮬레이션의 경우 btRaycastVehicle에서 제공하는 단순화 된 Bullet 차량 모델을 사용하는 것이 좋습니다. 제약에 의해 연결된 별도의 강체로 각 휠과 섀시를 시뮬레이션하는 대신 단순화 된 모델을 사용합니다. 이 단순화 된 모델에는 많은 이점이 있으며 상업용 운전 게임에서 널리 사용됩니다. 전체 차량은 하나의 리지드 바디 인 섀시로 표현됩니다. 바퀴의 충돌 감지는 광선 투사에 의해 근사화되며 타이어 마찰은 기본적인 이방성 마찰 모델입니다. 자세한 내용은 src / BulletDynamics / Vehicle 및 examples / ForkLiftDemo를 참조하거나 Bullet 포럼을 확인하세요. Kester Maddock은 총알 차량 시뮬레이션에 대한 흥미로운 문서를 여기에서 공유했습니다.

http://tinyurl.com/ydfb7lm

 

Character Controller

A player or NPC character can be constructed using a capsule shape, sphere or other shape. To avoid rotation, you can set the ‘angular factor’ to zero, which disables the angular rotation effect during collisions and other constraints. See btRigidBody::setAngularFactor. Other options (that are less recommended) include setting the inverse inertia tensor to zero for the up axis, or using a angular-only hinge constraint. 
플레이어 또는 NPC 캐릭터는 캡슐 모양, 구체 또는 기타 모양을 사용하여 구성 할 수 있습니다. 회전을 방지하려면 '각도 계수'를 0으로 설정하여 충돌 및 기타 제약 조건 동안 각도 회전 효과를 비활성화 할 수 있습니다. btRigidBody :: setAngularFactor를 참조하세요. 덜 권장되는 다른 옵션에는 위쪽 축에 대해 역 관성 텐서를 0으로 설정하거나 각도 전용 힌지 제약 조건을 사용하는 것이 포함됩니다.
There is also an experimental3 btKinematicCharacterController as an example a non-physical character controller. It uses a btGhostShape to perform collision queries to create a character that can climb stairs, slide smoothly along walls etc. See src/BulletDynamics/Character and Demos/CharacterDemo for its usage.

비 물리적 캐릭터 컨트롤러의 예로 Experiment3 btKinematicCharacterController도 있습니다. btGhostShape를 사용하여 충돌 쿼리를 수행하여 계단을 오르거나 벽을 따라 부드럽게 미끄러지는 캐릭터를 생성합니다. 사용법은 src / BulletDynamics / Character 및 Demos / CharacterDemo를 참조하십시오.

 

 

 

'Bullet Physics' 카테고리의 다른 글

Bullet physics - collision world with libgdx  (0) 2021.03.25
BulletQuickstart  (0) 2020.12.15
Constraints  (0) 2020.12.03
Rigid Body Dynamics  (0) 2020.12.02
Collision Filtering (selective collisions)  (0) 2020.12.02

댓글