Kinematic Mode (Massless)
Kinematic mode is a position-based simulation where particles follow predefined trajectories without considering forces or mass. This mode is ideal for particles that move along mathematical paths.Characteristics
- Particles have the
isMasslessflag set totrue - Position is calculated directly from trajectory formulas
- No force calculations or mass considerations
- Gravity affects trajectory but not through force/mass equations
- Simpler and more predictable motion
Position Calculation
In kinematic mode, the position at timet is calculated using:
- Initial position (
p0_fis) - Trajectory formula (
fx,fy,fz) evaluated at timet - Initial velocity (
v0_fis) multiplied by time - Gravity (only in z-direction):
-0.5 * g * t²
In kinematic mode, the
fx, fy, fz fields represent displacement functions, not forces.When to Use Kinematic Mode
Use kinematic mode when you want to:- Create particles that follow exact mathematical trajectories
- Simulate projectile motion with simple parabolic paths
- Have complete control over the particle’s path
- Avoid complex force interactions
- Create predictable, repeatable motion
PData Structure for Kinematic Mode
Dynamic Mode (Mass-Based)
Dynamic mode is a force-based simulation using Newtonian physics. Particles have mass and respond to forces according to Newton’s laws of motion. This mode uses the Velocity Verlet integration algorithm for accurate physics simulation.Characteristics
- Particles have the
isMasslessflag set tofalse - Motion is determined by forces and mass (F = ma)
- Uses Velocity Verlet integration for stability
- Supports multiple simultaneous forces
- Realistic physics including friction and collisions
- Can handle complex force interactions
Velocity Verlet Integration
The Velocity Verlet algorithm provides more accurate and stable numerical integration than basic Euler methods. It calculates position and velocity in three steps:Step 1: Update Position
Step 2: Calculate New Acceleration
Step 3: Update Velocity
Velocity Verlet is symplectic and time-reversible, making it ideal for physics simulations. It conserves energy better than simpler methods like Forward Euler.
When to Use Dynamic Mode
Use dynamic mode when you want to:- Simulate realistic physics with forces
- Model interactions between multiple forces
- Include friction, drag, and other resistive forces
- Create complex emergent behavior
- Simulate collisions and ground contact
- Model systems where mass matters (different masses behave differently)
PData Structure for Dynamic Mode
Comparison
- Kinematic Mode
- Dynamic Mode
Advantages:
- Simpler to configure
- Exact trajectory control
- No force calculations needed
- More predictable behavior
- Lower computational cost
- Cannot simulate force interactions
- No realistic mass-based physics
- Limited to predefined paths
- No friction or collision response
Switching Between Modes
You can switch between modes by changing theisMassless flag:
Implementation Reference
The mode-specific physics calculations are implemented inPhysicsUpdate.tsx:110-287:
- Kinematic mode: Lines 110-127
- Dynamic mode (Velocity Verlet): Lines 128-287
Related Topics
- Particles - Learn about particle properties and structure
- Forces - Understanding the force system for dynamic mode
- Visualization - How particles are rendered in both modes