Skip to content

Commit

Permalink
examples: Remove accessor definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
yhara committed May 29, 2020
1 parent dfc4caf commit 0373216
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions examples/ray.sk
Expand Up @@ -12,9 +12,6 @@ class Vec
var @y = y
var @z = z
end
def x -> Float; @x; end
def y -> Float; @y; end
def z -> Float; @z; end

def add(b: Vec) -> Vec
Vec.new(@x + b.x, @y + b.y, @z + b.z)
Expand Down Expand Up @@ -69,8 +66,6 @@ class Ray
@origin = origin
@dir = dir
end
def origin -> Vec; @origin; end
def dir -> Vec; @dir; end
end

class Isect
Expand All @@ -83,18 +78,6 @@ class Isect
var @distance = distance
var @ray_dir = ray_dir
end
def hit -> Int; @hit; end
def hit=(v: Int); @hit=v; end
def hit_point -> Vec; @hit_point; end
def hit_point=(v: Vec); @hit_point=v; end
def normal -> Vec; @normal; end
def normal=(v: Vec); @normal=v; end
def color -> Vec; @color; end
def color=(v: Vec); @color=v; end
def distance -> Float; @distance; end
def distance=(v: Float); @distance=v; end
def ray_dir -> Vec; @ray_dir; end
def ray_dir=(v: Vec); @ray_dir=v; end
end

class Sphere
Expand All @@ -103,9 +86,6 @@ class Sphere
@position = position
@color = color
end
def radius -> Float; @radius; end
def position -> Vec; @position; end
def color -> Vec; @color; end

def intersect(ray: Ray, isect: Isect) -> Void
rs = ray.origin.sub(@position)
Expand All @@ -130,9 +110,6 @@ class Plane
@normal = normal
@color = color
end
def position -> Vec; @position; end
def normal -> Vec; @normal; end
def color -> Vec; @color; end

def intersect(ray: Ray, isect: Isect) -> Void
d = -(@position.dot(@normal))
Expand Down

0 comments on commit 0373216

Please sign in to comment.