[][src]Crate bigbang

Structs

Entity

An Entity is an object (generalized to be spherical, having only a radius dimension) which has velocity, position, radius, and mass. This gravitational tree contains many entities and it moves them around according to the gravity they exert on each other.

GravTree

The main struct you will interact with. This is a k-d tree containing all of your gravitational entities.

Traits

AsEntity

[[GravTree]] works with any type which implements [AsEntity]. In order to implement [AsEntity], a type must be able to represent itself as a gravitational spatial entity. This, simply, entails constructing an [Entity] from the type, and defining how to acceleration to the velocity of your type.

Functions

from_data_file

Loads a [GravTree] from a data file. The data file does not encode the time_step value, so that must be provided.

new

The exported FFI version of [GravTree]'s new() method. Returns a void pointer to the location in memory where the [GravTree] is located. Use this void pointer to tell Rust where to look for the tree in the other FFI functions.

time_step

The exported FFI version of [GravTree]'s time_step() method. Instead of being a method, it is a function which takes in a [GravTree] (rather, a void pointer to the space where the [GravTree] is).

write_data_file

Writes a [GravTree] out to a data file.