I have a SCNNode
and a full working physics body attached to it, but the physics bodies center/resting-point is at the bottom of the SCNNode
.
Here's what I'm trying to do:
Apple Developer hasn't help me so far. Here is what I have:
let nodePhysicsBody = SCNPhysicsBody(type: .dynamic, shape: SCNPhysicsShape(geometry: SCNCapsule(capRadius: 2.0, height: 2.0), options: nil))
I found this init method, but I'm not sure if it will work, or how to implement it.
.init(circleOfRadius r: CGFloat, center: CGPoint()
I'd suggest trying the SCNPhysicsShape
init(shapes:transforms:)
initializer — rather than constructing a physics shape out of several shapes (and using the transforms
parameter to position them relative to one another), you might be able to pass a single shape and a transform that offsets it from the center of the parent coordinate space.