bigbang/
as_entity.rs

1use crate::entity::Entity;
2
3/// [[GravTree]] works with any type which implements [[AsEntity]] and [[Responsive]]. In order to implement [[AsEntity]],
4/// a type must be able to represent itself as a gravitational spatial entity. This, simply, entails
5/// constructing an [[Entity]] from the type, and defining how to add acceleration to the velocity of your type.
6///
7/// More generally, this entails that a type must contain, or be able to derive, its velocity, position,
8/// radius and mass, and it must be able to respond to acceleration impulses in the form of triples of `f64`s.
9pub trait AsEntity {
10    /// Return an [[Entity]] representation of your struct.
11    fn as_entity(&self) -> Entity;
12}