) Bullet physical engine analysis [1]

Source: Internet
Author: User

Original post. For more information, see the source and author information.
This is your own bullet analysis.CodeNotes in the process, relatively simple, hope to attract others, welcome to the bricks

Author: Ma Liang (http://www.iphonephysics.com/) (this blog needs over GW)

Prerequisite
Physical Simulation in computer graphics is actually a pursuit of visual approximation rather than accurate physical simulation.
In addition, the physical engine does not share object data with the rendering engine using an independent set of data for simplified computing.
1. Architecture Analysis
Physical Simulation is based on some core geometric structures.
Core geometric concepts include:
Shape: shapes abstract geometric features, such as cubes, balls, cubes, and convex packets. there are dozens of shape types in bullet. because the features of a geometric shape are irrelevant to a specific object, you only need to maintain an instance of a shape. All objects mapped to the shape can share this instance.
You can find the concept of the bounded object hierarchy (BVl) in the book. Generally, AABB, OBB, K-dop, and convex hull. Bullet use AABB.
Space Division data organization node bullet uses AABB
The space partitioning data structure (usually tree) bullet mainly uses dynamic AABB tree (rigid body, it is worth noting that it uses the Manhattan distance) and sweep and prune (soft body)
Collision DetectionAlgorithm(There are also many options based entirely on the detection object. gjk and sweep prune are complex. box2box and shpere2shpere... are relatively simple.
Contact point (Contract point, manifold)
Constraints (six types of bullet are provided. See the bullet manual)
Motion State is an interface provided to the rendering engine to facilitate the rendering engine to update the rendering object location.

After the geometric foundation is built, Each simulated physical object (collision object) is added to a scenario (collision world). Each physical object is mapped to a mapped shape, partition Data Structure nodes. if you attach physical features such as speed, angular velocity, and moment of inertia to these objects, the object will be transformed into a rigid object. the soft body is more complex. It is usually composed of mesh and is still being analyzed.

The physical simulation process is divided into two main stages.

Broad phase: First, it performs a remote Collision Detection and uses a spatial split structure. If objects in different Subtrees cannot interwork, they do not need to be calculated. Objects in the same subtree are placed in overlapping pair, then, the corresponding algorithm is used to calculate information such as the contact point. which algorithm is used depends on the algorithm configuration matrix (see the bullet Manual)
Narrow phase: calculates the collision object Island (collision Island) based on the distribution of overlapping pairs ). then, the constraints of each island are analyzed in sequence. that is, the collision response. bullet uses Sequential Impulse constraintsolver (http://www.gphysics.com/archives/28) constraints analysis is a very complex topic, involving the simplification of the PGs algorithm, will be introduced later. the constraint analysis calculates the position and speed of each object after the collision based on the set constraint type, and then synchronizes the motion state with the rendering engine.

To be continued... (the collision response may be analyzed in detail, which is rarely involved in all types of literature)

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/superwiles/archive/2009/11/08/4784826.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.