cptlobster / sc3d

3D rendering engine written in Scala
GNU General Public License v3.0
0 stars 0 forks source link

fix vertex classes #5

Open cptlobster opened 1 year ago

cptlobster commented 1 year ago

currently does not compile because of crappy vertex class design and type inference issues

[error] C:\Users\fires\dev\sc3d\src\main\scala\core\Vertex2.scala:32:14: unbound wildcard type
[error]   def / (r : _ <: T): Vertex2[T] = new Vertex2[T]((x / r).asInstanceOf[T], (y / r).asInstanceOf[T])
[error]              ^
[error] C:\Users\fires\dev\sc3d\src\main\scala\core\Vertex2Int.scala:32:14: unbound wildcard type
[error]   def / (r : _ <: Int): Vertex2Int[T] = new Vertex2Int[T]((x / r).asInstanceOf[T], (y / r).asInstanceOf[T])
[error]              ^
[error] C:\Users\fires\dev\sc3d\src\main\scala\core\Vertex3.scala:41:14: unbound wildcard type
[error]   def / (r : _ <: Double): Vertex3[T] = new Vertex3[T]((x / r).asInstanceOf[T], (y / r).asInstanceOf[T], (z / r).asInstanceOf[T])
[error]              ^
[error] C:\Users\fires\dev\sc3d\src\main\scala\core\Vertex3Int.scala:41:14: unbound wildcard type
[error]   def / (r : _ <: Int): Vertex3Int[T] = new Vertex3Int[T]((x / r).asInstanceOf[T], (y / r).asInstanceOf[T], (z / r).asInstanceOf[T])
cptlobster commented 10 months ago

so we're just going to force doubles, I don't even care at this point

someone who actually knows what they're doing can come back and fix it later