open class SpatialInterface
SpatialInterface
()
|
Signature
constructor() Returns SpatialInterface |
appPtr_
: Long
[Get] |
Pointer to the native application instance. This is set during initialization and used for all native method calls.
Signature
var appPtr_: Long |
dataModel
: DataModel
[Get] |
The data model associated with this spatial interface. Contains the entity-component data for the application.
Signature
lateinit var dataModel: DataModel |
isDataModelInitialized
: Boolean
[Get] |
Returns true if the data model has been initialized.
Signature
val isDataModelInitialized: Boolean |
applyHapticFeedback
(
hand
, amplitude
, duration
, frequency
)
|
Applies the given haptic feedback to both controllers.
This method triggers haptic feedback (vibration) on the specified controller, allowing for tactile feedback in response to user interactions.
Signature
fun applyHapticFeedback(hand: Hand, amplitude: Float, duration: Long, frequency: Float) Parameters amplitude: Float
Value between 0 - 1 for strength of haptics.
duration: Long
Time in nanoseconds for how long the haptic feedback should be applied.
frequency: Float
Frequency of vibration (in hz).
|
enableAABBDebugLines
(
enabled
)
|
Toggles debug lines for AABB(Axis Aligned Bounding Boxes) around each scene object.
This is useful for visualizing the spatial extents of objects in the scene and understanding collision boundaries.
Signature
fun enableAABBDebugLines(enabled: Boolean) Parameters enabled: Boolean
Whether to enable or disable AABB debug lines.
|
enableInput
(
enabled
)
|
Controls whether input (controllers and hands) are enabled. This method can be used to temporarily disable input processing.
Signature
fun enableInput(enabled: Boolean) Parameters enabled: Boolean
Whether input should be enabled or disabled.
|
isGraphicsReady
()
|
Returns whether the native graphics backend has completed startup.
This is a non-blocking probe for delayed-start graphics backends and does not force initialization. It returns false before native init, after destroy, or while graphics is still waiting for its backend resources. For HSR, ready means the native Aether manager exists and has finished initialization. It is safe to call from frame and lifecycle paths.
Signature
fun isGraphicsReady(): Boolean Returns Boolean |
setPerformanceLevel
(
level
)
|
Set the performance level for both CPU and GPU.
This allows developers to control the performance level of the device. Higher performance levels provide better performance but consume more power.
Example usage:
// Set to boost mode during intensive operations spatial.setPerformanceLevel(PerformanceLevel.BOOST_HINT) // Disable boost by setting back to default (SUSTAIN_HIGH) spatial.setPerformanceLevel(PerformanceLevel.SUSTAIN_HIGH) // Set to sustained low mode to preserve battery life spatial.setPerformanceLevel(PerformanceLevel.SUSTAINED_LOW)
Signature
fun setPerformanceLevel(level: PerformanceLevel): Boolean Parameters Returns Boolean
true if the operation was applied immediately or queued for deferred application once graphics is ready. False means the request could be attempted immediately but failed.
|