from __future__ import division
from scipy import *
import visual

# Ball.py is the Ball library / module

# Ball class
class Ball:
    def __init__(self, position, velocity, radius, mass):
        '''
        Constructor

        Inputs
          position: list of length 3. Position of the ball in [m].
          velocity: list of length 3. Velocity of the ball in [m/s].
          radius: scalar value. Radius of ball in [m].
          mass: scalar value. Mass of ball in [kg].
        '''
        self.position = array(position, dtype=float)
        self.velocity = array(velocity, dtype=float)
        self.radius = radius
        self.mass = mass
        self.sphere = visual.sphere(pos=position, radius=radius)

    def move(self, delta_t):
        self.position += self.velocity * delta_t
        self.sphere.pos = self.position


