Skip to content

stdlib/collision_broadView source ↗

collision_broad

19 items · generated by scribe fromstdlib/collision_broad.fd· synced 2026-11-15

stdlib/collision_broad19 items

Contents

BroadAabb

pub struct BroadAabb {

Fields:

NameType
idi64
min_xf64
min_yf64
max_xf64
max_yf64

Defined at line 27


SpatialHashCell

pub struct SpatialHashCell {

Fields:

NameType
idsVec<i64>

Defined at line 37


SpatialHashGrid

pub struct SpatialHashGrid {

Fields:

NameType
cell_sizef64
cellsVec<SpatialHashCell>
cell_counti64
aabbsVec<BroadAabb>

Defined at line 41


spatial_hash_create

Create a spatial hash grid with the given cell size.

pub fn spatial_hash_create(cell_size: f64) -> SpatialHashGrid {

Parameters:

  • cell_size: f64

Returns: SpatialHashGrid

Defined at line 49


spatial_hash_insert

Insert an AABB into the grid.

pub fn spatial_hash_insert(grid: & mut SpatialHashGrid, id: i64, min_x: f64, min_y: f64, max_x: f64, max_y: f64) -> void {

Parameters:

  • grid: & mut SpatialHashGrid
  • id: i64
  • min_x: f64
  • min_y: f64
  • max_x: f64
  • max_y: f64

Returns: void

Defined at line 66


spatial_hash_query

Query for all IDs that could potentially collide with the given AABB.

pub fn spatial_hash_query(grid: & SpatialHashGrid, min_x: f64, min_y: f64, max_x: f64, max_y: f64) -> Vec<i64> {

Parameters:

  • grid: & SpatialHashGrid
  • min_x: f64
  • min_y: f64
  • max_x: f64
  • max_y: f64

Returns: Vec<i64>

Defined at line 99


spatial_hash_query_pairs

Find all pairs of potentially colliding AABBs.

pub fn spatial_hash_query_pairs(grid: & SpatialHashGrid) -> Vec<i64> {

Parameters:

  • grid: & SpatialHashGrid

Returns: Vec<i64>

Defined at line 140


spatial_hash_clear

Clear all entries from the grid.

pub fn spatial_hash_clear(grid: & mut SpatialHashGrid) -> void {

Parameters:

  • grid: & mut SpatialHashGrid

Returns: void

Defined at line 177


spatial_hash_count

Get the number of AABBs in the grid.

pub fn spatial_hash_count(grid: & SpatialHashGrid) -> i64 {

Parameters:

  • grid: & SpatialHashGrid

Returns: i64

Defined at line 189


SapEndpoint

pub struct SapEndpoint {

Fields:

NameType
idi64
valuef64
is_minbool

Defined at line 195


SweepAndPrune

pub struct SweepAndPrune {

Fields:

NameType
endpointsVec<SapEndpoint>
aabbsVec<BroadAabb>

Defined at line 201


sap_create

pub fn sap_create() -> SweepAndPrune {

Returns: SweepAndPrune

Defined at line 206


sap_insert

Insert an AABB into the sweep-and-prune structure.

pub fn sap_insert(sap: & mut SweepAndPrune, id: i64, min_x: f64, max_x: f64) -> void {

Parameters:

  • sap: & mut SweepAndPrune
  • id: i64
  • min_x: f64
  • max_x: f64

Returns: void

Defined at line 213


sap_query_pairs

Query for all overlapping pairs along the X axis.

pub fn sap_query_pairs(sap: & mut SweepAndPrune) -> Vec<i64> {

Parameters:

  • sap: & mut SweepAndPrune

Returns: Vec<i64>

Defined at line 248


sap_clear

Clear all entries.

pub fn sap_clear(sap: & mut SweepAndPrune) -> void {

Parameters:

  • sap: & mut SweepAndPrune

Returns: void

Defined at line 284


sap_count

Get the number of AABBs.

pub fn sap_count(sap: & SweepAndPrune) -> i64 {

Parameters:

  • sap: & SweepAndPrune

Returns: i64

Defined at line 290


sap_update

Update an existing AABB’s position (removes and re-inserts).

pub fn sap_update(sap: & mut SweepAndPrune, id: i64, min_x: f64, max_x: f64) -> void {

Parameters:

  • sap: & mut SweepAndPrune
  • id: i64
  • min_x: f64
  • max_x: f64

Returns: void

Defined at line 295


Generated by scribe, the Fides documentation generator