KudanAR - iOS  1.6.0
ARGyroManager Class Reference

#import <ARGyroManager.h>

Inherits NSObject, and <ARRendererDelegate>.

Public Types

enum  ARGyroManagerState { ARGyroManagerStateInitialised, ARGyroManagerStateStopped, ARGyroManagerStateStarted }
 
enum  ARGyroManagerStateInternal { ARGyroManagerStateInternalInitialised, ARGyroManagerStateInternalStopped, ARGyroManagerStateInternalStarted }
 

Instance Methods

(void) - initialise
 
(void) - deinitialise
 
(void) - start
 
(void) - stop
 
(void) - actualStart
 
(void) - actualStop
 
(void) - updateNode
 
(void) - addDelegate:
 
(void) - removeDelegate:
 
- Instance Methods inherited from <ARRendererDelegate>
(void) - rendererPreRender
 
(void) - rendererPostRender
 
(void) - rendererDidPause
 
(void) - rendererDidResume
 

Class Methods

(ARGyroManager *) + getInstance
 

Properties

ARGyroManagerState gyroState
 
ARGyroManagerStateInternal internalGyroState
 
CMMotionManager * motionManager
 
CMAttitudeReferenceFrame gyroReferenceFrame
 
ARWorldworld
 

Detailed Description

A manager class representing the device's gyro. This class is resposible for using IMU data to transform AR content with device rotations.

Member Enumeration Documentation

◆ ARGyroManagerState

Enum representing the gyro's state.

Enumerator
ARGyroManagerStateInitialised 

Gyro Manager has been initialised.

ARGyroManagerStateStopped 

Gyro has stopped running.

ARGyroManagerStateStarted 

Gyro is running.

◆ ARGyroManagerStateInternal

Enum representing the gyro managers internal state.

Enumerator
ARGyroManagerStateInternalInitialised 

Gyro Manager has been initialised.

ARGyroManagerStateInternalStopped 

Gyro has stopped running.

ARGyroManagerStateInternalStarted 

Gyro is running.

Method Documentation

◆ addDelegate:

- (void) addDelegate: (id <ARGyroManagerDelegate>)  delegate

Add a delegate for gyro event notifications.

Parameters
delegateThe delegate to add to the Gyro Manager.

◆ deinitialise

- (void) deinitialise

Deinitialises the ARGyroManager singleton and dereferences CMMotiionManger.

◆ getInstance

+ (ARGyroManager *) getInstance

Gets the instance of the gyro manager singleton.

Example of use:

Returns
The singleton instance.

◆ initialise

- (void) initialise

Initialises the ARGyroManager singleton and the ARCMMotionManger singleton with a default gyro update interval of 0.05 seconds.

◆ removeDelegate:

- (void) removeDelegate: (id <ARGyroManagerDelegate>)  delegate

Remove a delegate for gyro event notifications.

Parameters
delegateThe delegate to remove from the Gyro Manager.

◆ start

- (void) start

Sets the gyro state to ARGyroManagerStateInitialised, starts device motion updates and adds ARGyroManager to the array of ARRenderDelegates.

◆ stop

- (void) stop

Sets the gyro state to ARGyroManagerStateStopped, stops device motion updates and removes ARGyroManager from the array of ARRenderDelegates.

◆ updateNode

- (void) updateNode

Updates the world node by getting a 3x3 rotation matrix from the gyroscope attitude, rotating it so that its axes match the camera's, and applying it to the orientation of the Gyro Manager's world.

Property Documentation

◆ gyroReferenceFrame

- (CMAttitudeReferenceFrame) gyroReferenceFrame
readwritenonatomicassign

The reference frame used to start the motion manager. Default is CMAttitudeReferenceFrameXTrueNorthZVertical.

◆ gyroState

- (ARGyroManagerState) gyroState
readwritenonatomicassign

The gyro manager's current state.

◆ internalGyroState

- (ARGyroManagerStateInternal) internalGyroState
readwritenonatomicassign

The gyro managers current internal state

◆ motionManager

- (CMMotionManager*) motionManager
readnonatomicassign

The motion manager used to update the ARGyroManager's orientation.

◆ world

- (ARWorld*) world
readwritenonatomicassign

A node representing the ARGyroManager's world.


The documentation for this class was generated from the following files:
+[ARGyroManager getInstance]
ARGyroManager * getInstance()
Definition: ARGyroManager.mm:32
ARGyroManager
Definition: ARGyroManager.h:27