stdlib/collision_broadView source ↗
collision_broad
19 items · generated by scribe fromstdlib/collision_broad.fd· synced 2026-11-15
Contents
- BroadAabb (struct)
- SpatialHashCell (struct)
- SpatialHashGrid (struct)
- spatial_hash_create (function)
- spatial_hash_insert (function)
- spatial_hash_query (function)
- spatial_hash_query_pairs (function)
- spatial_hash_clear (function)
- spatial_hash_count (function)
- SapEndpoint (struct)
- SweepAndPrune (struct)
- sap_create (function)
- sap_insert (function)
- sap_query_pairs (function)
- sap_clear (function)
- sap_count (function)
- sap_update (function)
BroadAabb
pub struct BroadAabb {Fields:
| Name | Type |
|---|---|
id | i64 |
min_x | f64 |
min_y | f64 |
max_x | f64 |
max_y | f64 |
Defined at line 27
SpatialHashCell
pub struct SpatialHashCell {Fields:
| Name | Type |
|---|---|
ids | Vec<i64> |
Defined at line 37
SpatialHashGrid
pub struct SpatialHashGrid {Fields:
| Name | Type |
|---|---|
cell_size | f64 |
cells | Vec<SpatialHashCell> |
cell_count | i64 |
aabbs | Vec<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 SpatialHashGridid:i64min_x:f64min_y:f64max_x:f64max_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:& SpatialHashGridmin_x:f64min_y:f64max_x:f64max_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:
| Name | Type |
|---|---|
id | i64 |
value | f64 |
is_min | bool |
Defined at line 195
SweepAndPrune
pub struct SweepAndPrune {Fields:
| Name | Type |
|---|---|
endpoints | Vec<SapEndpoint> |
aabbs | Vec<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 SweepAndPruneid:i64min_x:f64max_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 SweepAndPruneid:i64min_x:f64max_x:f64
Returns: void
Defined at line 295
Generated by scribe, the Fides documentation generator