[][src]Crate duckduckgeo

Provides some useful 2d geometry functions.

Why the name? Not sure. Duck Duck Goose.

Modules

bot

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

grid

Structs

ErrTooClose

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

Ray

A Ray.

Enums

IntersectsBotResult

Describes if a ray hit a rectangle.

WallSide

Describes a cardinal direction..

Traits

BorderCollideTrait

Generic trait to collide with border

GravityTrait

Passed to gravitate.

MyNum

Basic Number Trait

RepelTrait

Passed to repel

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.

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.

ray_compute_intersection_tvalue

Given a ray and an axis aligned line, return the tvalue,and x coordinate

ray_intersects_box

Returns if a ray intersects a box.

ray_intersects_circle

Checks if a ray intersects a circle.

repel

Repel two objects.

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