[][src]Crate duckduckgeo

Provides some useful 2d geometry functions.

Re-exports

pub use dists;

Modules

bot

2d bot library where a bot is a 2d particle with mass.

grid

2d grid library with the ability to the raycast to detect which cell a ray hits.

Structs

ErrTooClose

If we repel too close, because of the inverse square we might get overlow problems.

Enums

WallSide

Describes a cardinal direction..

Traits

MyNum

Basic Number Trait

Functions

array2_inner_into

convert an array of elements of type B to type A.

array2_inner_try_into

convert an array of elements of type B to type A.

collide_with_border

Collides and bounces an object with a border

collide_with_rect

Returns which cardinal direction the specified rectangle is closest to.

f32n
gravitate

Returns the force to be exerted to the first object. The force to the second object can be retrieved simply by negating the first.

linear_push
repel

Repel two objects. First vector is position. Second vector is force buffer

repel_one

Repel one object by simply not calling add_force on the other.

stop_wall

Forces a position to be within the specified rect.

wrap_position

Wraps the first point around the rectangle made between (0,0) and dim.

Type Definitions

F32n

NotNan f64

F64n

NotNan f64