Trait zoom::particle::PhysicsParticle
[−]
[src]
pub trait PhysicsParticle<V, D>: Particle<V, D> + Quanta<D> + Inertia<D> where V: Vector<D>, D: Float { fn basic_form(&self) -> BasicParticle<V, D> { ... } fn drag(&self, magnitude: D) { ... } fn gravitate_to<T: ?Sized>(&self, center: &T, magnitude: D) where T: Quanta<D> + Position<V> { ... } fn gravitate_radius_to<T: ?Sized>(&self, center: &T, magnitude: D) where T: Quanta<D> + Position<V> + Ball<D> { ... } fn hooke_to<T: ?Sized>(&self, center: &T, magnitude: D) where T: Quanta<D> + Position<V> { ... } fn hooke_equilibrium_to<T: ?Sized>(&self, center: &T, equilibrium: D, magnitude: D) where T: Quanta<D> + Position<V> { ... } fn lorentz_field(&self, field: &V) where V: CrossVector { ... } fn lorentz_to<T: ?Sized>(&self, center: &T, magnitude: D) where V: CrossVector, T: Quanta<D> + Position<V> + Velocity<V> { ... } fn lorentz_radius_to<T: ?Sized>(&self, center: &T, magnitude: D) where V: CrossVector, T: Quanta<D> + Position<V> + Velocity<V> + Ball<D> { ... } }
Any particle that implements the necessary traits gains access to all of the capabilities of PhysicsParticle.
Provided Methods
fn basic_form(&self) -> BasicParticle<V, D>
Convert a PhysicsParticle into a "basic particle" that implements PhysicsParticle but has the minimum members. Use this to implement data structures that need to create intermediary particles.
fn drag(&self, magnitude: D)
Apply drag forces to a particle.
fn gravitate_to<T: ?Sized>(&self, center: &T, magnitude: D) where T: Quanta<D> + Position<V>
Apply proper attraction to a single physics particle towards a location and with a magnitude.
fn gravitate_radius_to<T: ?Sized>(&self, center: &T, magnitude: D) where T: Quanta<D> + Position<V> + Ball<D>
This works the same as gravitate_radius_squared and gravitate_to.
fn hooke_to<T: ?Sized>(&self, center: &T, magnitude: D) where T: Quanta<D> + Position<V>
Apply spring forces between one particle and a virtual particle that is unaffected.
fn hooke_equilibrium_to<T: ?Sized>(&self, center: &T, equilibrium: D, magnitude: D) where T: Quanta<D> + Position<V>
Apply spring forces between one particle and a virtual particle that is unaffected.
fn lorentz_field(&self, field: &V) where V: CrossVector
Apply lorentz force to a particle in a field given by a vector with the magnitude and direction of the field.
fn lorentz_to<T: ?Sized>(&self, center: &T, magnitude: D) where V: CrossVector, T: Quanta<D> + Position<V> + Velocity<V>
Apply the lorentz force on a virtual particle that is unaffected.
fn lorentz_radius_to<T: ?Sized>(&self, center: &T, magnitude: D) where V: CrossVector, T: Quanta<D> + Position<V> + Velocity<V> + Ball<D>
Apply the lorentz force on a virtual particle that is unaffected.
Implementors
impl<V, D> PhysicsParticle<V, D> for BasicParticle<V, D> where V: Vector<D>, D: Float