OnirixMobileSDK module

Namespaces


Onirix namespace

This namespace serves as a parent container for all namespaces in the different Onirix SDKs modules but it doesn't contain any code in itself.


Onirix.MobileSDK namespace

(class) ARCoreInterface [: ARInterface]
Description:

The ARCoreInterface implements ARInterface to provide support for ARCore. You should never use this class directly. Please, interact with the OnirixMobileManager instead.


(abstract class) ARInterface
Description:

The ARInterface provides a base class with a common interface that must be implemented by any AR technology for which Onirix provides support. ARCoreInterface and ARKitInterface derives from this class to provide support for ARKit and ARCore respectively.


(class) ARKitInterface [: ARInterface]
Description:

The ARKitInterface implements ARInterface to provide support for ARKit. You should never use this class directly. Please, interact with the OnirixMobileManager instead.


(interface) IDynamicLoadListener
Description:

The IDynamicLoadListener provides an interface to implement custom delegate objects to listen several Target loading events through the OnirixDynamicLoader. It works in a similar way to the IOnirixSceneLoaderDelegate, but is provided for use with the OnirixDynamicLoader for convenience.
Methods:
OnTargetAssetsStartDownloading
Method to be called when the Assets for the specified Target start downloading.
OnTargetAssetsDownloaded
Method to be called when all the Assets for the specified Target have been successfully downloaded.
OnTargetAssetsStartLoading
Method to be called when the Assets for the specified Target start loading in memory.
OnTargetAssetsLoaded
Method to be called when all the Assets for the specified Target have been loaded and are ready.


(struct) ImagePtr
Description:

Represents a RAW image. This class is used by the framework to store frames captured by the device camera.
Fields:
ptr
Pointer to RAW data as IntPtr.
width
width for the image
height
height for the image


(class) LegacyARInterface [: ARInterface] [deprecated]
Description:

The LegacyARInterface implements ARInterface to provide an image recognition system without support for surface detection. You should never use this class directly. Please, interact with the OnirixMobileManager instead.


(class) OnirixARCoreBackgroundRenderer [: MonoBehaviour]
Description:

This class comes attached to the ARCoreCamera prefab object bundled with the SDK. It renders the view of the device's camera as background for the AR scene camera.


(class) OnirixCrosshairManager
Description:

The OnirixCrosshairManager is internally used by the OnirixMobileManager and the AR interfaces to provide visual feedback when performing surface detection. You should never use this class directly. Please, interact with the OnirixMobileManager instead.
Methods:
OnirixCrosshairManager
Constructor.
OnDetection
This method is called by the OnirixMobileManager when performing marker detection. You should never call it directly.
Show
Makes the crosshair visible.
Hide
Makes the crosshair invisible.
Reset
Resets the crosshair status and makes it visible.
IsCrosshairLost
Returns true when the crosshair is currently not detecting any surface, false if it is.
GetCrosshairPosition
Returns the crosshair position in world space.
GetCrosshairRotation
Returns the crosshair rotation in world space as a Quaternion.
OnCrosshairUpdate
This method is called by the AR interfaces when performing surface detection. You should never call it directly.
ToggleCrosshair
Toggles the crosshair visibility status between visible and invisible.
IsCrosshairHidden
Returns true if the crosshair is not currently visible, false if it is.


(class) OnirixDynamicLoader [: MonoBehaviour]
Description:

The OnirixDynamicLoader allows you to download and show Targets on demand, displaying a placeholder object during the loading process.
Inspector fields:
Loading Target Placeholder
Prefab object to be instantiated during the Target loading process. The SDK already provides a prefab object to be used at this purpose.
Properties:
Instance [static]
Returns the single OnirixDynamicLoader instance.
Methods:
Init
Initializes the OnirixDynamicLoader setting the specified object implementing the IDynamicLoadListener as delegate that will receive updates during the Target loading process.
Clear
Removes all the placeholder objects.
LoadTarget [2 overloads]
Downloads the specified Target from your Onirix Studio, instantiating it into your scene.
TargetIsLoading [protected]
Returns true if the Target with the specified oid is loading, false otherwise. This is a protected method, meant to be used to create new OnirixDynamicLoader implementations.
PutPlaceholderOnCrosshair [protected]
Creates a placeholder for the given Target, instancing it on the crosshair position. This is a protected method, meant to be used to create new OnirixDynamicLoader implementations.


(class) OnirixMobileManager [: MonoBehaviour]
Description:

The OnirixMobileManager works as an abstraction layer from both the ARCore and ARKit frameworks, providing the surface and marker detection features.
Inspector fields:
Legacy Camera
Camera prefab object to be used when neither ARCore nor ARKit are available. An OnirixLegacyCamera prefab is already provided with the SDK.
Arcore Camera
Camera prefab object to be used for ARCore compatible devices. An OnirixARCoreCamera prefab is already provided with the SDK.
Arkit Camera
Camera prefab object to be used for ARKit compatible devices. An OnirixARKitCamera prefab is already provided with the SDK.
Crosshair Prefab
Default prefab object to be used as crosshair. An OnirixCrosshair prefab is already provided with the SDK.
Crosshir Found Material
Material to be set on the crosshair when it is detecting a surface. An OnirixCrosshairFoundMaterial material is already provided with the SDK.
Crosshair Lost Material
Material to be set on the crosshair when it is idle. An OnirixCrosshairLostMaterial material is already provided with the SDK./dd>
Properties:
Instance [static]
Returns the single OnirixMobileManager instance.
Methods:
StartMarkerDetection
Starts the marker detection system. The provided Action callback will be called when a marker has been detected. Optionally you can specify the path for a custom .otf (Onirix Targets File) file with the desired marker detection configuration. This configuration will be loaded from Onirix Studio by default if any file is specified.
StartSurfaceDetection
Starts the surface detection system. The provided Action callbacks will be called when a surface has been detected or lost, respectively.
TryGetPointCloud
Tries to obtain a PointCloud object containing relevant points of the scene analysis in world coordinate space.
ResetScene
Removes all the elements in the current scene and resets the surface and marker detection systems.
Stop
Removes all the elements in the current scene and stops the surface and marker detection systems.
PlaceTargetOnCrosshair
Places the given GameObject representing a Target on the crosshair coordinates.
ReplaceTarget
Replaces the GameObject currently on the scene representing a Target with the new specified GameObject. This method is called by the OnirixDynamicLoader to perform the replacement of the Target placeholders with the final assets.
StopMarkerDetection
Stops the marker detection system.
StopSurfaceDetection
Stops the surface detection system.
GetCrosshairPosition
Returns the crosshair position in world space.
GetCrosshairRotation
Returns the crosshair rotation in world space as a Quaternion.
ToggleCrosshair
Toggles the crosshair visibility status between visible and invisible.
ResetCrosshair
Resets the crosshair status and makes it visible.
ShowCrosshair
Makes the crosshair visible.
HideCrosshair
Makes the crosshair invisible.


(struct) PlaneInfo
Description:

Represents a plane. This struct is used by the AR interfaces and the OnirixMobileManager to manage information about the detected surfaces.
Fields:
position
Point contained in the surface of the plane
normal
Normal vector of the plane.
orientation
Vector indicating how the plane should be rotated (around its normal) to be properly oriented with respect to the camera.


(struct) PointCloud
Description:

Represents a collection with relevant points of the scene analysis in world coordinate space.
Fields:
points
List collection containing the points in world coordinate space as Vector3 objects.


(class) PointCloudVisualizer [: MonoBehaviour]
Description:

The OnirixPointCloudVisualizer script can be attached as Component to any GameObject in your scene to add support for real-time PointCloud visualization.
Inspector fields:
Point Cloud Particle Prefab
Since the points on the cloud will be shown as particles, this prefab will be used as reference to instantiate them.
Max Points To Show
Maximum number of points to show simultaneously.
Particle Size
Size for the points.


(enum) RotateFlags
Description:

This enumeration contains values identifying all the possible rotations for the AR camera considering the device orientation.
Values:
Rotate90Clockwise
Rotate180
Rotate90CounterClockwise
None

Onirix.MobileSDK.Detection namespace

(class) TargetDetector [: SingletonBase]
Description:

The TargetDetector provides an interface to access native compiled code for marker detection. It is internally used by the OnirixMobileManager.
Methods:
Init
Initializes the TargetDetector with the given configuration.
ResetDetectionCallback
Resets the marker detection.
Reset
Reinitializes the TargetDetector object.
ProcessFrame
Processes the given frame searching for markers.
Destroy
Destroys the TargetDetector.
StopDetection
Stops the marker detection.
GetK
Returns the camera transform matrix.

Onirix.MobileSDK.Prefabs namespace

This namespace contains helper classes used in some prefab objects bundled with the SDK to perform custom behaviours and animations.

(class) OnirixLoadingElement [: MonoBehaviour]
Description:

This class comes attached to the OnirixLoadingElement prefab object bundled with the SDK to manage a custom animation on it.