Class GCMotion

  • All Implemented Interfaces:
    NSObject

    public class GCMotion
    extends NSObject
    A profile for getting motion input from a controller that has the ability to measure acceleration and rotation rate. You check for the availablity of motion inputs by getting the motion property of a controller. If that returns a nil value; motion is not available. A non-nil value is a valid GCMotion profile that is able to provide motion input.
    See Also:
    GCController.motion
    • Constructor Detail

      • GCMotion

        protected GCMotion​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • alloc

        public static GCMotion alloc()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • attitude

        public GCQuaternion attitude()
        The current attitude of the controller. [@note] Remotes without accurate attitude and rotation rate can not determine a stable attitude so the values will be (0,0,0,1) at all times.
        See Also:
        hasAttitude(), GCMicroGamepad
      • gravity

        public GCAcceleration gravity()
        The gravity vector expressed in the controller's reference frame. Note that the total acceleration of the controller is equal to gravity plus userAcceleration.
        See Also:
        userAcceleration(), acceleration()
      • rotationRate

        public GCRotationRate rotationRate()
        The current rotation rate of the controller. [@note] Remotes without accurate attitude and rotation rate can not determine a stable rotation rate so the values will be (0,0,0) at all times.
        See Also:
        hasRotationRate(), GCMicroGamepad
      • userAcceleration

        public GCAcceleration userAcceleration()
        The acceleration that the user is giving to the controller. Note that the total acceleration of the controller is equal to gravity plus userAcceleration.
        See Also:
        gravity(), acceleration()
      • hasAttitudeAndRotationRate

        public boolean hasAttitudeAndRotationRate()
        The controller generating the motion data has sensors that can accurately determine the current attitude and rotation rate. If this is enabled the motion data for attitude and rotation rate are usable for inputs.
      • setAttitude

        public void setAttitude​(GCQuaternion attitude)
        Sets the current rotation rate of the controller. [@note] If the controller's snapshot flag is set to NO, this method has no effect.
        See Also:
        attitude()
      • setGravity

        public void setGravity​(GCAcceleration gravity)
        Sets the gravity vector expressed in the controller's reference frame. [@note] If the controller's snapshot flag is set to NO, this method has no effect.
        See Also:
        gravity()
      • setRotationRate

        public void setRotationRate​(GCRotationRate rotationRate)
        Sets the current rotation rate of the controller. [@note] If the controller's snapshot flag is set to NO, this method has no effect.
        See Also:
        rotationRate()
      • setStateFromMotion

        public void setStateFromMotion​(GCMotion motion)
        Sets the state vector of the motion profile to a copy of the input motion profile's state vector. [@note] If the controller's snapshot flag is set to NO, this method has no effect.
        See Also:
        GCController.snapshot
      • setUserAcceleration

        public void setUserAcceleration​(GCAcceleration userAcceleration)
        Sets the acceleration that the user is giving to the controller. [@note] If the controller's snapshot flag is set to NO, this method has no effect.
        See Also:
        userAcceleration()
      • hasAttitude

        public boolean hasAttitude()
        The controller generating the motion data has sensors that can accurately determine the current attitude. If this is enabled the motion data for attitude is usable for inputs.
      • hasGravityAndUserAcceleration

        public boolean hasGravityAndUserAcceleration()
        Returns YES if the controller is capable of reporting gravity and user acceleration separately. [@note] Some controllers do not separate gravity from user acceleration, and only report the total acceleration of the controller. Query whether the connected controller has the ability to separate gravity and user acceleration, and it doesn’t, use acceleration instead.
        See Also:
        acceleration()
      • hasRotationRate

        public boolean hasRotationRate()
        The controller generating the motion data has sensors that can accurately determine the current rotation rate. If this is enabled the motion data for rotation rate is usable for inputs.
      • sensorsActive

        public boolean sensorsActive()
        Set this property to YES when you wish to receive motion data from the controller. When you set this property to NO, the motion sensors will be disabled and the GCMotion profile will not be updated. [@note] It is highly recommended that you only enable sensor during the period of time you directly need motion data. Motion sensors can drain controller battery, device battery, and needlessly consume Bluetooth bandwidth.
        See Also:
        sensorsRequireManualActivation()
      • sensorsRequireManualActivation

        public boolean sensorsRequireManualActivation()
        If this property is returns YES, you are responsible for setting sensorsActive to YES when you need motion data from the controller. Some controllers, such as the Siri Remote, automatically activate and deactivate motion sensors. In such a case, this property will return NO.
        See Also:
        sensorsActive()
      • setAcceleration

        public void setAcceleration​(GCAcceleration acceleration)
        Sets the acceleration that the user is giving to the controller. [@note] If the controller's snapshot flag is set to NO, this method has no effect.
        See Also:
        userAcceleration()
      • setSensorsActive

        public void setSensorsActive​(boolean value)
        Set this property to YES when you wish to receive motion data from the controller. When you set this property to NO, the motion sensors will be disabled and the GCMotion profile will not be updated. [@note] It is highly recommended that you only enable sensor during the period of time you directly need motion data. Motion sensors can drain controller battery, device battery, and needlessly consume Bluetooth bandwidth.
        See Also:
        sensorsRequireManualActivation()