Struct bigbang::GravTree [−][src]
pub struct GravTree<T: AsEntity + Responsive + Clone> { /* fields omitted */ }
The main struct you will interact with. This is a k-d tree containing all of your gravitational entities.
Implementations
impl<T: AsEntity + Responsive + Clone + Send + Sync> GravTree<T>
[src]
impl<T: AsEntity + Responsive + Clone + Send + Sync> GravTree<T>
[src]pub fn new(
pts: &[T],
time_step: f64,
max_entities: i32,
theta: f64,
calculate_collisions: CalculateCollisions
) -> GravTree<T> where
T: AsEntity,
[src]
pts: &[T],
time_step: f64,
max_entities: i32,
theta: f64,
calculate_collisions: CalculateCollisions
) -> GravTree<T> where
T: AsEntity,
pub fn set_theta(&mut self, theta: f64)
[src]
Sets the theta
value of the simulation.
pub fn as_vec(&self) -> Vec<T>
[src]
Traverses the tree and returns a vector of all entities in the tree.
pub fn get_number_of_entities(&self) -> usize
[src]
Gets the total number of entities contained by this tree.
pub fn time_step(&self) -> GravTree<T>
[src]
This function creates a vector of all entities from the tree and applies gravity to them. Returns a new GravTree.
Trait Implementations
impl<'de, T: AsEntity + Responsive + Clone> Deserialize<'de> for GravTree<T> where
T: Deserialize<'de>,
[src]
impl<'de, T: AsEntity + Responsive + Clone> Deserialize<'de> for GravTree<T> where
T: Deserialize<'de>,
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl<T> RefUnwindSafe for GravTree<T> where
T: RefUnwindSafe,
impl<T> RefUnwindSafe for GravTree<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for GravTree<T> where
T: UnwindSafe,
impl<T> UnwindSafe for GravTree<T> where
T: UnwindSafe,
Blanket Implementations
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]