[][src]Crate bigbang



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.


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



[[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.



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


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.


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).


Writes a [GravTree] out to a data file.