[][src]Struct bigbang::Entity

#[repr(C)]
pub struct Entity {
    pub vx: f64,
    pub vy: f64,
    pub vz: f64,
    pub x: f64,
    pub y: f64,
    pub z: f64,
    pub radius: f64,
    pub mass: f64,
}

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.

Fields

vx: f64vy: f64vz: f64x: f64y: f64z: f64radius: f64mass: f64

Methods

impl Entity[src]

pub fn random_entity() -> Entity[src]

Convenience function for testing. Generates an entity with random properties.

pub fn apply_gravity_from<T: AsEntity + Clone>(
    &self,
    node: &Node<T>
) -> (f64, f64, f64)
[src]

Returns a new entity after gravity from a node has been applied to it. Should be read as "apply gravity from node"

pub fn as_string(&self) -> String[src]

Returns the entity as a string with space separated values.

pub fn get_dim(&self, dim: &Dimension) -> &f64[src]

pub fn get_entity_acceleration_from<T: AsEntity + Clone>(
    &self,
    node: &Node<T>
) -> (f64, f64, f64)
[src]

Returns the acceleration of an entity after it has had gravity from the specified node applied to it. In this function, we approximate some entities if they exceed a certain critera specified in "exceeds_theta()". If we reach a node and it is a leaf, then we automatically get the acceleration from every entity in that node, but if we reach a node that is not a leaf and exceeds_theta() is true, then we treat the node as one giant entity and get the acceleration from it.

Trait Implementations

impl AsEntity for Entity[src]

impl Default for Entity[src]

impl Clone for Entity[src]

impl PartialEq<Entity> for Entity[src]

Auto Trait Implementations

impl Send for Entity

impl Unpin for Entity

impl Sync for Entity

impl RefUnwindSafe for Entity

impl UnwindSafe for Entity

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

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.

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

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,