[][src]Struct chip::Ball

pub struct Ball(_);

A ball simulation.

Example

let mut ball = Ball::new();
ball.set_pos(Point3::new(0.0, 0.0, 100.0));
ball.set_vel(Vector3::new(300.0, 400.0, 500.0));

ball.step(1.0 / 120.0);
println!("{:?}", ball.pos());

Methods

impl Ball[src]

pub fn new() -> Self[src]

Creates a Ball.

pub fn pos(&self) -> Point3<f32>[src]

Gets the ball's position.

pub fn set_pos(&mut self, pos: Point3<f32>)[src]

Sets the ball's position.

pub fn vel(&self) -> Vector3<f32>[src]

Gets the ball's velocity.

pub fn set_vel(&mut self, vel: Vector3<f32>)[src]

Sets the ball's velocity.

pub fn omega(&self) -> Vector3<f32>[src]

Gets the ball's angular velocity.

pub fn set_omega(&mut self, omega: Vector3<f32>)[src]

Sets the ball's angular velocity.

pub fn t(&self) -> f32[src]

Gets the time elapsed in the simulation.

pub fn set_t(&mut self, t: f32)[src]

Sets the time elapsed in the simulation.

pub fn step(&mut self, dt: f32)[src]

Simulates the next dt seconds, and updates the ball's physics values.

Auto Trait Implementations

impl Send for Ball

impl Sync for Ball

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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> Same for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>,