Games104 Modern Game Engine Study Notes 10

Physics Actors and Shapes

Actor Static: static actor, such as baffles, etc.
Actor Dynamic: dynamic actor, such as movable boxes
Trigger: trigger
Actor-Kinematic: violates physical principles, is determined by design, does not follow real physical principles,
anti-physical objects can easily lead to a lot of mathematical operations problem appear

Insert image description here
Insert image description here
Triangle Meshes generally only allow static objects to be used
Height Fields are usually used for terrain

Shape attributes:
1. Mass, density
2. Center of mass (vehicle system, center of mass is the key point)
3. Physical material: friction, elasticity

Force: force
Insert image description here
impulse; force multiplied by time
Insert image description here
Movement

There is no external force, uniform motion. Insert image description here
Acceleration is directly proportional to the size of the force and inversely proportional to the mass of the object. Insert image description here
Insert image description here
Changing force
Insert image description here

Euler method: Display Euler integrals. Relatively simple, but energy is not conserved and cannot converge.
Insert image description here
Implicit Euler method: use future forces to solve inversely. Energy will decay, but due to the existence of friction and air resistance, the decay of energy is usually not felt.
Insert image description here
Semi-implicit Euler method: Use the current force to find the future speed according to Newton's second law, and then use the speed to find the distance. (i.e. the force is assumed to be constant). Generally relatively stable. However, for simple harmonic motion, cos, sin, etc., the calculated period will be slightly longer than the actual period. causing phase difference
Insert image description here

Rigid Body Dynamics: Rigid body dynamics
Insert image description here
R: rotation attitude (matrix, quaternion)
w: angular velocity
a: angular acceleration
I: moment of inertia
L: angular momentum
t: moment arm
Insert image description here
Insert image description here
Application:
The force in the blue direction is decomposed into a force directed towards the center of mass and pointing tangential force
Particle dynamics: energy conservation, the motion of the center of mass must still be consistent with the direction of the blue force Torque
: form angular impulse, divide the angular impulse by the moment of inertia to get the angular velocity, that is, the rotational speed Preliminary
Insert image description here
screening: AABB-box, follow Some boxes with the same axis direction can quickly calculate whether they can collide.
Step 2: Specifically calculate the exact collision point, collision direction, and collision depth.
Insert image description here
Insert image description here
Broad phase:
1.BVH Tree
2.sort and sweep
Insert image description here
Insert image description here
Insert image description here
convex hull collision detection: Minkovsky subtraction ,GJK algorithm

Separating axis theorem
Insert image description here

Raycast

sweep

overlap

Collision grouping
Insert image description here
CCD: Set a safe distance. When the safe distance is exceeded, a denser step size detection will be performed. Prevent direct passage through objects between two steps

Guess you like

Origin blog.csdn.net/Mhypnos/article/details/130938403