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
403 B

package wow.doge.mygame.math;
import Math.{sqrt, pow}
case class ImVector3f(x: Float = 0f, y: Float = 0f, z: Float = 0f)
object ImVector3f {
val ZERO = ImVector3f(0, 0, 0)
val UNIT_X = ImVector3f(1, 0, 0)
val UNIT_Y = ImVector3f(0, 1, 0)
val UNIT_Z = ImVector3f(0, 0, 1)
def dst(v1: ImVector3f, v2: ImVector3f) =
sqrt(pow(v1.x - v2.x, 2) + pow(v1.y - v2.y, 2) + pow(v1.z - v2.z, 2))
}