Table of Contents

Class Gyroscope

Namespace
easyar

Gyroscope invokes the system-provided gyroscope and outputs GyroscopeResult. When the device is no longer needed, call close to shut it down. Do not continue using it after close. It is not recommended to open it multiple times simultaneously, as it may become unusable or lose accuracy.

Gyroscope

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 when hardware supports it. Other operating systems are not currently supported.

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

GyroscopeResultSource

open

Open the device. The sampling period is determined by the internal implementation. If opening fails, returns 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 opening fails, returns 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

samplingPeriodMilliseconds Int32

Returns

Boolean

close

Close the device. Do not continue using 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 latest current result. If the result has not been obtained yet, returns 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>