wallRepulsion3D

fun <A : AgentLike> wallRepulsion3D(graph: VoxelGraph, cellSize: Double, origin: Point3D, scanRadius: Double, minDistance: Double = 0.0, falloff: (distance: Double) -> Double): Force3D<A>(source)

Exponential repulsion from blocked voxels (walls / obstacles / no-fly zones) in a VoxelGraph. Voxels are treated as solid 3D bounding boxes: the force per voxel uses the closest point on that voxel's box to the agent's 3D position. Scans a cube of voxels of half-side ceil(scanRadius/cellSize) around the agent's current voxel.

Parameters

graph

the 3D lattice whose blocked voxels produce force

cellSize

side length of each voxel in continuous space

origin

continuous-space anchor of voxel (0, 0, 0)

scanRadius

distance beyond which voxels stop contributing

minDistance

lower clamp on d to keep falloff finite at contact

falloff

a function returning force magnitude given clamped distance