Debug mode overview?
I have worked with 2D libraries of games that have a handy setting for displaying the physics of the world. This is useful when debugging physical problems, for example. if the physical position is out of sync or scaled incorrectly compared to normal rendering.
Is there such a flag in SceneKit?
I have a couple of objects that are not explicitly touched, but I am getting the physical world: didBeginContact: callbacks. I am wondering which object is being modeled incorrectly and therefore I would like to see the physics world rendered.
source to share
On OS X 10.11 and later, iOS 9 and later and tvOS, you can set a property debugOptions
on yours SCNView
to enable the flag SCNDebugOptionShowPhysicsShapes
.
There is no way to show physical shapes in iOS 8.x. You can either do your physical debugging on a device running the new iOS version, or you can do it on the Mac version of your application. (The SceneKit APIs are almost identical on Mac and iOS, you can create a Mac test harness for your SceneKit content quite simply, even if you're only shipping your app to iOS.)
It's not there debugOptions
in OS X 10.10, but if you set a flag showsStatistics
for your view, you get a little countdown at the bottom that shows the frame rate and other useful stuff. Click on the button with the eye to display another window with all types of debug controls, one of which is the checkbox for displaying physical bodies.
source to share