这让我完全不解。我把这个节点放在场景中,但只要我添加“localRotation”,节点就会移动。如果我不移动它看起来很好(位于我期望的中心)。我是否必须初始化四元数以使其垂直于地板/姿势?
scene?.apply {
boundingBoxNode?.let { scene.removeChild(it) }
boundingBoxNode = null
viewModel.boundingBox?.let { box ->
MaterialFactory.makeTransparentWithColor(this@MyActivity, boundingBoxColor)
.thenAccept { material ->
boundingBoxNode = Node().apply {
renderable = ShapeFactory.makeCube(box.size, box.center, material).apply {
collisionShape = null
isShadowCaster = false
}
localRotation = box.rotation
scene.addChild(this)
}
}
}