Unity Contents of the Plugin

From Kudan AR Engine
Jump to: navigation, search

The first three folders of the plugin, Editor, Materials and Plugins are integral to how it works and should not be altered.

In the Prefabs folder, there are several Prefab objects to help you get started:

There are three Kudan Camera prefabs. The only difference between them is the tracking methods they carry. One contains only marker tracking, one contains only markerless tracking and one contains both. All three contain the background rendering texture.
The Drivers prefab contains two objects called “Marker” and “Markerless”. These hold the Marker and Markerless transform drivers, respectively. Also in this prefab are a sphere and cube to act as placeholders for other objects.
The SimpleUI prefab contains three buttons, along with a sample app script and an event system. These allow for the changing of tracking methods while the app is running and the placement of objects for the purposes of markerless tracking, as well as the ability to track when a marker has been found, tracked or lost. Tracking occurs once each frame.
The Kudan Bundle combines the Kudan Camera, Drivers and SimpleUI prefabs together to create a functioning app. Dropping it into an otherwise empty scene creates an app that will detect the default (lego) marker and perform markerless tracking of an object.
The Angel Bundle is very similar to the Kudan Bundle, but shows that more complex objects, in this case an Angel statue, can be placed within a scene.
The Moving Augmentations Bundle is a demo that puts two objects on a marker that then proceed to fly around the room, always staying within a certain distance.
The Touch Bundle incorporates touch input controls for iOS and Android devices. Pinch scales the object, swipe rotates and a tap activates a script. The script in the sample simply spins the object slowly around its Y axis

The Resources folder is necessary for loading assets in scripts, so its contents should not be altered or moved.

The Samples folder contains the necessary objects to create the app detailed in the tutorials.

The KudanSample scene is the app we create in the tutorials.
The Markers folder contains a DemoMarker, which is the default data set (aka the lego image) the camera looks for by default.
The Materials folder contains the material used for the plane in the KudanSample scene.
The Models folder contains the data for the angelStatue model that is placed using Markerless tracking in the KudanSample scene.
The Scripts folder contains the example scripts that show you how to perform certain actions in scripting, including how to change tracking mode or how to make a movie play.
The Textures folder contains images used to make materials, including the lego image that is used as a marker.
The remaining folders have names matching the bundle prefabs. These folders contain sample-specific scripts and assets.

The Scripts folder contains all the scripts used by the various objects in the Plugin, including the drivers and tracking methods. These should not be altered.

The Classes folder contains the scripts detailing the different trackers and event system.
Events simply creates three new custom events that fire when a marker is found, lost or tracked.
ITracker is the interface from which TrackerBase inherits all of its functions
NativeInterface loads all the appropriate files, provided that the platform Unity is currently set to is supported in some way (Currently Windows, OSX, iOS and Android)
Trackable describes what a “Trackable” object is and includes all the variables associated with it.
TrackableBase is the abstract class from which platform-specific trackers inherit.
TrackableAndroid, iOS, OSX and Windows all describe platform-specific trackers, each with their own unique methods, but ultimately they all do the same thing. They initialise a camera, provide a live camera feed to be drawn to a texture and track objects depending on tracking method.
TrackableNull is the script that is used when the current platform being used isn’t supported. It exists partly as an attempt to allow unsupported platforms to have a chance at running Kudan and partly as a reference guide with which to create new Tracker scripts, expanding the number of platforms that are supported.
The Components folder contains all the different scripts that attach to certain GameObjects in order to provide Kudan’s AR functionality:
KudanTracker is the script used by the Kudan Camera object. It creates a tracker based on the operating system of the device used when the app runs.
TrackableData describes the data used by the trackers to interpret the markers.
The TrackingMethods folder contains the different tracking behaviours used to track objects.
TrackingMethodBase is the abstract class that other methods inherit from.
TrackingMethodMarker shows how the camera, while in marker tracking mode, recognises markers and proceeds to track them as long as the marker remains on the screen.
TrackingMethodMarkerless shows how the camera, while in markerless tracking mode, finds the current position of the “floor” and tracks a created object.
The TransformDrivers folder contains the different drivers used to move objects in the scene
TransformDriverBase is the abstract class that all other drivers inherit from.
MarkerTransformDriver describes how objects that are children of a marker driver object are updated in the scene. Their position and rotations are updated each frame.
MarkerlessTransformDriver describes how an object tracked in markerless mode updates its position and rotation each frame.