Package apple.gamecontroller
Class GCMotion
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.gamecontroller.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceGCMotion.Block_setValueChangedHandlerstatic interfaceGCMotion.Block_valueChangedHandler_ret-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGCMotion(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GCAccelerationacceleration()The total acceleration of the controller.static booleanaccessInstanceVariablesDirectly()static GCMotionalloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)GCQuaternionattitude()The current attitude of the controller.static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()GCControllercontroller()static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()GCAccelerationgravity()The gravity vector expressed in the controller's reference frame.booleanhasAttitude()The controller generating the motion data has sensors that can accurately determine the current attitude.booleanhasAttitudeAndRotationRate()The controller generating the motion data has sensors that can accurately determine the current attitude and rotation rate.booleanhasGravityAndUserAcceleration()Returns YES if the controller is capable of reporting gravity and user acceleration separately.static longhash_static()booleanhasRotationRate()The controller generating the motion data has sensors that can accurately determine the current rotation rate.GCMotioninit()static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)static java.lang.Objectnew_objc()static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)GCRotationRaterotationRate()The current rotation rate of the controller.booleansensorsActive()Set this property to YES when you wish to receive motion data from the controller.booleansensorsRequireManualActivation()If this property is returns YES, you are responsible for setting sensorsActive to YES when you need motion data from the controller.voidsetAcceleration(GCAcceleration acceleration)Sets the acceleration that the user is giving to the controller.voidsetAttitude(GCQuaternion attitude)Sets the current rotation rate of the controller.voidsetGravity(GCAcceleration gravity)Sets the gravity vector expressed in the controller's reference frame.voidsetRotationRate(GCRotationRate rotationRate)Sets the current rotation rate of the controller.voidsetSensorsActive(boolean value)Set this property to YES when you wish to receive motion data from the controller.voidsetStateFromMotion(GCMotion motion)Sets the state vector of the motion profile to a copy of the input motion profile's state vector.voidsetUserAcceleration(GCAcceleration userAcceleration)Sets the acceleration that the user is giving to the controller.voidsetValueChangedHandler(GCMotion.Block_setValueChangedHandler value)static voidsetVersion_static(long aVersion)static org.moe.natj.objc.Classsuperclass_static()GCAccelerationuserAcceleration()The acceleration that the user is giving to the controller.GCMotion.Block_valueChangedHandler_retvalueChangedHandler()static longversion_static()-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
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()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
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
-
controller
public GCController controller()
-
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
-
setValueChangedHandler
public void setValueChangedHandler(GCMotion.Block_setValueChangedHandler value)
-
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()
-
valueChangedHandler
public GCMotion.Block_valueChangedHandler_ret valueChangedHandler()
-
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()
-
acceleration
public GCAcceleration acceleration()
The total acceleration of the controller.- See Also:
gravity(),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()
-
-