Weekly Notes (12/52)-a book on game physics engine development ...

Source: Internet
Author: User
Tags constant

Frankly speaking ... The labored degree of reading ... Reminds me of the horror of being abused in that year. But the scary thing is, I know that this shouldn't be hard to understand ...
So, how to say, self-improvement bar ~ Two a non-rotating collision calculation can be abstracted as the following questions:

The mass of two objects is M1, M2, the velocity is V1, v2, the collision normal is n (with V1 as the reference), the percentage of momentum lost when the collision is r, need to demand the speed after the collision. calculation method: in the direction of n vertical, velocity is constant, only the velocity change in n direction is calculated, and the velocity change in n direction is understood and calculated by centroid system. tip: when storing object quality, use the inverse of quality: 1/m1, 1/m2, which covers both the infinity and the upper calculation. calculation of the rotation part principle inertia tensor
A single particle in a three-dimensional space can use a 3x3 matrix to describe his inertia tensor:

I=⎧⎩⎨⎪⎪ixixyixziyxiyiyzizxizyiz⎫⎭⎬⎪⎪ (1) I = \left\{\begin{matrix} i_x & I_{yx} & I_{zx} \ \ I_{xy} & i_y & I_{zy} \ I_{xz} & I_{yz} & I_z \end{matrix} \right\} \tag{1}
The normal rigid body rotation can be simulated by proper parameter matching
2. Pneumatic tensor
For objects affected by wind speed, such as sailing and wings, can be simulated by pneumatic tensor, in order to achieve the best results, can be set when the wind speed reaches the maximum minimum, and then the actual wind speed interpolation.
3. For buoyancy, the object can be divided into blocks and calculate the buoyancy, respectively, to simulate the sailing boat overturning and other situations.

Collision Range DetectionSpherical bounding box
The father surrounded all the children; whether the child belongs to the left or the right depends on where it is. Minimum multi-resolution mesh for RADIUS growth of the sphereCollision DetectionIrregular objects can use a series of regular geometries (boxes and spheres) to simulate collisions between the balls and the box, depending on the point, edge, and polygon contact, in a variety of situations, by proper segmentation:
Calculates the deepest intersection, the Normals only one intersection in each frame, and joins them in the intersection; If the object is moving, then it is likely that the subsequent frame will no longer be invalidated; Here you can store only the information of the collision without storing the information of the object.Collision HandlingThe steps are as follows:
Calculate the various local coordinate systems at the collision point to facilitate the use of the collision points at the rearspeed Change value per unit of impulse, note that both linear motion and angular motion have to be considered based on the value above, calculating the velocity variation of the collision at the point of calculating its corresponding impulse changes to change the impulse change to linear velocity and angular velocity changes per unit impulse velocity change value:
Linear component: The inverse rotational component of mass: the separation of the force direction (collision normal) and the reciprocal of the cross product to the collision point to the centroid distance
If the direct normal direction,Linear translationTwo objects until they are separated (the time it takes to go so far before they are calculated), the object that comes from the side will appear to "rub" the surface over a certain distance. Can joinRotateSeparation, although not fully simulating the real situation, but has been very good relaxation method
Deal with a small amount of content at a time, making the results more balanced to prevent excessive rotation
When the object is small and fast, it may result in no separation, no matter how it is rotated. When another point of the object is about to collide, the rotation can cause another collision to simply specify the maximum rotational distance, the excess part shifts to the linear motion, but the suggestion can be based on the size of the object, small objects may need a large upper limitStatic ContactReaction: A small collision with a reaction force: applying a series of smaller impulses
Removes the acceleration-based velocity data from the previous update operation for low-speed collisions, reducing its rebound coefficient selectivity by ignoring gravity friction
You can use the aforementioned micro-collision method to include rotation and panningStability and optimizationFour-dollar drift
The error causes the four-dollar number to be no longer standardized: the intersection on a standardized ramp should be done in a timely manner
Constant intersection and separation causes the object on the bevel to move downward: when calculating the velocity change caused by acceleration, set the component in the normal direction to 0 of the calculated error per frame:
The calculation of the speed of each frame is actually treated as a constant rate for each frame, when the acceleration is large and the actual discrepancy, at this time can be used distance-acceleration when the acceleration between each frame varies greatly, such as spring, can be usedRunga-kutta pointsSet thresholds when sleeping intersect, to handle error conditions you can set the grouping according to the collision situation

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.