Testing out JmonkeyEngine to make a game in Scala with Akka Actors within a pure FP layer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

51 lines
1.3 KiB

package wow.doge.mygame
import org.scalatest.funsuite.AnyFunSuite
import wow.doge.mygame.math.ImVector3f
import com.typesafe.scalalogging.LazyLogging
import cats.syntax.eq._
import cats.syntax.show._
class ImVector3fTest extends AnyFunSuite with LazyLogging {
test("maxvalue") {
val v1 = ImVector3f.Max
val v2 = ImVector3f.Max
logger.info(ImVector3f.dst(v1, v2).show)
}
test("minvalue") {
val v1 = ImVector3f.Min
val v2 = ImVector3f.Min
logger.info(ImVector3f.dst(v1, v2).show)
}
test("maxvalue and unit") {
val v1 = ImVector3f.Max
val v2 = ImVector3f(1, 1, 1)
assert(ImVector3f.dst(v1, v2) eqv 5.8938631329669654e38)
assert(ImVector3f.dst(v1, v2) eqv ImVector3f.dst(v2, v1))
}
test("minvalue and unit") {
val v1 = ImVector3f.Min
val v2 = ImVector3f(1, 1, 1)
assert(ImVector3f.dst(v1, v2) eqv 5.8938631329669654e38)
assert(ImVector3f.dst(v1, v2) eqv ImVector3f.dst(v2, v1))
}
test("another") {
{
val v1 = ImVector3f(1, 0, 0)
val v2 = ImVector3f(1, 1, 1)
logger.info(ImVector3f.dst(v1, v2).show)
assert(ImVector3f.dst(v1, v2) eqv ImVector3f.dst(v2, v1))
}
{
val v1 = ImVector3f(1, 1, 0)
val v2 = ImVector3f(1, 1, 1)
logger.info(ImVector3f.dst(v1, v2).show)
assert(ImVector3f.dst(v1, v2) eqv ImVector3f.dst(v2, v1))
}
}
}