Class Gyroscope
- Namespace
- easyar
The Gyroscope calls the system-provided gyroscope and outputs GyroscopeResult. When the device is no longer needed, you can call close to shut it down. Do not continue to use it after close. Do not open it multiple times at the same time; it may become unusable or the accuracy may decrease.
Constructors
Gyroscope
void easyar_Gyroscope__ctor(easyar_Gyroscope * * Return)
Gyroscope()
public Gyroscope()
constructor()
+ (easyar_Gyroscope *) create
public convenience init()
public Gyroscope()
Methods
isAvailable
Check if it is available. Returns true only on Android or iOS and when the hardware supports it. Other operating systems are not supported for the time being.
bool easyar_Gyroscope_isAvailable(easyar_Gyroscope * This)
bool isAvailable()
public boolean isAvailable()
fun isAvailable(): Boolean
- (bool)isAvailable
public func isAvailable() -> Bool
public virtual bool isAvailable()
Returns
- Boolean
output
Output port.
void easyar_Gyroscope_output(easyar_Gyroscope * This, easyar_GyroscopeResultSource * * Return)
std::shared_ptr<GyroscopeResultSource> output()
public @Nonnull GyroscopeResultSource output()
fun output(): GyroscopeResultSource
- (easyar_GyroscopeResultSource *)output
public func output() -> GyroscopeResultSource
public virtual GyroscopeResultSource output()
Returns
open
Open the device. The sampling period is determined by the internal implementation. If the opening fails, return false.
bool easyar_Gyroscope_open(easyar_Gyroscope * This)
bool open()
public boolean open()
fun open(): Boolean
- (bool)open
public func `open`() -> Bool
public virtual bool open()
Returns
- Boolean
openWithSamplingPeriod
Open the device with a specific sampling period. The sampling period may not reach the specified value due to hardware limitations. If the opening fails, return false.
bool easyar_Gyroscope_openWithSamplingPeriod(easyar_Gyroscope * This, int samplingPeriodMilliseconds)
bool openWithSamplingPeriod(int samplingPeriodMilliseconds)
public boolean openWithSamplingPeriod(int samplingPeriodMilliseconds)
fun openWithSamplingPeriod(samplingPeriodMilliseconds: Int): Boolean
- (bool)openWithSamplingPeriod:(int)samplingPeriodMilliseconds
public func openWithSamplingPeriod(_ samplingPeriodMilliseconds: Int32) -> Bool
public virtual bool openWithSamplingPeriod(int samplingPeriodMilliseconds)
Parameters
samplingPeriodMillisecondsInt32
Returns
- Boolean
close
Close the device. Do not continue to use it after close.
void easyar_Gyroscope_close(easyar_Gyroscope * This)
void close()
public void close()
fun close(): Unit
- (void)close
public func close() -> Void
public virtual void close()
Returns
- Void
getCurrentResult
Get the current latest result. If the result has not been obtained, return null.
easyar_OptionalOfGyroscopeResult easyar_Gyroscope_getCurrentResult(easyar_Gyroscope * This)
std::optional<GyroscopeResult> getCurrentResult()
public @Nullable GyroscopeResult getCurrentResult()
fun getCurrentResult(): GyroscopeResult?
- (easyar_GyroscopeResult *)getCurrentResult
public func getCurrentResult() -> GyroscopeResult?
public virtual Optional<GyroscopeResult> getCurrentResult()
Returns
- Optional<GyroscopeResult>