Virtual Reality 2: Virtual Physics
Foundations and Importance of Virtual Physics
Role of Physical Realism in Virtual Environments:
- User expectations within virtual reality (VR) are fundamentally rooted in everyday experiences of the physical world.
- Accurate simulation of physical behavior ensures that users can naturally relate to the virtual environment and intuitively anticipate how the environment responds to their actions.
- Subtle, ubiquitous physics (such as resting stability, gentle deceleration, and expected collision responses) are far more critical for user presence and comfort than rare, spectacular phenomena (such as complex explosions or catastrophic structural collapses).
Architectural Justification for Dedicated Physics Engines:
- Universality and Integration: Centralizing physics calculations into a unified software subsystem guarantees that all dynamic entities in the scene strictly obey identical physical laws and interaction rules.
- Market Specialization: Designing and implementing robust, high-performance, real-time physics engines requires deep mathematical, computational, and algorithmic specialization; dedicated middleware development teams produce significantly more reliable and optimized solutions than bespoke ad-hoc implementations.
Core Kinematic Terminology and Object Representations
Fundamental Kinematic Concepts:
- Vector: A mathematical quantity possessing both magnitude and spatial direction. Real-time game engines and physics engines almost exclusively utilize coordinate vectors defined across standard Cartesian spatial axes (, , ).
- Velocity: The vector rate of change of an object's position over time (, measured in ).
- Speed: The scalar magnitude of the velocity vector ().
- Direction: The normalized unit vector indicating the orientation of the velocity vector ().
- Acceleration: The vector rate of change of velocity over time (, measured in ).
- Deceleration: In physics and computational simulation, deceleration is not a distinct physical mechanism; it is simply acceleration directed opposite to the current velocity vector ().
Particle Representations:
- Definition: A particle is an idealized entity characterized by constant mass and an absence of any rotational orientation.
- Orientation vs. Direction: Orientation specifies the spatial direction in which an object points, which is mathematically independent of its direction of travel.
- Modeling Justification: Objects are represented as particles either because the simulated object physically lacks intrinsic orientation (e.g., point masses, fine dust, fluid droplets) or because the system deliberately disregards orientation to optimize computational performance.
Rigid Body Representations:
- Definition: A rigid body is an idealized entity that possesses a constant mass, maintains a definite orientation, and cannot deform or change its physical shape under any applied load.
- Euler's First Law of Motion: States that the center of mass of a rigid body translates through space in the exact same manner as a single particle possessing equivalent mass subjected to the same net force.
- Engine Implementation Pipeline: Physics engines treat the translational movement of every rigid object identically to a particle, subsequently adding supplementary rotational mathematics to calculate changes in orientation around its center of mass.
Simulation Timing, Discretization, and Interpolation
Temporal Discretization in Physics Simulation:
- Physical time in reality is continuous, whereas physics engines execute in discrete, sequential loop iterations.
- Each iteration of the engine loop advances the simulated world by a discrete interval of time (, commonly labeled
deltaTime), which may vary slightly frame-to-frame. - The core behavior and state of the physics engine are defined entirely by the mathematical operations performed at every discrete update step.
- Discretization introduces numerical inaccuracies, phase shifts, and boundary check failures that require algorithmic mitigations.
Interpolable vs. Non-Interpolable Physical Processes:
- Interpolable Process: A physical process whose state at any arbitrary future point in time can be computed analytically in a single step using closed-form equations.
- Example: An unconstrained object moving rectilinearly at a constant speed of . Its total displacement across an elapsed time is solved directly via simple scalar multiplication (), allowing perfect analytical reconstruction of continuous time.
- Non-Interpolable Process: A process whose state cannot be solved directly in a single closed-form step due to unpredictable discontinuities or conditional interactions (e.g., object collisions).
- To resolve a collision, the engine must simulate trajectory and contact evolution step-by-step using discrete increments.
- Simulating non-interpolable events requires selecting a bounded time-step duration; sufficiently small time steps yield behaviors that approximate continuous reality, though numerical approximations remain imperfect.
Newtonian Mechanics and the Fundamental Physics Loop
Classical Newtonian Foundations:
- Newton's First Law (Law of Inertia): An object remains in a state of rest or uniform motion at constant velocity unless compelled to change that state by an applied external force.
- Momentum is defined as mass multiplied by velocity ().
- Because mass is assumed constant in virtual physics, this law applies directly to velocity: in the absence of net external forces, velocity remains invariant.
- Newton's Second Law: The acceleration of an object is directly proportional to the applied net force and inversely proportional to its mass:
- Newton's Third Law: For every action force exerted on a body, there is an equal and opposite reaction force exerted back upon the interacting body:
The Minimalist Discrete Integration Loop:
- Early arcade titles (such as Asteroids) and contemporary baseline engines implement explicit Euler integration to advance objects forward each tick: ```c Vector velocity, position, acceleration; float deltaTime;
position = position + (velocity * deltaTime); velocity = velocity + (acceleration * deltaTime); ```
This loop updates position via current velocity multiplied by , then integrates acceleration into velocity for the subsequent step.
Resistance Forces: Drag and Damping
Physical Dissipation and the First Law:
- In the real world, dynamic bodies naturally decelerate over time because unobserved forces continuously act upon them.
- While friction applies only between solid surfaces in physical contact, fluid resistance (drag) acts universally across all objects immersed in air or fluid environments.
Mathematical Formulations of Drag:
- Full Aerodynamic Drag Force: Accurate aerodynamic resistance combines linear drag (dominant at low speeds) and quadratic drag (dominant at high turbulent speeds):
c drag = (-direction) * (speed * d1 + ((speed^2) * d2)); - Here, represents the coefficient of linear drag, and represents the coefficient of quadratic drag.
- Full aerodynamic computation is computationally expensive and generally unnecessary unless simulating specialized mechanics, such as motorsport vehicle dynamics or flight simulation.
- Full Aerodynamic Drag Force: Accurate aerodynamic resistance combines linear drag (dominant at low speeds) and quadratic drag (dominant at high turbulent speeds):
Numerical Damping Alternative: Everyday game physics replaces explicit drag forces with empirical damping, diminishing velocity geometrically every update frame:
c velocity = velocity * (damping ^ deltaTime); Damping provides an efficient, unconditionally stable approximation that mimics aerodynamic dissipation without per-frame square roots or polynomial evaluations.
Force Resolution, Inverse Mass, and D'Alembert's Principle
Inverse Mass Optimization:
- Applying Newton's Second Law requires solving for acceleration from force and mass:
- Division operations are significantly more computationally expensive on modern microprocessors than multiplication.
- Physics engines avoid runtime division by caching the scalar inverse mass () on each dynamic entity.
- Handling Immovable/Static Entities: Storing inverse mass allows static bodies (such as terrain, buildings, or immovable barriers) to be assigned an inverse mass of exactly zero (, representing ). As a result, any finite force applied to the entity yields zero acceleration (), naturally preventing static geometry from shifting.
Force Aggregation via D'Alembert's Principle:
- D'Alembert's Principle: When an object is subjected to multiple simultaneous external forces (), these vector quantities can be directly summed into a single equivalent net force vector:
- The physical effect of this resultant force vector is mathematically identical to the individual forces acting concurrently.
- Engines leverage this by accumulating all environment, spring, and interaction forces into an internal accumulator vector, evaluating the costly acceleration calculation exactly once per object per update cycle.
Rotational Dynamics and Torque
Rotational Kinematics for Rigid Bodies:
- Unlike particles, rigid bodies require rotational mechanics to govern orientation changes alongside linear translation.
- Torque (Rotational Force): Created when an applied force strikes a rigid body off-center, such that the extended line of action of the force does not pass through the object's center of mass.
Torque Mechanics and the Inertia Tensor:
- The rotational torque vector (measured in ) generated by an off-center contact force is computed using the vector cross product: where represents the displacement vector from the center of mass to the point of force application, and represents the applied force vector.
- Inertia Tensor: A matrix () representing the object's rotational inertia (distribution of mass around its principal axes). Angular acceleration () is solved via the rotational analogue of Newton's Second Law:

Virtual Gravity Modeling
- Simplification of Gravitational Physics:
- Real-world planetary gravity is radially distributed toward the planet's spherical center of mass, shifting vector direction relative to absolute spatial positioning.
- Virtual reality systems standardize "down" as a fixed, invariant directional vector, usually aligned parallel to a primary world Cartesian axis (such as or ).
- Real gravity exerts a force proportional to mass (). Because the engine calculates linear acceleration by dividing force by mass (), the mass variable algebraically cancels out.
- Physics engines discard runtime gravitational force computations, instead injecting gravity directly as a constant acceleration vector ( downward) applied directly to every active object.
- Virtual gravity acts directly through the center of mass of every rigid body, guaranteeing that free-falling objects undergo purely translational acceleration with zero induced rotational torque.
Collision Detection and Collider Encapsulation
Computational Bottlenecks in Collision Detection:
- Detecting surface intersections across hundreds or thousands of intricate rendered graphics meshes containing millions of polygons is computationally prohibitive in real-time applications.
- Physics engines decouple visual rendering from physical interaction by utilizing collider encapsulation.
Geometric Approximation Strategies:
- Highly complex graphical models are bounded within simplified, computationally efficient geometric collision proxies (e.g., spheres, axis-aligned bounding boxes [AABB], oriented bounding boxes [OBB], capsules, and cylinders).
- Example: In first-person character controllers and shooting games, human characters are almost universally approximated using bounding cylinders or capsules rather than anatomical polygon meshes.
- Benefits of Encapsulation:
- Dramatically accelerates algorithmic contact tests (reducing complex polynomial ray-triangle intersections to simple distance checks).
- Eliminates confusing collisions and snagging artifacts, preventing player frustration caused by micro-geometry catches.
Collision Resolution, Interpenetration, and Resting Contacts
Collision Physics and Coefficient of Restitution:
- Microscopic deformations and structural dynamics during real-world collisions are extremely complex and heavily dependent on specific material properties.
- Physics engines approximate elastic collisions by treating colliding bodies as idealized springs.
- Post-collision separation velocities are determined using the material coefficient of restitution (, where ):
- An denotes a perfectly elastic collision (no energy loss).
- An denotes a completely inelastic collision (colliding objects stick together along the contact normal).
Interpenetration Management:
- Because simulation occurs in discrete time steps, moving bodies often penetrate slightly into one another before the engine can register contact within a frame.
- Once overlap is detected, the engine must resolve interpenetration by calculating the minimum penetration depth and translating the bodies apart along the contact normal until their surfaces align cleanly.

- Resting Contacts and Numerical Jitter:
- Resting Contact Problem: When an object rests stationary on top of another solid surface (e.g., a crate on a floor), continuous downward gravitational acceleration constantly forces it slightly into the floor collider each frame.
- In standard restitution loops, the engine repeatedly flags an interpenetration, separates the object, and applies an upward reaction impulse.
- Without specialized stabilization algorithms, this discrete push-pull cycle causes the resting object to oscillate, float, or visibly vibrate ("jitter").

Joints, Constraints, and VR Grabbing Mechanics
Joint Modeling Paradigms:
- Spring-Based Soft Constraints: The vast majority of physical joints connecting bodies or articulated sub-components are simulated as virtual springs conforming to Hooke's law (spelled Hook's law in foundational engine literature): where is the spring stiffness coefficient, is the displacement vector from equilibrium, is the damping factor, and is relative velocity. Springs provide mathematically stable, continuous restoring forces that are simple to evaluate.
- Hard Constraints: Structural connections consisting of rigid bars or immovable linkages are significantly harder to resolve analytically, often requiring iterative impulse clipping, projection techniques, or specialized collision-like constraint solvers.
Virtual Reality Object Interaction ("Grabbing"):
- When a participant grasps an interactive object in a VR experience, the system typically models the grip as a high-tension virtual spring established between the rigid object and the tracked hand controller.
- If the user accelerates their real-world hand abruptly, the virtual spring stretches beyond equilibrium; the grabbed object perceptibly lags behind, bounces, and oscillates as the spring pulls it back into alignment with the tracking matrix.
Surface Friction and Sleeping Optimizations
Frictional Dynamics:
- Definition: Friction is the resistive contact force that opposes sliding motion between two contacting surfaces.
- Frictional magnitude depends on the normal reaction force (), the applied tangential shear force, and the coefficient of friction () between the two interacting materials:
- Directional (Anisotropic) Friction: Certain materials exhibit friction values that vary dynamically depending on the directional angle of applied tangential force relative to surface grain.
- Engine Optimization Shortcut: Because physics engines already isolate resting contact pairs, engines frequently bypass detailed microscopic frictional force evaluation and simply apply a targeted reduction to the object's relative sliding tangential velocity, clamping drift directly.
Simulation Optimization through "Sleeping":
- Computational evaluation scales poorly if hundreds of stationary scene objects are continuously processed each frame.
- Sleeping Mechanism: If an active rigid body remains motionless or its translational and rotational kinetic energy stays below a strict threshold for several consecutive frames, the engine transitions it to an inactive "sleep" state.
- Performance Benefit: Sleeping entities are completely omitted from collision narrow-phase detection, force integration, and matrix transformations.
- Wake Conditions: A sleeping body is immediately "woken up" and returned to full active per-frame simulation if subjected to an external force, triggered by script intervention, or struck by an active non-sleeping collider.
Player Locomotion and Avatar Physics
Traditional Game Controls vs. Physical Accuracy:
- When player movement is driven via keyboard, gamepad thumbsticks, or mouse input, virtual locomotion is almost entirely non-physical.
- Real-world humans accelerate and decelerate gradually; traditional player avatars accelerate to maximum velocity and stop almost instantaneously.
- The player's turning circle is dictated purely by the rotational sensitivity setting of the controller or mouse (which can yield an instantaneous, zero-radius turn).
- Engines achieve these responsive mechanics by applying exaggerated linear acceleration and overriding rotational dynamics directly, completely bypassing realistic torque and inertia calculations.
Locomotion Modalities in Virtual Reality:
- Physical Locomotion (Real-World Movement / Omnidirectional Treadmills): Input kinematics are directly supplied by real physical motion; the tracked avatar moves with intrinsic physical realism without requiring synthetic kinematic simulation.
- Teleportation Locomotion: Implemented primarily to prevent vestibular-ocular mismatch and combat VR motion sickness. Teleportation instantly relocates the player's coordinate origin, completely disregarding continuous classical mechanics.
- Player-to-World Impact Forces: VR experiences generally do not permit players to ram physical objects with their avatar body, making player mass-energy transfer irrelevant for most interactions. When collisions are supported, the engine typically injects an artificially exaggerated impulse upon contact to provide immediate perceptual responsiveness.
Principles of Real-Time Simulation Optimization
Perceptual Plausibility Over Numerical Precision:
- The objective of physics in VR is to establish an intuitive, comfortable user experience aligned with real-world instincts, not to execute rigorous engineering analysis.
- Real-time constraints make perfect physical simulation mathematically impossible at high display refresh rates ( to per eye).
- Real-time systems successfully substitute empirical approximations (e.g., damping instead of drag, springs instead of rigid joints, collider cylinders instead of skinned meshes) because meeting human perceptual expectation is sufficient for immersion.
Simplification via Theoretical Principles:
- Theoretical laws of physics are routinely leveraged as computational shortcuts rather than burdens.
- Engines use principles like Euler's first law (reducing rigid body translation to particle kinetics), D'Alembert's principle (collapsing multiple forces into a single vector), and mass-canceling gravity to drastically minimize the mathematical operations required per frame.