open class SpatialInterface
SpatialInterface
()
:
SpatialInterface |
Signature
constructor() Returns |
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 |
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
hand:
Hand
amplitude:
Float
duration:
Long
frequency:
Float
|
createPhysicsObject
(
entity
,
shape
)
|
Creates a physics object for the specified entity with the given shape. This is an API for internal use only. To create a physics object, set a Physics component to a Mesh entity.
This method adds physics simulation capabilities to an entity, allowing it to participate in the physics world with collisions and dynamics.
Signature
fun createPhysicsObject(entity: Entity, shape: String) Parameters
entity:
Entity
shape:
String
|
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
|
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
|
enablePhysicsDebugLines
(
enabled
)
|
Toggles debug lines for visualization of the physics simulation. The color of the lines correspond to the state of the physics objects.
This is useful for debugging physics interactions and understanding how physics bodies are behaving in the scene.
Signature
fun enablePhysicsDebugLines(enabled: Boolean) Parameters
enabled:
Boolean
|
setGravity
(
x
,
y
,
z
)
|
Sets the gravity vector for the physics simulation.
This method allows customizing the direction and strength of gravity in the physics world, which affects how objects fall and interact.
Signature
fun setGravity(x: Float, y: Float, z: Float) Parameters
x:
Float
y:
Float
z:
Float
|
setPerformanceLevel
(
level
)
:
Boolean
|
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
level:
PerformanceLevel Returns
Boolean
|