### Get Padding Start - Kotlin Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.node/-view-node2/-layout/index Retrieves the start padding of the view. This corresponds to the left padding in left-to-right layouts and the right padding in right-to-left layouts. It returns an integer representing the padding in pixels. ```kotlin open fun getPaddingStart(): Int ``` -------------------------------- ### Start Recording (Android) Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-scene-view Function to start media recording using a `MediaRecorder` object. This method is used to initiate the process of capturing audio or video. ```kotlin fun startRecording(mediaRecorder: MediaRecorder) ``` -------------------------------- ### AR Environment Creation Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-scene-view/-companion Facilitates the setup of AR environments for rendering and interaction. ```APIDOC ## POST /websites/sceneview_github_io_api/sceneview-android/createAREnvironment ### Description Creates an AR environment using the provided Engine. ### Method POST ### Endpoint /websites/sceneview_github_io_api/sceneview-android/createAREnvironment ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **engine** (Engine) - Required - The engine instance to use for creating the AR environment. ### Request Example ```json { "engine": "" } ``` ### Response #### Success Response (200) - **Environment** (Environment) - The created AR environment. #### Response Example ```json { "Environment": "" } ``` ``` -------------------------------- ### Start Animation Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture Initiates an animation on the view. This method is used to apply predefined or custom animations to the view. ```Kotlin startAnimation ``` -------------------------------- ### Start Animation in Android Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture/index Starts a specified animation on the SceneView. This method is used to initiate visual animations within the SceneView. ```kotlin open fun startAnimation(animation: Animation) ``` -------------------------------- ### Start Layout Animation in Android Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture Starts a layout animation for the current view hierarchy. This method is typically used to animate changes in the layout of views. It does not take any parameters and returns void. ```kotlin open fun startLayoutAnimation() ``` -------------------------------- ### Start Mirroring Surface (Android) Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-scene-view Function to start mirroring a surface. This is likely used for screen recording or casting scenarios, specifying the surface and the region to mirror. ```kotlin fun startMirroring( surface: Surface, left: Int, bottom: Int, width: Int, height: Int) ``` -------------------------------- ### View State and Actions Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture This section covers methods related to querying view states and initiating actions like showing context menus or starting ActionMode. ```APIDOC ## View State and Actions ### Description Provides methods for checking view states and triggering contextual actions. ### Methods #### `shouldDelayChildPressedState(): Boolean` Checks if the view should delay child pressed state. #### `showContextMenu(): Boolean` Shows the context menu for the view. #### `showContextMenuForChild(originalView: View): Boolean` Shows the context menu for a specific child view. #### `startActionMode(callback: ActionMode.Callback): ActionMode` Starts an ActionMode with the given callback. #### `startActionModeForChild(originalView: View, callback: ActionMode.Callback): ActionMode` Starts an ActionMode for a specific child view. ### Parameters * **Path Parameters**: None * **Query Parameters**: None * **Request Body**: None (These are method calls, not API endpoints with request bodies) ### Request Example None (These are method calls) ### Response * **Success Response**: None (These are method calls, return type depends on the method) * **Response Example**: None (These are method calls) ``` -------------------------------- ### Check Camera Permission and Request Install - Sceneview Android Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-core/index Ensures that the necessary camera permissions are granted and that ARCore is installed or attempts to install it. This is a crucial step before starting an AR session. ```kotlin fun checkPermissionAndInstall(activity: ComponentActivity): Boolean { // Implementation to check camera permission and ARCore install return true // Placeholder } ``` -------------------------------- ### View Interaction and State Methods Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture/index This section covers methods related to initiating context menus, starting action modes, and querying child view press states. ```APIDOC ## View Interaction and State Methods ### Description Methods for interacting with context menus, action modes, and checking child view press states. ### Method Various (GET, POST) ### Endpoint N/A (These are method calls within the Android View class) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ## Specific Methods: - **shouldDelayChildPressedState**(): Boolean - Checks if a child view should delay its pressed state. - **showContextMenu**(): Boolean - Shows the context menu for the view. - **showContextMenuForChild**(originalView: View): Boolean - Shows the context menu for a specific child view. - **startActionMode**(callback: ActionMode.Callback): ActionMode - Starts an action mode with the provided callback. - **startActionModeForChild**(originalView: View, callback: ActionMode.Callback): ActionMode - Starts an action mode for a specific child view. - **startAnimation**(animation: Animation) - Starts an animation on the view. ``` -------------------------------- ### Simple Animation Example - ModelAnimator Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.animation/-model-animator/index Demonstrates a simple use case of animating a single model's property (VerticalTranslation) from a start fraction to an end fraction and back. The animation is started immediately. ```kotlin ModelAnimator.ofAnimationFraction(model, "VerticalTranslation", 0f, 0.8f, 0f).start() ``` -------------------------------- ### VideoTexture Constructor Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.texture/-video-texture/index Initializes a new instance of the VideoTexture class. This is the default constructor. ```APIDOC ## VideoTexture Constructor ### Description Initializes a new instance of the VideoTexture class. ### Method constructor ### Endpoint N/A (Class Constructor) ### Parameters None ### Request Example ```java VideoTexture videoTexture = new VideoTexture(); ``` ### Response #### Success Response Initializes a VideoTexture object. #### Response Example N/A (Constructor) ``` -------------------------------- ### ARCore Class Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-core Manages an ARCore Session using the Android Lifecycle API. Before starting a Session, this class requests installation of Google Play Services for AR if it's not installed or not up to date and asks the user for required permissions if necessary. ```APIDOC ## Class ARCore ### Description Manages an ARCore Session using the Android Lifecycle API. Before starting a Session, this class requests installation of Google Play Services for AR if it's not installed or not up to date and asks the user for required permissions if necessary. ### Constructor #### ARCore - **onSessionCreated** (Session) -> Unit - Callback for when the ARCore session is created. - **onSessionResumed** (Session) -> Unit - Callback for when the ARCore session is resumed. - **onSessionPaused** (Session) -> Unit - Callback for when the ARCore session is paused. - **onArSessionFailed** (Exception) -> Unit - Callback for when the ARCore session fails. - **onSessionConfigChanged** (Session, Config) -> Unit - Callback for when the ARCore session configuration changes. ### Properties #### appSettingsLauncher - **Type**: `ActivityResultLauncher` - **Description**: Launcher for activity results related to app settings. #### cameraPermissionLauncher - **Type**: `ActivityResultLauncher` - **Description**: Launcher for requesting camera permissions. #### checkAvailability - **Type**: `Boolean` - **Description**: Enable/Disable Google Play Services for AR availability check, auto install and update. #### checkCameraPermission - **Type**: `Boolean` - **Description**: Enable/Disable camera permission check. #### features - **Type**: `Set` - **Description**: Set of ARCore features to be enabled for the session. #### onArSessionFailed - **Type**: `(Exception) -> Unit` - **Description**: Callback for AR session failure. #### onSessionConfigChanged - **Type**: `(session: Session, config: Config) -> Unit` - **Description**: Callback for AR session configuration changes. #### onSessionCreated - **Type**: `(session: Session) -> Unit` - **Description**: Callback for AR session creation. #### onSessionPaused - **Type**: `(session: Session) -> Unit` - **Description**: Callback for AR session pausing. #### onSessionResumed - **Type**: `(session: Session) -> Unit` - **Description**: Callback for AR session resuming. ### Functions #### canBeInstalled - **Description**: Check to see if we're on a device where ARCore can be installed. - **Parameters**: - **context** (Context) - The application context. - **Returns**: `Boolean` - True if ARCore can be installed, false otherwise. #### checkCameraPermission - **Description**: Checks if the app has camera permission and requests it if not. - **Parameters**: - **context** (Context) - The application context. - **permissionLauncher** (ActivityResultLauncher) - The launcher for requesting permissions. - **Returns**: `Boolean` - True if permission is already granted or requested, false otherwise. #### checkInstall - **Description**: Checks if ARCore is already installed or attempts to request an install otherwise. - **Parameters**: - **activity** (ComponentActivity) - The activity context. - **installRequested** (Boolean) - Whether an install has already been requested. - **Returns**: `Boolean` - True if an install was attempted or is already installed, false otherwise. #### checkPermissionAndInstall - **Description**: Checks for camera permission and installs ARCore if necessary. - **Parameters**: - **activity** (ComponentActivity) - The activity context. - **Returns**: `Boolean` - True if permission is granted and ARCore is installed or installation was initiated, false otherwise. #### create - **Description**: Creates an ARCore session. - **Parameters**: - **context** (Context) - The application context. - **activity** (ComponentActivity?) - The activity context (optional). - **features** (Set) - The set of ARCore features to enable. #### createSession - **Description**: Creates an ARCore session. - **Parameters**: - **context** (Context) - The application context. #### destroy - **Description**: Destroys the ARCore session. Review the API reference for important considerations before calling close() in apps with more complicated lifecycle requirements: Session.close. #### hasCameraPermission - **Description**: Checks if the app has the necessary camera permissions. - **Parameters**: - **context** (Context) - The application context. - **Returns**: `Boolean` - True if the app has camera permission, false otherwise. #### install - **Description**: Attempts to request an install for ARCore. - **Parameters**: - **activity** (ComponentActivity) - The activity context. - **installRequested** (Boolean) - Whether an install has already been requested. - **Returns**: `Boolean` - True if an install was attempted, false otherwise. #### isInstalled - **Description**: Checks if ARCore is installed on the device. - **Parameters**: - **context** (Context) - The application context. - **Returns**: `Boolean` - True if ARCore is installed, false otherwise. #### onException - **Description**: Handles exceptions that occur during AR session operation. - **Parameters**: - **exception** (Exception) - The exception that occurred. #### pause - **Description**: Pauses the ARCore session. #### resume - **Description**: Resumes the ARCore session. - **Parameters**: - **context** (Context) - The application context. - **activity** (ComponentActivity?) - The activity context (optional). #### showCameraPermissionSettings - **Description**: Shows the app's camera permission settings to the user. - **Parameters**: - **activity** (ComponentActivity) - The activity context. ``` -------------------------------- ### Get Padding Values (Kotlin) Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture Retrieves the padding values (bottom, end, left, right, start, top) of the view. Padding is the space between the view's content and its border. ```kotlin open fun getPaddingBottom(): Int open fun getPaddingEnd(): Int open fun getPaddingLeft(): Int open fun getPaddingRight(): Int open fun getPaddingStart(): Int open fun getPaddingTop(): Int ``` -------------------------------- ### Start Action Mode - Kotlin Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture/index Initiates an action mode, typically used for contextual actions like selection or editing. It requires an ActionMode.Callback to define the action mode's behavior. ```kotlin open fun startActionMode(callback: ActionMode.Callback): ActionMode ``` -------------------------------- ### Get Scroll Bar Default Delay Before Fade - Kotlin Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.node/-view-node2/-layout/index Retrieves the default delay in milliseconds before the scroll bar starts to fade out after user interaction stops. It returns an Int value. ```kotlin open fun getScrollBarDefaultDelayBeforeFade(): Int ``` -------------------------------- ### Builder Class Overview Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.texture/-image-texture/-builder/index This section provides an overview of the Builder class, its constructors, and available functions for creating and configuring textures. ```APIDOC ## Builder Class ### Description The `Builder` class is a part of the Sceneview Android library and extends `Texture.Builder`. It provides methods for constructing `Texture` objects, specifically `ImageTexture`. ### Constructors #### `Builder()` - **Description**: Default constructor for the `Builder` class. ### Functions #### `bitmap(bitmap: Bitmap, type: TextureType = DEFAULT_TYPE): ImageTexture.Builder` - **Description**: Creates an `ImageTexture.Builder` from a `Bitmap` object. - **Parameters**: - `bitmap` (Bitmap) - Required - The bitmap image to use. - `type` (TextureType) - Optional - The type of texture (defaults to `DEFAULT_TYPE`). #### `bitmap(context: Context, @DrawableRes drawableResId: Int, type: TextureType = DEFAULT_TYPE): ImageTexture.Builder` - **Description**: Creates an `ImageTexture.Builder` from a drawable resource ID. - **Parameters**: - `context` (Context) - Required - The application context. - `drawableResId` (Int) - Required - The resource ID of the drawable. - `type` (TextureType) - Optional - The type of texture (defaults to `DEFAULT_TYPE`). #### `bitmap(assets: AssetManager, fileLocation: String, type: TextureType = DEFAULT_TYPE): ImageTexture.Builder` - **Description**: Creates an `ImageTexture.Builder` from a file located in the assets. - **Parameters**: - `assets` (AssetManager) - Required - The asset manager. - `fileLocation` (String) - Required - The path to the file in the assets. - `type` (TextureType) - Optional - The type of texture (defaults to `DEFAULT_TYPE`). #### `build(engine: Engine): Texture` - **Description**: Builds and returns the `Texture` object using the provided `Engine`. - **Parameters**: - `engine` (Engine) - Required - The engine instance. - **Returns**: (Texture) - The constructed texture object. #### `depth(@IntRange(from = 1) p0: Int): Texture.Builder` - **Description**: Sets the depth of the texture. - **Parameters**: - `p0` (Int) - Required - The depth value (must be >= 1). #### `format(@NonNull p0: Texture.InternalFormat): Texture.Builder` - **Description**: Sets the internal format of the texture. - **Parameters**: - `p0` (Texture.InternalFormat) - Required - The internal format. #### `height(@IntRange(from = 1) p0: Int): Texture.Builder` - **Description**: Sets the height of the texture. - **Parameters**: - `p0` (Int) - Required - The height value (must be >= 1). #### `importTexture(p0: Long): Texture.Builder` - **Description**: Imports an existing texture. - **Parameters**: - `p0` (Long) - Required - The identifier of the texture to import. #### `levels(@IntRange(from = 1) p0: Int): Texture.Builder` - **Description**: Sets the number of mipmap levels for the texture. - **Parameters**: - `p0` (Int) - Required - The number of levels (must be >= 1). #### `sampler(@NonNull p0: Texture.Sampler): Texture.Builder` - **Description**: Sets the sampler for the texture. - **Parameters**: - `p0` (Texture.Sampler) - Required - The sampler object. #### `swizzle(@NonNull p0: Texture.Swizzle, @NonNull p1: Texture.Swizzle, @NonNull p2: Texture.Swizzle, @NonNull p3: Texture.Swizzle): Texture.Builder` - **Description**: Sets the swizzle masks for the texture's color channels. - **Parameters**: - `p0` (Texture.Swizzle) - Required - Red channel swizzle. - `p1` (Texture.Swizzle) - Required - Green channel swizzle. - `p2` (Texture.Swizzle) - Required - Blue channel swizzle. - `p3` (Texture.Swizzle) - Required - Alpha channel swizzle. #### `type(type: TextureType): ImageTexture.Builder` - **Description**: Sets the type of the `ImageTexture`. - **Parameters**: - `type` (TextureType) - Required - The texture type. #### `usage(p0: Int): Texture.Builder` - **Description**: Sets the usage flags for the texture. - **Parameters**: - `p0` (Int) - Required - The usage flags. #### `width(@IntRange(from = 1) p0: Int): Texture.Builder` - **Description**: Sets the width of the texture. - **Parameters**: - `p0` (Int) - Required - The width value (must be >= 1). ``` -------------------------------- ### Get Focusables in Android Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-scene-view Retrieves a list of all focusable views within the view hierarchy, starting from this view. This is useful for navigation and accessibility. It returns an ArrayList. ```kotlin open fun getFocusables(p0: Int): ArrayList ``` -------------------------------- ### Quaternion Identity (Kotlin) Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.collision/-quaternion/index Provides a static method to get a Quaternion representing no rotation (identity). This is the default state for a new Quaternion and is often used as a starting point for transformations. ```kotlin val identityQuaternion = Quaternion.identity() ``` -------------------------------- ### Material Class Overview Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-material/index Provides an overview of the Material class, its constructors, and key methods for material manipulation. ```APIDOC ## Material Class Represents a reference to a material in Sceneview Android. ### Constructors - `Material(filamentMaterial: Material)`: Creates a Material from an existing Filament Material. - `Material(filamentMaterial: Material, useDefaultInstance: Boolean)`: Creates a Material with an option to use a default instance. - `Material(@Nullable lifecycle: Lifecycle, materialInstance: MaterialInstance)`: Creates a Material associated with a Lifecycle and a MaterialInstance. ### Properties - `filamentMaterial` (Material?): The underlying Filament Material. - `filamentMaterialInstance` (MaterialInstance): The Filament Material instance. ### Methods - `builder(): Material.Builder`: Constructs a `Material.Builder` for creating new materials. - `getExternalTexture(name: String): ExternalTexture?`: Retrieves an external texture by its name. - `getFilamentMaterialInstance(): MaterialInstance`: Gets the Filament Material instance. - `makeCopy(): Material`: Creates a new, independent copy of the Material. - `setBaseColorTexture(texture: Texture)`: Sets the base color texture for the material. - `setBoolean(name: String, x: Boolean)`: Sets a boolean uniform parameter. - `setBoolean2(name: String, x: Boolean, y: Boolean)`: Sets a boolean2 uniform parameter. - `setBoolean3(name: String, x: Boolean, y: Boolean, z: Boolean)`: Sets a boolean3 uniform parameter. - `setBoolean4(name: String, x: Boolean, y: Boolean, z: Boolean, w: Boolean)`: Sets a boolean4 uniform parameter. - `setDepthTexture(name: String, depthTexture: Texture)`: Sets a depth texture for a sampler2D parameter. - `setExternalTexture(name: String, externalTexture: ExternalTexture)`: Sets an external texture for a samplerExternal parameter. - `setFloat(name: String, x: Float)`: Sets a float uniform parameter. - `setFloat2(name: String, x: Float, y: Float)`: Sets a float2 uniform parameter. - `setFloat3(name: String, color: Color)`: Sets a float3 (color) uniform parameter. - `setFloat3(name: String, value: Vector3)`: Sets a float3 uniform parameter. - `setFloat3(name: String, x: Float, y: Float, z: Float)`: Sets a float3 uniform parameter. - `setFloat4(name: String, color: Color)`: Sets a float4 (color) uniform parameter. - `setFloat4(name: String, x: Float, y: Float, z: Float, w: Float)`: Sets a float4 uniform parameter. - `setInt(name: String, x: Int)`: Sets an integer uniform parameter. - `setInt2(name: String, x: Int, y: Int)`: Sets an integer2 uniform parameter. - `setInt3(name: String, x: Int, y: Int, z: Int)`: Sets an integer3 uniform parameter. - `setInt4(name: String, x: Int, y: Int, z: Int, w: Int)`: Sets an integer4 uniform parameter. - `setTexture(name: String, texture: Texture)`: Sets a texture for a sampler2D parameter. ``` -------------------------------- ### Get Drawing Time in Android Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-scene-view Retrieves the time elapsed since the view started drawing. This can be useful for performance analysis and animation timing. It returns a Long representing milliseconds. ```kotlin open fun getDrawingTime(): Long ``` -------------------------------- ### Get Layout Animation Listener (Kotlin) Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.node/-view-node2/-layout Retrieves the Animation.AnimationListener associated with the layout animation. This listener can be used to respond to animation start, end, or repeat events. Returns an Animation.AnimationListener object or null. ```kotlin open fun getLayoutAnimationListener(): Animation.AnimationListener ``` -------------------------------- ### LoadHelper - URI Parsing and Input Stream Creation Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.utilities/-load-helper/index Methods for creating `InputStream` objects from URIs and parsing URI components. ```APIDOC ## LoadHelper - URI Parsing and Input Stream Creation ### Description Methods for creating `InputStream` objects from URIs and parsing URI components. ### Functions #### fromUri ##### Description Creates different `InputStream` objects depending on the contents of the `Uri`. ##### Parameters - **context** (Context) - Required - The application context. - **sourceUri** (Uri) - Required - The source `Uri`. ##### Returns - Callable - A callable that provides an `InputStream`. #### fromUri ##### Description Creates different `InputStream` objects depending on the contents of the `Uri`, allowing for custom request properties. ##### Parameters - **context** (Context) - Required - The application context. - **sourceUri** (Uri) - Required - The source `Uri`. - **requestProperty** (@Nullable Map) - Optional - A map of request properties. ##### Returns - Callable - A callable that provides an `InputStream`. #### getLastPathSegment ##### Description Retrieves the last path segment of a given `Uri`. ##### Parameters - **uri** (Uri) - Required - The `Uri` to parse. ##### Returns - String - The last path segment of the `Uri`. ``` -------------------------------- ### Manage ARCore Session with Android Lifecycle API Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview The ARCore class manages an ARCore Session, integrating with the Android Lifecycle API. It handles the installation of Google Play Services for AR and requests necessary permissions before starting a session. ```kotlin class ARCore(val onSessionCreated: (session: Session) -> Unit, val onSessionResumed: (session: Session) -> Unit, val onSessionPaused: (session: Session) -> Unit, val onArSessionFailed: (Exception) -> Unit, val onSessionConfigChanged: (session: Session, config: Config) -> Unit) ``` -------------------------------- ### Show Context Menu Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture Displays a context menu for the view or a child view. This is typically used to provide options related to the selected item. ```Kotlin open fun showContextMenu(): Boolean open fun showContextMenuForChild(originalView: View): Boolean ``` -------------------------------- ### ARCore Installation Check Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-core/check-install Checks if ARCore is installed on the device. If not installed, it attempts to request the installation. Returns true if ARCore is already installed. ```APIDOC ## checkInstall ### Description Checks if ARCore is already installed or attempts to request an install otherwise. Returns true if ARCore is already installed. ### Method (Function Signature - Not an HTTP method) ### Endpoint (N/A - This is a function call within an Android application) ### Parameters #### Path Parameters (N/A) #### Query Parameters (N/A) #### Request Body (N/A) ### Request Example ```kotlin // Assuming 'this' is a ComponentActivity val isArCoreInstalled = checkInstall(this, true) ``` ### Response #### Success Response - **Boolean** (Boolean) - true if ARCore is already installed, false otherwise (or if installation was requested and is pending). #### Response Example ```json { "result": true } ``` ### Throws - **UnavailableDeviceNotCompatibleException**: If the device does not support ARCore. ``` -------------------------------- ### POST /createMaterial (Buffer) Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.loaders/-material-loader/create-material Creates a Material object from a binary buffer. This buffer is typically generated by libfilamat or matc. ```APIDOC ## POST /createMaterial (Buffer) ### Description Creates and returns a Material object from a binary buffer. A Filament Material defines the visual appearance of an object. Materials function as templates from which MaterialInstances can be spawned. ### Method POST ### Endpoint /createMaterial ### Parameters #### Request Body - **payload** (Buffer) - Required - Specifies the material data. The material data is a binary blob produced by libfilamat or by matc. ### Request Example ```json { "payload": "binary_data_here" } ``` ### Response #### Success Response (200) - **Material** (Material) - The created Material object. #### Response Example ```json { "material_instance": "..." } ``` ### See also MaterialLoader.loadMaterial ``` -------------------------------- ### Install ARCore - Kotlin Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-core/install The 'install' function attempts to request an ARCore installation if not already present. It takes an Activity and a boolean indicating if installation was requested. It returns true if an installation attempt was made. This function may throw an UnavailableDeviceNotCompatibleException if the device does not support ARCore. ```kotlin fun install(activity: ComponentActivity, installRequested: Boolean): Boolean ``` -------------------------------- ### POST /setSource (Context, Uri) Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-material/-builder/set-source Allows a Material to be constructed asynchronously from a Uri. The material will be registered using the Uri, and a previously registered material with the same Uri will be reused. ```APIDOC ## POST /setSource (Context, Uri) ### Description Allows a Material to be constructed from a Uri. Construction will be asynchronous. The material will be added to the registry using the Uri. A previously registered material with the same Uri will be re-used. ### Method POST ### Endpoint `/setSource` ### Parameters #### Request Body - **context** (Context) - Required - Sets the Context used for loading the resource. - **sourceUri** (Uri) - Required - Sets a remote Uri or android resource Uri. The material will be added to the registry using the Uri. A previously registered material with the same Uri will be re-used. ### Request Example ```json { "context": "...", "sourceUri": "..." } ``` ### Response #### Success Response (200) - **Material.Builder** (Material.Builder) - Builder for chaining setup calls. ``` -------------------------------- ### Check ARCore Installation Status and Request Install - Sceneview Android Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-core/index Checks if ARCore is installed and, if not, attempts to request its installation. The `installRequested` parameter can be used to track if an installation prompt was shown. ```kotlin fun checkInstall(activity: ComponentActivity, installRequested: Boolean): Boolean { // Implementation to check and potentially request ARCore install return installRequested // Placeholder } ``` -------------------------------- ### Builder Methods Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.texture/-video-texture/-builder/index Methods for configuring and building Texture objects. ```APIDOC ## Functions ### build #### Description Builds the Texture object with the configured parameters. #### Method `open override fun build(engine: Engine): Texture` #### Endpoint N/A #### Parameters * **engine** (Engine) - The engine instance to use for building the texture. ### depth #### Description Sets the depth of the texture. #### Method `@NonNull open fun depth(@IntRange(from = 1) p0: Int): Texture.Builder` #### Endpoint N/A #### Parameters * **p0** (Int) - The depth value (must be >= 1). ### format #### Description Sets the internal format of the texture. #### Method `@NonNull open fun format(@NonNull p0: Texture.InternalFormat): Texture.Builder` #### Endpoint N/A #### Parameters * **p0** (Texture.InternalFormat) - The internal format of the texture. ### height #### Description Sets the height of the texture. #### Method `@NonNull open fun height(@IntRange(from = 1) p0: Int): Texture.Builder` #### Endpoint N/A #### Parameters * **p0** (Int) - The height value (must be >= 1). ### importTexture #### Description Imports a texture from a given resource ID. #### Method `@NonNull open fun importTexture(p0: Long): Texture.Builder` #### Endpoint N/A #### Parameters * **p0** (Long) - The resource ID of the texture to import. ### levels #### Description Sets the number of mipmap levels for the texture. #### Method `@NonNull open fun levels(@IntRange(from = 1) p0: Int): Texture.Builder` #### Endpoint N/A #### Parameters * **p0** (Int) - The number of mipmap levels (must be >= 1). ### sampler #### Description Sets the sampler for the texture. #### Method `@NonNull open fun sampler(@NonNull p0: Texture.Sampler): Texture.Builder` #### Endpoint N/A #### Parameters * **p0** (Texture.Sampler) - The sampler configuration for the texture. ### stream #### Description Creates a VideoTexture.Builder from a stream. #### Method `fun stream(stream: Stream): VideoTexture.Builder` #### Endpoint N/A #### Parameters * **stream** (Stream) - The stream to create the VideoTexture.Builder from. ### swizzle #### Description Sets the swizzle channels for the texture. #### Method `@NonNull open fun swizzle(@NonNull p0: Texture.Swizzle, @NonNull p1: Texture.Swizzle, @NonNull p2: Texture.Swizzle, @NonNull p3: Texture.Swizzle): Texture.Builder` #### Endpoint N/A #### Parameters * **p0** (Texture.Swizzle) - The swizzle for the red channel. * **p1** (Texture.Swizzle) - The swizzle for the green channel. * **p2** (Texture.Swizzle) - The swizzle for the blue channel. * **p3** (Texture.Swizzle) - The swizzle for the alpha channel. ### usage #### Description Sets the usage flags for the texture. #### Method `@NonNull open fun usage(p0: Int): Texture.Builder` #### Endpoint N/A #### Parameters * **p0** (Int) - The usage flags for the texture. ### width #### Description Sets the width of the texture. #### Method `@NonNull open fun width(@IntRange(from = 1) p0: Int): Texture.Builder` #### Endpoint N/A #### Parameters * **p0** (Int) - The width value (must be >= 1). ### Request Example ```java Texture texture = new Builder() .width(100) .height(50) .format(Texture.InternalFormat.RGB) .build(engine); ``` ### Response #### Success Response (200) * **Texture** (Texture) - The constructed Texture object. #### Response Example ```json { "example": "Texture object details" } ``` ``` -------------------------------- ### Sceneview Android Installation Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-core/install Provides information on how to install the Sceneview SDK within an Android activity and details potential exceptions. ```APIDOC ## Sceneview Android Installation ### Description Installs the Sceneview SDK within an Android activity. Returns true if an installation was attempted. ### Method `fun install(activity: ComponentActivity, installRequested: Boolean): Boolean` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```kotlin // Example usage within an Android Activity val installAttempted = install(this, true) ``` ### Response #### Success Response (Boolean) - **true** (Boolean) - Indicates that an attempt was made to request an install. - **false** (Boolean) - Indicates that no install was requested or attempted. #### Throws - **UnavailableDeviceNotCompatibleException** - Thrown if the device does not support ARCore. ``` -------------------------------- ### Request ARCore Installation - Sceneview Android Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-core/index Attempts to initiate the installation of ARCore on the device. Returns `true` if an installation attempt was made. ```kotlin fun install(activity: ComponentActivity, installRequested: Boolean): Boolean { // Implementation to request ARCore installation return installRequested // Placeholder } ``` -------------------------------- ### CameraNode Constructors Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.node/-camera-node/-camera-node Provides details on the different ways to instantiate a CameraNode object. ```APIDOC ## CameraNode Constructors ### Description This section details the constructors for the `CameraNode` class, allowing for the creation of camera nodes with different initial configurations. ### Method - `constructor(engine: Engine, camera: Camera.() -> Unit = {})` - `constructor(engine: Engine, entity: Entity)` ### Parameters #### Constructor 1: `constructor(engine: Engine, camera: Camera.() -> Unit = {})` - **engine** (Engine) - Required - The engine instance to which the camera node will be associated. - **camera** (Camera.() -> Unit) - Optional - A lambda function to configure the camera properties upon creation. #### Constructor 2: `constructor(engine: Engine, entity: Entity)` - **engine** (Engine) - Required - The engine instance to which the camera node will be associated. - **entity** (Entity) - Required - An existing entity to be used as the base for the camera node. ### Request Example ```kotlin // Example for constructor 1 val cameraNode1 = CameraNode(engine) { /* configure camera properties here */ } // Example for constructor 2 val existingEntity = Entity() val cameraNode2 = CameraNode(engine, existingEntity) ``` ### Response #### Success Response - **CameraNode** (CameraNode) - The newly created CameraNode instance. #### Response Example ```kotlin // A CameraNode object is returned upon successful instantiation. // The specific internal state depends on the constructor used and provided parameters. ``` ``` -------------------------------- ### Initialize Geometry Builder (Kotlin) Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.geometries/-geometry/-builder/index Demonstrates the initialization of the `Builder` class for creating `Geometry` objects. It shows the default constructor and how to specify the primitive type. ```kotlin open class Builder(val primitiveType: RenderableManager.PrimitiveType = PrimitiveType.TRIANGLES) constructor(primitiveType: RenderableManager.PrimitiveType = PrimitiveType.TRIANGLES) ``` -------------------------------- ### Handle Temporary Detach Start (Kotlin) Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture This callback is invoked when a temporary detachment of the view is about to start. ```kotlin open fun onStartTemporaryDetach() ``` -------------------------------- ### Check ARCore Installation Status - Sceneview Android Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-core/index Checks if ARCore is currently installed on the device. This function helps determine if AR features can be used without requiring an installation. ```kotlin fun isInstalled(context: Context): Boolean { // Implementation to check if ARCore is installed return true // Placeholder } ``` -------------------------------- ### Start Action Mode Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture Initiates an ActionMode for the view or a child view. Action modes are used for contextual actions, often appearing in the action bar. ```Kotlin open fun startActionMode(callback: ActionMode.Callback): ActionMode open fun startActionModeForChild( originalView: View, callback: ActionMode.Callback): ActionMode ``` -------------------------------- ### Check ARCore Installability on Android Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-core/can-be-installed This function checks if the current Android device supports ARCore installation. It requires a `Context` object as input and returns a boolean indicating whether ARCore can be installed. ```kotlin fun canBeInstalled(context: Context): Boolean { // Implementation details to check ARCore compatibility return true // Placeholder } ``` -------------------------------- ### Set View Dimensions and Sizing Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture Methods for setting minimum height, minimum width, and padding for views. These control the spatial dimensions and layout behavior. ```kotlin open fun setMinimumHeight(minHeight: Int) open fun setMinimumWidth(minWidth: Int) open fun setPadding(left: Int, top: Int, right: Int, bottom: Int) open fun setPaddingRelative(start: Int, top: Int, end: Int, bottom: Int) ``` -------------------------------- ### Start View Transition in Android Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture Begins a view transition for a specified view. This method is used to animate the appearance or disappearance of a view within a transition. It takes the target view as a parameter and returns void. ```kotlin open fun startViewTransition(view: View) ``` -------------------------------- ### Start Action Mode and Animation (Kotlin) Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-scene-view/index Functions to start an action mode with a callback or at a specific flag, and to start an animation on a view. Action mode returns an ActionMode, while animation takes an Animation object. ```kotlin open fun startActionMode(p0: ActionMode.Callback): ActionMode open fun startActionMode(p0: ActionMode.Callback, p1: Int): ActionMode open fun startAnimation(p0: Animation) ``` -------------------------------- ### Quaternion Constructors Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.collision/-quaternion/-quaternion Provides details on the different ways to construct a Quaternion object. ```APIDOC ## Quaternion Constructors ### Description This section details the various constructors available for the Quaternion class, allowing for different initialization methods. ### Method Constructors ### Endpoint N/A (Class Constructors) ### Parameters #### Default Constructor - **()`** - Constructor - Constructs a Quaternion and sets it to Identity. #### Value Constructor - **(x: Float, y: Float, z: Float, w: Float)** - Constructor - Constructs a Quaternion and sets each value. The Quaternion will be normalized during construction. #### Copy Constructor - **(q: Quaternion)** - Constructor - Constructs a Quaternion using values from another Quaternion. #### Axis-Angle Constructor - **(axis: Vector3, angle: Float)** - Constructor - Constructs a Quaternion using an axis/angle to define the rotation. #### Parameters - **axis** (Vector3) - Sets rotation direction. - **angle** (Float) - Angle size in degrees. #### Euler Angles Constructor - **(eulerAngles: Vector3)** - Constructor - Constructs a Quaternion based on Euler angles. #### Parameters - **eulerAngles** (Vector3) - The angle in degrees for each axis. ### See also eulerAngles(Vector3 eulerAngles) ``` -------------------------------- ### LightNode Constructors - Kotlin Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.node/-light-node/index Demonstrates the different ways to construct a LightNode in Kotlin. These constructors allow for initialization with an engine, entity, and optional builder configurations for light properties. ```kotlin constructor( engine: Engine, entity: Entity = EntityManager.get().create(), builder: LightManager.Builder) constructor( engine: Engine, type: LightManager.Type, entity: Entity = EntityManager.get().create(), apply: LightManager.Builder.() -> Unit) constructor(engine: Engine, entity: Entity) ``` -------------------------------- ### Get Camera Shutter Speed in Kotlin Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.node/-model-node/-camera-node/index Gets the shutter speed of the camera in seconds. This is a read-only property returning a Float. ```kotlin open val shutterSpeed: Float ``` -------------------------------- ### Get Camera Sensitivity in Kotlin Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.node/-model-node/-camera-node/index Gets the sensitivity setting of the camera, typically in ISO. This is a read-only property returning a Float. ```kotlin open val sensitivity: Float ``` -------------------------------- ### Context Menu and Action Mode Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview/-scene-view/index Methods for showing context menus and starting action modes. ```APIDOC ## showContextMenu ### Description Shows the context menu for the view. ### Method `open fun showContextMenu(): Boolean` `open fun showContextMenu(p0: Float, p1: Float): Boolean` ### Endpoint N/A (Method within a class) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "showContextMenu": { "x": 100.0, "y": 150.0 } } ``` ### Response #### Success Response (200) - **Boolean** (Boolean) - Indicates if the context menu was shown. #### Response Example ```json { "showContextMenu": true } ``` ## startActionMode ### Description Starts an action mode with a callback. ### Method `open fun startActionMode(p0: ActionMode.Callback): ActionMode` `open fun startActionMode(p0: ActionMode.Callback, p1: Int): ActionMode` ### Endpoint N/A (Method within a class) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "startActionMode": { "callback": "callback_object", "type": 0 } } ``` ### Response #### Success Response (200) - **ActionMode** (ActionMode) - The started ActionMode object. #### Response Example ```json { "startActionMode": "action_mode_object" } ``` ``` -------------------------------- ### ResourceRegistry Constructor Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.resources/-resource-registry/index Initializes a new instance of the ResourceRegistry class. ```APIDOC ## ResourceRegistry Constructor ### Description Initializes a new instance of the ResourceRegistry class. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters None ### Request Example ```kotlin val registry = ResourceRegistry() ``` ### Response #### Success Response N/A #### Response Example N/A ``` -------------------------------- ### Dispatching Window Insets Animation Start in Android Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview/-scene-view Called when a window insets animation is starting. It provides the animation details and its bounds. ```kotlin open fun dispatchWindowInsetsAnimationStart( p0: WindowInsetsAnimation, p1: WindowInsetsAnimation.Bounds): WindowInsetsAnimation.Bounds ``` -------------------------------- ### Renderable Builder Functions Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.model/index Documentation for functions related to building and loading Renderables, including asynchronous and coroutine-based methods. ```APIDOC ## Renderable Builder Functions ### Description Functions for managing the loading and creation of Renderable objects, supporting asynchronous operations. ### Method N/A (Function Call) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response #### Success Response (200) - **asDeferred** (Deferred) - Returns a Deferred object for non-blocking, cancellable renderable loading. - **await** (T) - Asynchronously loads a Renderable without blocking the thread. - **build** (T) - Loads a Renderable within a coroutine scope without blocking. #### Response Example N/A ``` -------------------------------- ### Start Animation (Android) Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-scene-view Method to start an animation on a view. This function takes an `Animation` object as a parameter to define the animation to be played. ```kotlin open fun startAnimation(p0: Animation) ``` -------------------------------- ### POST /createMaterial (Asset File) Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.loaders/-material-loader/create-material Creates a Material object from a .filamat asset file located at the specified file path. ```APIDOC ## POST /createMaterial (Asset File) ### Description Creates and returns a Material object from a Filamat asset file. A Filament Material defines the visual appearance of an object. Materials function as templates from which MaterialInstances can be spawned. ### Method POST ### Endpoint /createMaterial ### Parameters #### Request Body - **assetFileLocation** (String) - Required - The path to the .filamat asset file (e.g., "materials/mymaterial.filamat"). ### Request Example ```json { "assetFileLocation": "materials/mymaterial.filamat" } ``` ### Response #### Success Response (200) - **Material** (Material) - The created Material object. #### Response Example ```json { "material_instance": "..." } ``` ### See also MaterialLoader.createMaterial ``` -------------------------------- ### Handle Start Nested Scroll Events (Kotlin) Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture This method is called when a nested scroll operation is about to start. It returns a boolean indicating whether the view should participate in the nested scroll. ```kotlin open fun onStartNestedScroll( child: View, target: View, nestedScrollAxes: Int): Boolean ``` -------------------------------- ### Set Layout and Animation Properties Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture Methods for configuring layout parameters, transitions, and animation controllers for views and view groups. ```kotlin open fun setLayoutAnimation(controller: LayoutAnimationController) open fun setLayoutAnimationListener( animationListener: Animation.AnimationListener) open fun setLayoutParams(params: ViewGroup.LayoutParams) open fun setLayoutTransition(transition: LayoutTransition) ``` -------------------------------- ### Start and Stop Mirroring (Kotlin) Source: https://sceneview.github.io/api/sceneview-android/arsceneview/io.github.sceneview.ar/-a-r-scene-view/index Functions to start and stop mirroring a surface. `startMirroring` requires a Surface, coordinates, and dimensions, while `stopMirroring` only requires the Surface. ```kotlin fun startMirroring( surface: Surface, left: Int, bottom: Int, width: Int, height: Int) fun stopMirroring(surface: Surface) ``` -------------------------------- ### Start Mirroring Rendering (Kotlin) Source: https://sceneview.github.io/api/sceneview-android/sceneview/io.github.sceneview.utils/-surface-mirrorer/index Initiates the mirroring of the SceneView's rendering to a provided Surface. This function allows specifying the target area for the mirrored output. It requires a SceneView instance and the target Surface. ```kotlin fun startMirroring( sceneView: SceneView, surface: Surface, left: Int = 0, bottom: Int = 0, width: Int = sceneView.width, height: Int = sceneView.height) ``` -------------------------------- ### Set Autofill Hints (Kotlin) Source: https://sceneview.github.io/api/sceneview-android/sceneview/com.google.ar.sceneform.rendering/-render-view-to-external-texture/index Provides hints for autofill services about the type of data this view expects. This helps autofill services to automatically populate form fields. ```kotlin open fun setAutofillHints(autofillHints: Array) ```