Expand description
For more details on usage, see the README.
Modules§
- collisions
- This module contains functions to be used for collision calculations. You do not need to use these, they are provided merely for convenience. All of the functions follow the format of:
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.
- Grav
Tree - The main struct you will interact with. This is a k-d tree containing all of your gravitational entities.
- Simulation
Result
Enums§
Traits§
- AsEntity
- [[GravTree]] works with any type which implements [AsEntity] and [[Responsive]]. 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 add acceleration to the velocity of your type.
- Responsive
- Define how to respond to the results of the simulation at every time step.