You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
972 B
Kotlin
27 lines
972 B
Kotlin
package me.eater.test.threedom.dom
|
|
|
|
import io.kotest.core.spec.style.StringSpec
|
|
import io.kotest.matchers.shouldBe
|
|
import me.eater.threedom.dom.Document
|
|
import me.eater.threedom.dom.PlainNode
|
|
import me.eater.threedom.dom.createNode
|
|
import me.eater.threedom.utils.joml.Vector3d
|
|
import me.eater.threedom.utils.joml.getTranslation
|
|
import me.eater.threedom.utils.joml.setTranslation
|
|
|
|
class PositionTest : StringSpec({
|
|
"ensure positioning works" {
|
|
val doc = Document()
|
|
val node = doc.createNode<PlainNode>()
|
|
doc.addNode(node)
|
|
node.model.setTranslation(10, 0, 10)
|
|
node.absolute.getTranslation() shouldBe Vector3d(10, 0, 10)
|
|
val nodeTwo = doc.createNode<PlainNode>()
|
|
node.addNode(nodeTwo)
|
|
nodeTwo.model.setTranslation(-10, 20, 0)
|
|
nodeTwo.absolute.getTranslation() shouldBe Vector3d(0, 20, 10)
|
|
doc.addNode(nodeTwo)
|
|
nodeTwo.absolute.getTranslation() shouldBe Vector3d(-10, 20, 0)
|
|
}
|
|
})
|