[−][src]Struct bigbang::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.
Fields
vx: f64
vy: f64
vz: f64
x: f64
y: f64
z: f64
radius: f64
mass: 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]
&self,
node: &Node<T>
) -> (f64, f64, f64)
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]
&self,
node: &Node<T>
) -> (f64, f64, f64)
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]
fn as_entity(&self) -> &Entity
[src]
fn apply_acceleration(
&self,
acceleration: (f64, f64, f64),
time_step: f64
) -> Self
[src]
&self,
acceleration: (f64, f64, f64),
time_step: f64
) -> Self
impl Clone for Entity
[src]
impl Default for Entity
[src]
impl PartialEq<Entity> for Entity
[src]
Auto Trait Implementations
impl Send for Entity
impl Sync for Entity
impl Unpin for Entity
impl UnwindSafe for Entity
impl RefUnwindSafe for Entity
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,