GAMES103:刚体模拟笔记
2 Math
Tetrahedral Volume
Barycentric Weights
Particle-triangle Intersection
First, we find 𝑡 when the particle hits the plane:
We then check if 𝐩(𝑡) is inside or not.
Singular Value Decomposition
\[ A=UDV^T \] Any linear deformation can be decomposed into three steps: rotation, scaling and rotation
Symmetric Positive Definiteness (s.p.d.)
A is s.p.d. if only if: \(v^T A𝐯>0\), for any 𝐯≠0.
A is symmetric semi-definite if only if: \(v^T A𝐯≥0\), for any 𝐯≠0. \[ 𝑎_{𝑖𝑖}>∑_{𝑖≠𝑗}|𝑎_{𝑖𝑗} | \forall 𝑖 \] A diagonally dominant matrix is p.d. Finally, a s.p.d. matrix must be invertible: \[ A^{−1}=(U^T )^{−1} D^{−1} U^{−1}=𝐔D^{−1} U^T. \]
Linear Solver
A direct solver is typically based LU factorization, or its variant: Cholesky, LDLT, etc… When A is sparse, L and U are not so sparse. Their sparsity depends on the permutation. (See matlab)
It contains two steps: factorization and solving. If we must solve many linear systems with the same A, we can factorize it only once.
Cannot be easily parallelized: Intel MKL PARDISO
Iterative Linear Solver
Tensor Calculus
3 rigid
Torque and Inertia
Translational and Rotational Motion
Rigid Body Simulation
Some More Implementation Issues
Translational motion is much easier to implement than rotational motion.
You can implement the update of 𝐪 first using a constant 𝛚. In that case, the object should spin constantly.
Gravity doesn’t cause any torque! If your simulator does not contain any other force, there is no need to update 𝛚.
4 Rigid Contact
Particle Collision Detection and Response
Signed Distance Function
A signed distance function 𝜙(𝐱) defines the distance from 𝐱 to a surface with a sign. The sign indicates on which side 𝐱 is located.
Penalty methods
Quadratic Penalty Method
\[ f\leftarrow −𝑘 \phi(x) N \] #### Quadratic Penalty Method with a Buffer \[ f\leftarrow 𝑘(\epsilon − \phi(x))N \] #### Log-Barrier Penalty Method \[ f\leftarrow \rho\frac{1}{\phi(x)}N \] #### A Short Summary of Penalty Methods * The use of step size adjustment is a must.
To avoid overshooting.
To avoid penetration in log-barrier methods.
Log-barrier method can be limited within a buffer as well.
Li et al. 2020. Incremental Potential Contact: Intersection- and Inversion-free Large Deformation Dynamics. TOG.
Wu et al. 2020. A Safe and Fast Repulsion Method for GPU-based Cloth Self Collisions. TOG.
Frictional contacts are difficult to handle.
Impulse methods
collision: \[ x^{new}\leftarrow x+|\phi(x)|N=x−\phi(x)∇\phi(x) \]
Rigid Collision Detection and Response by Impulse
Shape Matching
Basic Idea
Mathematical Formulation
pros and cons
- Easy to implement and compatible with other nodal systems, i.e., cloth, soft bodies and even particle fluids.
- Difficult to strictly enforce friction and other goals.
- The rigidification process will destroy them.
- More suitable when the friction accuracy is unimportant, i.e., buttons on clothes.
GAMES103:刚体模拟笔记