import pygame
from Maths import *
class Circle:
    def __init__(self,pos,size,mat):
        self.pos = pos
        self.size = size
        self.mat = mat
        self.type = "circle"
    def GetNormal(self,CollisionPoint):
        return Normalize(VectorSubtract(CollisionPoint,self.pos))
    def Collide(self,ray):
        return CollideCircle(ray,self)
    def Draw(self,Surface,Screen):
        pygame.draw.circle(Surface,(0,0,0),[self.pos[0],Screen[1]-self.pos[1]],self.size,1)
class Line:
    def __init__(self,p1,p2):
        self.p1 = p1
        self.p2 = p2
        self.type = "line"
    def GetNormal(self,CollisionPoint):
        return (-1,0)
    def Collide(self,ray):
        return CollideLine(ray,self)
    def Draw(self,Surface,Screen):
        pygame.draw.aaline(Surface,(0,0,0),self.p1,self.p2)
class Ray:
    def __init__(self,pos,dir):
        self.pos = pos
        self.dir = Normalize(dir)
class Material:
    def __init__(self,type):
        if type == "Glass":
            self.refract = 1.52
