diff --git a/src/main/kotlin/MaterialColor.kt b/src/main/kotlin/MaterialColor.kt index 2aac534..c16ca2d 100644 --- a/src/main/kotlin/MaterialColor.kt +++ b/src/main/kotlin/MaterialColor.kt @@ -11,4 +11,6 @@ data class MaterialColor(val r: Float, val g: Float, val b: Float) { companion object { val Black: MaterialColor = MaterialColor(0f, 0f, 0f) } -} \ No newline at end of file +} + +operator fun Float.times(rhs: MaterialColor) = MaterialColor(this * rhs.r, this * rhs.g, this * rhs.b) diff --git a/src/main/kotlin/Ray.kt b/src/main/kotlin/Ray.kt index 1f06a97..0383cd2 100644 --- a/src/main/kotlin/Ray.kt +++ b/src/main/kotlin/Ray.kt @@ -1,6 +1,5 @@ import java.io.File -operator fun Float.times(rhs: MaterialColor) = MaterialColor(this * rhs.r, this * rhs.g, this * rhs.b) data class Ray(val origin: Point, val direction: Vector) { fun at(t: Float) = origin + t * direction