ArModel

class ArModel(primitives: ArrayList<ArPrimitive>, val name: String = "") : Drawable, IArElement

Represents a collection of 3D primitives to be rendered in an augmented reality (AR) environment.

Parameters

primitives

List of 3D primitives to be rendered.

Constructors

Link copied to clipboard
constructor(p: ArPrimitive)
constructor(primitives: ArrayList<ArPrimitive>, name: String = "")

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Returns the bounding sphere of the transformed object.

Link copied to clipboard
open override fun getWorldPosition(): FloatArray

Gets the world position (centroid) of the AR element as a float array.

Link copied to clipboard
open override fun getZIndex(): Float

Gets the Z-index of the AR element, relevant only when the element is visible.

Link copied to clipboard
open override fun isInScreenBounds(): Boolean

Checks if an element is in screen bounds.

Link copied to clipboard
protected open override fun onAttachedToScreen()

Override this function to be notified when the ui element is attached to a screen

Link copied to clipboard
protected open override fun onDraw(canvas: CanvasBuffer)

The draw method is called to actually draw the ui element visual representation to the CanvasBuffer

Link copied to clipboard
fun rotate(east: Float, north: Float, up: Float): ArModel

Rotates the ArModel in 3D space using ENU coordinates system. system and degrees.

Link copied to clipboard
fun scale(factor: Float): ArModel
fun scale(east: Float, north: Float, up: Float): ArModel

Scales the ArModel in 3D space using ENU coordinates system.

Link copied to clipboard
open fun setColor(color: Int): ArModel

Set the foreground color of the model

Link copied to clipboard

Sets custom primitive indices to be used for calculating the bounding sphere of the ArModel. By default, the bounding sphere is calculated based on all primitives in the model. This function allows specifying a subset of primitives to be used for bounding sphere calculation.

Link copied to clipboard

Sets the model matrix for the ArModel.

Link copied to clipboard
open override fun toString(): String

To String

Link copied to clipboard
fun translate(east: Float, north: Float, up: Float): ArModel

Translates the ArModel in 3D space using ENU coordinates system.