#ifndef physpoint_h
#define physpoint_h

#include "vector2d.h"



class physpoint
{
public:
    vector2d c,o;
    float rad;

    physpoint()
    {}

    // This is our constructor that allows us to initialize our data upon creating an instance
    physpoint(vector2d C, vector2d O)
    {
        c = C;
        o = O;
    }

    void dophys(float drag = 0.95f, float timediv = 1)
    {
        vector2d v = (c-o);

        o=c;
        drag = 1-drag;
        drag/=timediv;
        drag = 1-drag;
        v.scalef(drag);
        if (timediv == 1)
            c+=v;
        else
        {
        	float scalar = 1/timediv;
            c+=v.scalefr(scalar);
            o-=v.scalefr(1-scalar);
        }

    }
    void teleport(float x, float y)
    {
        c.x = x;
        o.x = x;
        c.y = y;
        o.y = y;

    }


};

#endif
