Game Physics & Collision
Rigid-body dynamics, stable integration, collision detection, contact solvers and particle-based cloth. Interviewers probe it because physics bugs are everyday gameplay bugs.
on this pageshowhide
explore
- Rigid-Body Dynamics5 questions
- Integration & Timesteps5 questions
- Broad-Phase Collision5 questions
- Narrow-Phase Collision5 questions
- Continuous Collision Detection5 questions
- Collision Response & Constraints5 questions
- Physics Queries & Character Control6 questions
- Physics Engines & Tuning5 questions
- Cloth and Soft Bodies6 questions
questions
page 2 of 2A simulated cape clips into the hero's legs and through its own folds during a sprint; how do you diagnose and fix cloth collision and self-collision?
basics
~20 sGive the cloth a collision thickness, collide it against simple body proxies moved smoothly across substeps, keep each particle's travel per substep below that thickness, and test self-collision only between nearby particles that are not neighbours in the rest pose.
In physics middleware, what do the contact distance and the penetration slop control, and what symptoms show each is set too small or too large?
basics
~20 sContact distance is how far apart shapes may be when a contact is already created; penetration slop is overlap that correction deliberately leaves alone. Too small gives late contacts and jitter; too large gives sinking, snags and extra cost.
When a rigid-body simulation misbehaves, how do you choose between more velocity iterations, more position iterations, substeps or a shorter fixed step?
basics
~20 sRule out units and mass ratios, then match knob to symptom: velocity iterations for sliding stacks and soft joints, position iterations for lingering overlap and separating joints, substeps for stiffness, and a shorter step when collision detection itself is too coarse.
Velocity Verlet and RK4 both beat Euler on accuracy; what does each cost per physics step, and why do rigid-body engines rarely use RK4?
basics
~20 sVelocity Verlet needs one force evaluation per step and is second-order and symplectic. RK4 needs four, is fourth-order but not symplectic, and assumes smooth forces; contacts are not smooth, so engines spend that budget on substeps instead.
A capsule body rests on a convex rock; how do GJK distance with collision margins and EPA together give its penetration depth and normal?
basics
~20 sA capsule is a core segment plus a radius: GJK distance measures core to rock, depth is radius plus rock margin minus that distance, and the normal joins the closest points. Only overlapping cores need EPA, which expands GJK's simplex to the boundary.
How does GJK decide whether two convex shapes intersect, using the Minkowski difference, support functions and its simplex cases?
basics
~20 sGJK tests whether the origin lies inside the Minkowski difference of the two shapes without building it: support points grow a simplex of up to four points toward the origin until it encloses the origin or a new point falls short of it.
How do you build a stable box-box contact manifold when two tumbling boxes settle face to face but rock and jitter on one deepest point per frame?
basics
~20 sBuild several points at once: clip the other box's most anti-parallel face against the side planes of the reference face that won the separating-axis test, keep points below it, reduce to four, and match them across frames by feature ids.
A kinematic character controller standing on a moving lift lags behind it and slides off a rotating platform; how should the controller ride moving platforms?
basics
~20 sTrack the platform under the character; each step, after the platform moves, carry the character by the platform's displacement at its foot point, rotation included, then apply its own movement. On leaving, inherit the platform's velocity at that point.
A third-person character controller catches on stair edges going up and goes briefly airborne on each step going down; how do a step offset and ground snapping fix it?
basics
~20 sGoing up, a step-up pass lifts the capsule by the step height, moves it forward and casts back down onto the tread if it is walkable. Going down, ground snapping casts down after each move and pins a grounded character to the surface.
Why must a rigid body's inertia tensor be rotated into world space each step, and how does skipping it make a thrown crate tumble wrongly?
basics
~20 sThe inertia tensor is constant only in body space, but torques arrive in world space, so each step it must become R · I_body · Rᵀ (inverse likewise). Using the body tensor directly is right only while the crate is unrotated.
Which bodies in a racing game should get continuous collision detection, and how do you weigh it against substeps and thicker colliders?
basics
~20 sGive continuous collision only to bodies that move farther per step than their size plus the thinnest geometry they meet, and whose escape would break the game, like cars against barriers. Thicken thin content first; substep only if everything needs it.
When a game needs many simulated capes and flags at once, how do you decide between simulating cloth on the CPU or the GPU, and what changes in the solver?
basics
~20 sWeigh cloth count and particle budget against who already uses each processor's frame time, whether gameplay must read the cloth back, and platform spread; on the GPU, Gauss-Seidel order gives way to Jacobi averaging or graph-coloured batches.
How would you set a physics determinism policy for replays when a replay recorded on one platform diverges on another?
basics
~20 sDecide first whether replays must play across platforms. If so, either enable the middleware's cross-platform determinism and enforce identical inputs, order and versions, or record body states instead of inputs; checksums per step locate divergence.
What must a deterministic physics step guarantee for input-recorded replays such as time-trial ghosts, and how far should a team take determinism?
basics
~20 sSame start state and inputs must give bit-identical state: a fixed step length, fixed substep and iteration counts, a stable processing order, no clock reads or unseeded randomness, and all hidden state restored. The scope is the lead's decision.
Should a game's player character be a kinematic character controller or a dynamic rigid body, and how would you decide for a project?
basics
~20 sNeither is always right: a kinematic controller gives precise, designer-tuned movement but every physical interaction must be coded; a dynamic body gets pushing, knockback and riding objects from the solver but fights it on slopes, steps and walls.
How can a jelly-like soft body keep its volume and rest shape in a particle simulation, and how do volume constraints compare with shape matching?
basics
~20 sA volume constraint holds the signed volume of a closed mesh, or of each tetrahedron, at its rest value; shape matching fits the rest shape to the current particles with the best rotation and pulls each particle toward its fitted position.
What are the Newton-Euler equations for a rigid body, and what does the gyroscopic term ω × (Iω) contribute to its rotation?
basics
~20 sNewton-Euler gives F = m·a for the centre of mass and τ = I·dω/dt + ω × (Iω) for rotation. The gyroscopic term arises because the world-space inertia turns with the body; it keeps angular momentum, not angular velocity, constant without torque, producing wobble.
showing 31–47 of 47