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]

pub fn new(
    pts: &[T],
    time_step: f64,
    max_entities: i32,
    theta: f64,
    calculate_collisions: CalculateCollisions
) -> GravTree<T> where
    T: AsEntity
[src]

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<T: AsEntity + Responsive + Clone> Serialize for GravTree<T> where
    T: Serialize
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for GravTree<T> where
    T: RefUnwindSafe

impl<T> Send for GravTree<T> where
    T: Send

impl<T> Sync for GravTree<T> where
    T: Sync

impl<T> Unpin for GravTree<T> where
    T: Unpin

impl<T> UnwindSafe for GravTree<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.