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.

15 lines
408 B

4 years ago
4 years ago
4 years ago
4 years ago
  1. package wow.doge.mygame.math;
  2. import Math.{abs, sqrt, pow}
  3. case class ImVector3f(x: Float = 0f, y: Float = 0f, z: Float = 0f)
  4. object ImVector3f {
  5. val ZERO = ImVector3f(0, 0, 0)
  6. val UNIT_X = ImVector3f(1, 0, 0)
  7. val UNIT_Y = ImVector3f(0, 1, 0)
  8. val UNIT_Z = ImVector3f(0, 0, 1)
  9. def dst(v1: ImVector3f, v2: ImVector3f) =
  10. sqrt(pow(v1.x - v2.x, 2) + pow(v1.y - v2.y, 2) + pow(v1.z - v2.z, 2))
  11. }