Name | Summary |
---|---|
class Animated(startTime: Long, pausedTime: Float = 0.0f, playbackState: PlaybackState = PlaybackState.PLAYING, playbackType: PlaybackType = PlaybackType.LOOP, track: Int = 0) : ComponentBase Plays animation for a glTF asset. Also configures different settings for animation. | |
open class AppSystemActivity : VrActivity, AppSystemCommon AppSystemActivity serves as the base class for all Spatial activities. It contains all Android activity lifecycle callbacks: onCreate, onStop, onDestroy and others. It also provides scene lifecycle callbacks: onSceneReady and onSceneTick. This class also provides hooks to override system features through registerSystemFeatures and to register panels through registerPanels. | |
interface AppSystemCommon | |
class Audio(file: String, volume: Float = 1.0f) : ComponentBase Audio component that can be attached to an entity. This component will play audio spatially from the entity. | |
class | |
class AudioSystem : SystemBase This System is responsible for playing audio and managing audio assets. | |
class AvatarAttachment(type: String = "", var active: Int = 0) : ComponentBase Defines what part of an Avatar the entity is meant to represent. (head, body, controller, etc.) | |
class AvatarBody(head: Entity = Entity.nullEntity(), leftHand: Entity = Entity.nullEntity(), rightHand: Entity = Entity.nullEntity(), root: Entity = Entity.nullEntity(), isPlayerControlled: Boolean = false) : ComponentBase AvatarBody is a component that represents the body of an avatar. It contains references to the head, left hand, right hand, and root of the avatar. It also contains a boolean flag to indicate whether the avatar is player controlled. | |
class | |
class Box : ComponentBase Defines the dimensions of a box shape by the relative offset of two opposite corners. A box of max=Vector3(1,1,1) and min=Vector3(-1,-1,-1) will result in a 2x2x2 box. This is to be used with the mesh://box Mesh URI. | |
class | |
class Color3 Color3 is a class that represents a color in RGB space. It has three properties: red, green, and blue. These properties are floats that range from 0 to 1. | |
class Color4 Color4 is a class that represents a color in RGBA space. It has four properties: red, green, blue, and alpha. These properties are floats that range from 0 to 1. | |
class Controller(buttonState: Int = 0, changedButtons: Int = 0, isActive: Boolean = false, type: Int = 0, directTouchEnabled: Boolean = false, directTouchButtonState: Int = 0, laserEnabled: Boolean = true) : ComponentBase Represents Controller Data and properties that can be used to facilitate input. | |
class CreatorVisibility(state: CreatorVisibilityState = CreatorVisibilityState.CREATOR_ONLY_VISIBLE) : ComponentBase | |
enum CreatorVisibilityState : Enum<CreatorVisibilityState> CreatorVisibilityState is an enum that represents the state of the CreatorVisibility Component. | |
class CreatorVisibilitySystem : SystemBase | |
class DeleteEntitiesSystem : SystemBase This system is responsible for deleting entities that have been marked for deletion. It is responsible for deleting the scene object associated with the entity if it exists. | |
class Dome(radius: Float = 950.0f) : ComponentBase Defines the dimensions of a dome shape by a radius. This can be used for skyboxes. | |
sealed class FlatColorMaterials | |
class Followable(target: Entity, offset: Pose = Pose(Vector3(0f, 0f, 3f), Quaternion(0f, 0f, 1f, 0f)), minAngle: Float = -90f, maxAngle: Float = 90.0f, type: FollowableType = FollowableType.FACE, tolerance: Float = 0.2f, speed: Float = 1.0f, active: Boolean = true) : ComponentBase Followable is a component that enables an entity to stay in front of another entity. Followable will track the orientation of the parent and move itself to stay in front. | |
class FollowableSystem : SystemBase FollowableSystem is a System that updates the position of FollowableEntity’s based on the the position of the FollowableEntity’s target Entity. | |
enum FollowableType : Enum<FollowableType> FollowableType is an enum that defines the type of behavior an object has when following. | |
enum GLTFTransformType : Enum<GLTFTransformType> An enumeration representing the different types of transformations that can be applied to a node in a GLTF file. | |
class GLXF(uri: <Error class: unknown class> = Uri.parse("about:blank")) : ComponentBase This Component is used to represent a GLXF file from a URI. The URI can be a local file or a remote file. | |
data class GLXFAsset(val uri: <Error class: unknown class>, val index: Int, val name: String? = null, val scene: String? = null, val assetNodes: List<String>? = null, val transform: GLTFTransformType = GLTFTransformType.UNDEFINED) A data class representing an asset in a GLXF file. | |
class GLXFAttributeTypeReference(val type: String, val innerTypes: List<String>? = null) | |
class GLXFEntityDeletionSystem(val glXFManager: GLXFManager) : SystemBase This system is responsible for deleting GLXF entities. | |
class GLXFInfo(val glxfManager: GLXFManager, val version: String, val experience: Boolean, assets: MutableList<GLXFAsset>, var nodes: MutableList<GLXFNode>, val rootEntity: Entity, val uri: <Error class: unknown class>, context: <Error class: unknown class>, nodeMap: NodeMap = mutableMapOf<Entity, GLXFNode>(), nodesByName: MutableMap<String, GLXFNode> = mutableMapOf<String, GLXFNode>(), val keyName: String? = null) GLXFInfo is a class that represents a GLXF file. Refer to https://github.com/KhronosGroup/glTF-External-Reference/blob/main/specification/2.0/README.md for detailed specification. | |
typealias GLXFInfoMap = MutableMap<String, GLXFInfo> | |
class GLXFInternalNode(val entity: Entity, transform: GLXFNodeTransform, var name: String? = null, asset: GLXFAsset = GLXFAsset.nullGLXFAsset(), children: MutableList<GLXFNode> = mutableListOf<GLXFNode>(), childrenIndices: MutableSet<Int> = mutableSetOf<Int>(), isRoot: Boolean = true) : GLXFNode A subclass of GLXFNode that represents a node in a GLXF file that has children. | |
class GLXFLeafNode(val entity: Entity, transform: GLXFNodeTransform, var name: String? = null, asset: GLXFAsset) : GLXFNode A subclass of GLXFNode that represents a leaf node in a GLXF file. | |
class GLXFManager(val context: <Error class: unknown class>) GLXFManager is a class that manages GLXF files. | |
object GLXFManagerComponentUtils | |
open class GLXFNode(val entity: Entity, transform: GLXFNodeTransform, var name: String? = null, asset: GLXFAsset = GLXFAsset.nullGLXFAsset()) An open class representing a node in a GLXF file. | |
data class GLXFNodeTransform(val pose: Pose? = null, val scale: Vector3? = null, val matrix: Matrix44? = null) A union of three types of transforms: pose, scale, and matrix. | |
enum GLXFReloadType : Enum<GLXFReloadType> GLXFReloadType is an enum that specifies how GLXFs should be reloaded. | |
class GLXFRoot(rootEntity: Entity = Entity.nullEntity()) : ComponentBase GLXFRoot is a Component that represents the root of a GLXF scene. | |
class Grabbable(enabled: Boolean = true, type: GrabbableType = GrabbableType.FACE, isGrabbed: Boolean = false, minHeight: Float = -Float.MAX_VALUE, maxHeight: Float = Float.MAX_VALUE) : ComponentBase Grabbable is a component that allows an object to be grabbed by a controller. It requires the Mesh Component to be present. | |
class | |
class GrabbableSystem : SystemBase GrabbableSystem is a System that allows for grabbing of objects in the scene. It is responsible for detecting when an object is grabbed and then updating the object’s position and rotation to match the grabber’s position and rotation. It also handles the release of the object when the grabber releases it. | |
enum GrabbableType : Enum<GrabbableType> GrabbableType is an enum that defines the type of behavior an object has when grabbed. | |
class Hittable(hittable: MeshCollision = MeshCollision.LineTest) : ComponentBase Defines whether an object is hittable or not. | |
class | |
class LazyViewModel<VM : SpatialViewModel>(args: Map<String, Any?>, owner: SpatialViewModelOwner, producer: (Map<String, Any?>) -> VM, viewModelClass: KClass<VM>) | |
class LoadScene(scene: <Error class: unknown class> = Uri.parse("about:blank"), scale: Float = 1.0f) : ComponentBase | |
class | |
class Material : ComponentBase Material is a component that describes the material properties of an object. Details can be find Filament Materials Guide: https://google.github.io/filament/Materials.html | |
class | |
class Mesh(mesh: <Error class: unknown class> = Uri.parse("about:blank"), hittable: MeshCollision = MeshCollision.LineTest, defaultShaderOverride: String = "", defaultSceneOverride: Int = -1) : ComponentBase Mesh component, used to specify a mesh to be rendered. This component is used to specify the mesh uri, hittable, default shader override, and default scene override. | |
enum MeshCollision : Enum<MeshCollision> Mesh collision test type, used to determine how a mesh is hit tested. | |
class MeshCreationSystem(val meshManager: MeshManager) : SystemBase MeshCreationSystem is responsible for creating the mesh for an entity when the Mesh component is added. | |
class | |
class MeshManager(val scene: Scene, val meshCreators: HashMap<String, (ent: Entity) -> SceneMesh>, val sceneObjectSystem: SceneObjectSystem) | |
class MeshMaterialOverrides(colors: <Error class: unknown class><Int, Int> = hashMapOf()) : ComponentBase MeshMaterialOverrides is a component that allows you to override the material of a mesh. | |
class MeshMaterialOverridesSystem : SystemBase MeshMaterialOverridesSystem is responsible for updating the material overrides of a mesh. | |
sealed class MetalMaterials | |
sealed class MineralMaterials | |
class Named(name: String = "n/a") : ComponentBase A named component. This is a simple component that can be used to name the Entity. | |
class | |
class NetworkingTickSystem(val spatial: SpatialInterface) : SystemBase NetworkingTickSystem is a system that runs every tick to update the networking state of the app | |
sealed class OrganicMaterials | |
class Panel(panelRegistrationId: Int = 0, hittable: MeshCollision = MeshCollision.LineTest) : ComponentBase Panel is a component that can be attached to a scene object to indicate that it is a panel. | |
class PanelClickState(clickState: ClickState = ClickState.NONE) : ComponentBase PanelClickState is a component that is used to track the state of a panel click. It is used in @see PanelClickSystem, and passes the state to the @see Panel component. | |
class PanelClickSystem : SystemBase PanelClickSystem is responsible for handling the click events on the panels. It listens to the click events from the user and triggers the corresponding actions on the panels. | |
class PanelCreationSystem(val panelCreator: HashMap<Int, (ent: Entity) -> PanelSceneObject>) : SystemBase PanelCreationSystem is responsible for creating and destroying panels. | |
class PanelCreator(val registrationId: Int, panelCreator: (entity: Entity) -> PanelSceneObject) : PanelRegistration PanelCreator is a class that allows you to specify the panel creator function for a panel. The panel creator function is any customized function that takes an entity as input and returns the @see PanelSceneObject. | |
class PanelDimensions(dimensions: Vector2 = Vector2(1.0f * 3f / 4f, 1.0f)) : ComponentBase PanelDimensions is a component that holds the dimensions of a panel. This is used to override the height and width of a panel when creating the panel. Without it, the panel’s height and width will be the values from @see PanelRegistration. | |
class PanelDimensionsSystem : SystemBase PanelDimensionsSystem is responsible for updating the PanelDimensionsOverrides for each panel. The PanelDimensionsOverrides are used to determine the size of the panel. | |
class | |
open class PanelRegistration(val registrationId: Int, val init: PanelRegistration.(entity: Entity) -> Unit) PanelRegistration is a class that allows you to register a panel with the Spatial Toolkit. To use panels in your app, you will need to: | |
object PerfLogger | |
class Plane(width: Float = 1.0f, depth: Float = 1.0f) : ComponentBase Defines the dimensions of a horizontal plane. | |
enum PlaybackState : Enum<PlaybackState> Playback state of the animation. This is used to determine whether the animation is playing or paused. | |
enum PlaybackType : Enum<PlaybackType> Playback type of the animation. This is used to determine how the animation is played. | |
class PlayerBodyAttachmentSystem : SystemBase This PlayerBodyAttachmentSystem is responsible for setting the local player’s avatar body components based on the local player’s attachments. | |
class ProcessListenersSystem(val spatial: SpatialInterface) : SystemBase This System processes listeners in the DataModel | |
class Quad(min: Vector2 = Vector2(0.0f), max: Vector2 = Vector2(0.0f)) : ComponentBase A Quad is a 2D shape that can be used to represent a 2D surface in 3D space. It is defined by its minimum and maximum coordinates. | |
class ResetDataModelSystem(val spatial: SpatialInterface) : SystemBase This System resets the data model. This is used to reset the data model when the app is closed. | |
class RoundedBox(min: Vector3, max: Vector3, radius: Vector3) : ComponentBase Defines the dimensions of a box shape with rounded edges by the relative offset of two opposite corners and a Vector3 of radii to modify the roundedness of the edges | |
class RunMainThreadWorkItemsSystem(val spatial: SpatialInterface) : SystemBase This System runs the main thread work items. | |
class Scale(scale: Vector3 = Vector3(1.0f)) : ComponentBase Sets the scale for any Mesh attached to this entity uniformly in each direction. | |
class | |
class ScenePlane(name: String = "", type: String = "", offset: Vector3 = Vector3(0.0f), extents: Vector3 = Vector3(0.0f)) : ComponentBase A ScenePlane is a 2D plane in the scene. It has a name, type, offset, and extents. | |
class | |
class SceneUpdateTickTimeSystem(val spatial: SpatialInterface) : SystemBase System that updates the scene every tick. | |
class SceneVolume(name: String = "", type: String = "", offset: Vector3 = Vector3(0.0f), extents: Vector3 = Vector3(0.0f)) : ComponentBase A SceneVolume is a 3D volume that can be used to represent a physical object in the scene. | |
class | |
object SpatialActivityManager This object is used to manage the current activity. It is used to get the weak reference to the current activity and execute code on the current activity. | |
object SpatialJSONUtils | |
abstract class SpatialViewModel(closeables: ConcurrentHashMap<String, Closeable> = ConcurrentHashMap()) : Closeable | |
interface SpatialViewModelOwner | |
class Sphere(radius: Float) : ComponentBase The component that defines the dimensions of a sphere by the radius. To be used with the mesh://sphere Mesh URI. | |
class | |
class SupportsLocomotion : ComponentBase This component is used to indicate that an entity supports locomotion. When added to an entity with a mesh, it allows for default locomotion on the mesh | |
class | |
class TickAnimationSystem(val spatial: SpatialInterface) : SystemBase This System animates the scene object. | |
class TickControllerSystem(val spatial: SpatialInterface) : SystemBase This System handles the behavior of controllers. | |
class TickTransformSystem(val spatial: SpatialInterface) : SystemBase This System calculates and sets the transforms of the entites. | |
class ToolkitFeature(val glXFManager: GLXFManager, spatial: SpatialInterface, systemManager: SystemManager, ctx: <Error class: unknown class>) : SpatialFeature | |
class TrackedBody(jointPoses: <Error class: unknown class><Int, Pose> = hashMapOf()) : ComponentBase | |
class Transform(transform: Pose = Pose()) : ComponentBase A component that represents a transform. The transform is the Pose, aka. a combination of a position and an orientation. The Pose identifies the position and orientation of the entity. | |
class | |
class TransformParent(entity: Entity) : ComponentBase This is a component that is used to store the parent of a transform. This is used to keep track of the parent of a transform when it is moved. The entity’s transform will be updated to match the parent’s transform when the parent is moved. | |
class | |
class Visible(isVisible: Boolean = true) : ComponentBase Gives the ability to change mesh between being visible and invisible. | |
class | |
Name | Summary |
---|---|
changed | const val changed: Int = 1 |
distance | const val distance: Float = 0.0f |
downTime | const val downTime: Long = 1000 |
meshElementId | const val meshElementId: Int = 0 |
nodeId | const val nodeId: Int = 0 |
point | val point: Vector3 |
srcId | const val srcId: Long = 2000 |
SUPPORTED_GLXF_EXTENSIONS | val SUPPORTED_GLXF_EXTENSIONS: Set<String> A set of supported GLXF file extensions. |
textureCoordinate | val textureCoordinate: Vector2 |
Name | Summary |
---|---|
addName | |
clampYAngle | |
createPanelEntity | fun Entity.Companion.createPanelEntity(panelId: Int, transform: Transform, vararg components: ComponentBase): Entity fun Entity.Companion.createPanelEntity(entityId: Int, panelId: Int, transform: Transform, vararg components: ComponentBase): Entity |
fromBox | fun Entity.Companion.fromBox(length: Float, transform: Transform, material: Material? = null, vararg components: ComponentBase): Entity |
fromGLB | fun Entity.Companion.fromGLB(mesh: Mesh, transform: Transform, vararg components: ComponentBase): Entity |
fromMeshAndMaterial | fun Entity.Companion.fromMeshAndMaterial(mesh: Mesh, material: Material, transform: Transform, vararg components: ComponentBase): Entity |
fromPanelRegistry | fun Entity.Companion.fromPanelRegistry(registry: PanelRegistration, transform: Transform, vararg components: ComponentBase): Entity |
fromSphere | fun Entity.Companion.fromSphere(length: Float, transform: Transform, material: Material? = null, vararg components: ComponentBase): Entity |
getAbsoluteTransform | |
getRelativePose | |
reparentChildInWorldCoordinates | |
resetFollowable | fun resetFollowable(followable: Entity) |
viewModels | inline fun <VM : SpatialViewModel> SpatialViewModelOwner.viewModels(args: Map<String, Any?> = emptyMap(), owner: SpatialViewModelOwner = this, noinline producer: (Map<String, Any?>) -> VM = { VM::class.constructors.firstOrNull { it.parameters.isEmpty() }?.call() ?: throw IllegalArgumentException( "Primary constructor does not exist or requires one or more parameters. Please " + "make your primary constructor require zero parameters or provide a factory " + "producer") }): <Error class: unknown class><VM> |