Skip to content

Commit

Permalink
Update raytrace benchmark to work with native floats (#47)
Browse files Browse the repository at this point in the history
Related to python/mypy#14880.
  • Loading branch information
JukkaL authored Mar 12, 2023
1 parent f037b55 commit ce1476a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions benchmarks/bm_raytrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def __init__(self) -> None:
self.lightPoints: list[Point] = []
self.position = Point(0, 1.8, 10)
self.lookingAt = Point_ZERO
self.fieldOfView: float = 45
self.fieldOfView: float = 45.0
self.recursionDepth = 0

def moveTo(self, p: Point) -> None:
Expand Down Expand Up @@ -363,7 +363,7 @@ def colourAt(self, scene: Scene, ray: Ray, p: Point, normal: Vector) -> Colour:
c = addColours(c, self.specularCoefficient, reflectedColour)

if self.lambertCoefficient > 0:
lambertAmount: float = 0
lambertAmount: float = 0.0
for lightPoint in scene.visibleLights(p):
contribution = (lightPoint - p).normalized().dot(normal)
if contribution > 0:
Expand Down

0 comments on commit ce1476a

Please sign in to comment.