/SCNNodeVisualDebugger

A simple visual debugger for SceneKit

Primary LanguageSwiftApache License 2.0Apache-2.0

SCNNodeVisualDebugger

Swift version Carthage compatible License

A simple tool for showing local and pivot coordinate system of SCNNode.

Initially created during experiments with ARKit + SceneKit.

Demo

Color notation

Coordinate System X Y Z
Local Red Green Blue
Pivot Magenta Yellow Cyan

If you like this tool, please give your ⭐ to this repository.

Installation

CocoaPods

To install it through CocoaPods, add the following line to your Podfile:

pod 'SCNNodeVisualDebugger', :git => 'git@github.com:handsomecode/SCNNodeVisualDebugger.git'

Please, don't forget to run pod update command to update your local specs repository during migration from one version to another.

Carthage

To install it through Carthage, add the following line to your Cartfile:

github "handsomecode/SCNodeVisualDebugger"

Usage

Importing the library to get access to API

import SCNNodeVisualDebugger

Adding debug axes to the specific node

let node: SCNNode = // provide SCNNode instance 

node.addDebugAxes()

If you need to add debug axes to child nodes as well you should pass a flag recursively as true as a parameter of the method. By default, recursively value is false

node.addDebugAxes(recursively = true)

Removing debug axes from the specific node

node.removeDebugAxes()

If you need to remove debug axes from child nodes as well you should pass a flag recursively as true as a parameter of the method. By default, recursively value is false

node.removeDebugAxes(recursively = true)

Checking debug axes from the specific node

if node.hasDebugAxes() {
    // some actions
}

Adding and removing debug axes to node by double tap

It can be useful to show or remove debug axes at runtime. For this purpose, you can use a double tap on a specific node.

Set enableDebugAxesByDoubleTap property of SCNView instance to true to enable double tap trigger.

sceneView.enableDebugAxesByDoubleTap = true

Samples

Use SceneKitSample and ARKitSample to see implementation details.

Communication

  • If you need help or found a bug, please, open an issue.
  • If you have a feature request, open an issue.
  • If you are ready to contribute, submit a pull request to develop branch.
  • If you like SCNNodeVisualDebugger, please, give it a star.

You can find more details into CONTRIBUTING file.

Requirements

  • iOS 9.0+
  • Xcode 8.3+
  • Swift 3.1+

License

SCNNodeVisualDebugger is available under the Apache License, Version 2.0. See the LICENSE file for more info.