[][src]Crate duckduckgeo

Provides some useful 2d geometry functions.

Why the name? Not sure. Duck Duck Goose.

Modules

bot

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
GravityTrait

Passed to gravitate.

MyNum
RepelTrait

Passed to repel

Functions

array2_inner_into
array2_inner_try_into
collide_with_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
ray_intersects_box

Returns if a ray intersects a box.

ray_intersects_circle
repel

Repel two objects.

repel_one

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

stop_wall
wrap_position

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

Type Definitions

F32n
F64n