SCNBox is just a helper subclass of SCNGeometry for creating window geometry. When you import Collada into a scene, you get a SCNNodes scene graph with SCNGeometries, not SCNBox'es or SCNCones, etc. It doesnโt matter what they look like. If you want to get the dimensions of any node, you must use the SCNBoundingVolume protocol, which is implemented by the SCNNode and SCNGeometry classes:
func getBoundingBoxMin (_ min: UnsafeMutablePointer, max max: UnsafeMutablePointer) -> Bool
Using this method, you will get boundary frames. For rectangular geometry, the dimensions will correspond to the bounding box.
Example:
var v1 = SCNVector3(x:0, y:0, z:0) var v2 = SCNVector3(x:0, y:0, z:0) node.getBoundingBoxMin(&v1, max:&v2)
Where node is node, you want to get a bounding box. Results will be in versions v1 and v2.
Swift 3
Using Swift 3, you can simply use node.boundingBox.min and node.boundingBox.max respectively.
Ef dot
source share