Skip to main content

social_repulsion_3d

Function social_repulsion_3d 

Source
pub fn social_repulsion_3d(
    x: f64,
    y: f64,
    z: f64,
    vx: f64,
    vy: f64,
    vz: f64,
    radius: f64,
    nx: f64,
    ny: f64,
    nz: f64,
    nvx: f64,
    nvy: f64,
    nvz: f64,
    n_radius: f64,
    params: &SocialForceParams,
) -> (f64, f64, f64)
Expand description

Social repulsion + physical contact acceleration from a single neighbor in 3D.

The tangential sliding-friction direction is computed by subtracting the normal component from the relative velocity difference vector. Coefficients are divided by params.mass before returning, so the result is in m/s².

Returns (ax, ay, az) - acceleration (m/s²) on the current agent.