public class GCMotion extends NSObject
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.
GCController.motion| Modifier and Type | Class and Description |
|---|---|
static interface |
GCMotion.Block_setValueChangedHandler |
static interface |
GCMotion.Block_valueChangedHandler_ret |
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
GCMotion(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
GCAcceleration |
acceleration()
The total acceleration of the controller.
|
static boolean |
accessInstanceVariablesDirectly() |
static GCMotion |
alloc() |
static GCMotion |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
GCQuaternion |
attitude()
The current attitude of the controller.
|
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(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.Class |
classForKeyedUnarchiver() |
GCController |
controller() |
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
GCAcceleration |
gravity()
The gravity vector expressed in the controller's reference frame.
|
boolean |
hasAttitude()
The controller generating the motion data has sensors that can accurately determine the current attitude.
|
boolean |
hasAttitudeAndRotationRate()
The controller generating the motion data has sensors that can accurately determine the current attitude and rotation rate.
|
boolean |
hasGravityAndUserAcceleration()
Returns YES if the controller is capable of reporting gravity and user acceleration separately.
|
static long |
hash_static() |
boolean |
hasRotationRate()
The controller generating the motion data has sensors that can accurately determine the current rotation rate.
|
GCMotion |
init() |
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
static GCMotion |
new_objc() |
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
GCRotationRate |
rotationRate()
The current rotation rate of the controller.
|
boolean |
sensorsActive()
Set this property to YES when you wish to receive motion data from the controller.
|
boolean |
sensorsRequireManualActivation()
If this property is returns YES, you are responsible for setting sensorsActive to YES when you need motion data from the controller.
|
void |
setAcceleration(GCAcceleration acceleration)
Sets the acceleration that the user is giving to the controller.
|
void |
setAttitude(GCQuaternion attitude)
Sets the current rotation rate of the controller.
|
void |
setGravity(GCAcceleration gravity)
Sets the gravity vector expressed in the controller's reference frame.
|
void |
setRotationRate(GCRotationRate rotationRate)
Sets the current rotation rate of the controller.
|
void |
setSensorsActive(boolean value)
Set this property to YES when you wish to receive motion data from the controller.
|
void |
setStateFromMotion(GCMotion motion)
Sets the state vector of the motion profile to a copy of the input motion profile's state vector.
|
void |
setUserAcceleration(GCAcceleration userAcceleration)
Sets the acceleration that the user is giving to the controller.
|
void |
setValueChangedHandler(GCMotion.Block_setValueChangedHandler value) |
static void |
setVersion_static(long aVersion) |
static org.moe.natj.objc.Class |
superclass_static() |
GCAcceleration |
userAcceleration()
The acceleration that the user is giving to the controller.
|
GCMotion.Block_valueChangedHandler_ret |
valueChangedHandler() |
static long |
version_static() |
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, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public static GCMotion alloc()
public static GCMotion allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public static long hash_static()
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static GCMotion new_objc()
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()
public GCQuaternion attitude()
[@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.
hasAttitude,
GCMicroGamepadpublic GCController controller()
public GCAcceleration gravity()
Note that the total acceleration of the controller is equal to gravity plus userAcceleration.
userAcceleration,
accelerationpublic GCRotationRate rotationRate()
[@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.
hasRotationRate,
GCMicroGamepadpublic void setValueChangedHandler(GCMotion.Block_setValueChangedHandler value)
public GCAcceleration userAcceleration()
Note that the total acceleration of the controller is equal to gravity plus userAcceleration.
gravity,
accelerationpublic GCMotion.Block_valueChangedHandler_ret valueChangedHandler()
public boolean hasAttitudeAndRotationRate()
public void setAttitude(GCQuaternion attitude)
[@note] If the controller's snapshot flag is set to NO, this method has no effect.
attitudepublic void setGravity(GCAcceleration gravity)
[@note] If the controller's snapshot flag is set to NO, this method has no effect.
gravitypublic void setRotationRate(GCRotationRate rotationRate)
[@note] If the controller's snapshot flag is set to NO, this method has no effect.
rotationRatepublic void setStateFromMotion(GCMotion motion)
[@note] If the controller's snapshot flag is set to NO, this method has no effect.
GCController.snapshotpublic void setUserAcceleration(GCAcceleration userAcceleration)
[@note] If the controller's snapshot flag is set to NO, this method has no effect.
userAccelerationpublic GCAcceleration acceleration()
gravity,
userAccelerationpublic boolean hasAttitude()
public boolean hasGravityAndUserAcceleration()
[@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.
accelerationpublic boolean hasRotationRate()
public boolean sensorsActive()
[@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.
sensorsRequireManualActivationpublic boolean sensorsRequireManualActivation()
Some controllers, such as the Siri Remote, automatically activate and deactivate motion sensors. In such a case, this property will return NO.
sensorsActivepublic void setAcceleration(GCAcceleration acceleration)
[@note] If the controller's snapshot flag is set to NO, this method has no effect.
userAccelerationpublic void setSensorsActive(boolean value)
[@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.
sensorsRequireManualActivation