OriginNode

class OriginNode(var context: Context) : LiGBaseNode

Debug model of a coordinate origin: three axis bars from the node's origin, X in red, Y in green and Z in blue, each 0.4 long and 0.05 thick (local units).

Not an AR object type, and nothing in the SDK creates it; add it under a node to visualize that node's origin and axes. The bars are built asynchronously as child nodes.

Note: the original description said it is shown according to a showDebugOrigin setting of ArBaseActivity; neither exists in this SDK. ArOriginNode is an identical duplicate of this class.

Author

Raymond Yang

Parameters

context

Context used to build the materials.

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard
Link copied to clipboard
@Nullable
@get:Nullable
var collisionShape: CollisionShape?
Link copied to clipboard
var context: Context?

Context used for gesture detection and loading; set to null by release.

Link copied to clipboard
Link copied to clipboard
var localPosition: Vector3
Link copied to clipboard
var localRotation: Quaternion
Link copied to clipboard
var localScale: Vector3
Link copied to clipboard
Link copied to clipboard
@Nullable
@get:Nullable
var parent: NodeParent?
Link copied to clipboard
@Nullable
@get:Nullable
val scene: Scene?
Link copied to clipboard

Functions

Link copied to clipboard
fun addChild(p0: Node)
Link copied to clipboard
open fun addLifecycleListener(p0: Node.LifecycleListener)
Link copied to clipboard
fun addLight(position: Vector3)

Adds a child node holding a white directional light (intensity 100000, falloff radius 3) at position in this node's local coordinates.

Link copied to clipboard
open fun addTransformChangedListener(p0: Node.TransformChangedListener)
Link copied to clipboard
open override fun callOnHierarchy(p0: Consumer<Node>)
Link copied to clipboard
fun checkPermission(permission: String): Boolean

Returns whether the app holds permission (a Manifest.permission name); false when context is null.

Link copied to clipboard
open override fun clone(): LiGBaseNode

Copies this node.

Link copied to clipboard
@Nullable
open fun findByName(p0: String): Node?
Link copied to clipboard
@Nullable
open override fun findInHierarchy(p0: Predicate<Node>): Node?
Link copied to clipboard

Returns the transparency last set with setAlpha.

Link copied to clipboard
fun getBack(): Vector3
Link copied to clipboard
Link copied to clipboard
fun getDown(): Vector3
Link copied to clipboard
fun getForward(): Vector3
Link copied to clipboard
fun getLeft(): Vector3
Link copied to clipboard
@Nullable
open fun getLight(): Light?
Link copied to clipboard

Returns the current tap listener.

Link copied to clipboard

Returns the current long-press listener.

Link copied to clipboard
fun getOnScaleListener(): (detector: ScaleGestureDetector) -> Unit?

Returns the current scale listener.

Link copied to clipboard
fun getOnScrollListener(): (e1: MotionEvent?, e2: MotionEvent?, distanceX: Float, distanceY: Float) -> Unit?

Returns the current scroll listener.

Link copied to clipboard
@Nullable
fun getParentNode(): Node?
Link copied to clipboard
@Nullable
open fun getRenderable(): Renderable?
Link copied to clipboard
open fun getRenderableInstance(): RenderableInstance
Link copied to clipboard
fun getRight(): Vector3
Link copied to clipboard
fun getUp(): Vector3
Link copied to clipboard
override fun getWorldModelMatrix(): Matrix
Link copied to clipboard
fun getWorldPosition(): Vector3
Link copied to clipboard
fun getWorldRotation(): Quaternion
Link copied to clipboard
fun getWorldScale(): Vector3
Link copied to clipboard
fun isDescendantOf(p0: NodeParent): Boolean
Link copied to clipboard
open fun isTopLevel(): Boolean
Link copied to clipboard
suspend fun loadModel(resource: Int): ModelRenderable

Loads a glTF/GLB model from a raw resource of the app or SDK and suspends until it is ready.

Link copied to clipboard
fun localToWorldDirection(p0: Vector3): Vector3
Link copied to clipboard
fun localToWorldPoint(p0: Vector3): Vector3
Link copied to clipboard
open fun onActivate()
Link copied to clipboard
open fun onDeactivate()
Link copied to clipboard
open fun onDistanceCalculated(distance: Float)

Called every frame while the node is enabled and in a scene, with the straight-line distance from the camera to the node in meters. Does nothing by default.

Link copied to clipboard
open override fun onTouchEvent(hitTestResult: HitTestResult?, motionEvent: MotionEvent): Boolean

Feeds touches to the scale and gesture detectors, which call the scale, click, scroll and long-click listeners.

Link copied to clipboard
open fun onTransformChange(p0: Node)
Link copied to clipboard
open override fun onUpdate(frameTime: FrameTime)

Called by Sceneform every frame. While the node is enabled, computes the distance to the camera (see onDistanceCalculated) and, if face-camera mode is on, turns the node about its Y axis toward the camera. Overrides should call super to keep both.

Link copied to clipboard
open fun release()

Releases the node's resources. Call this when the node is no longer used.

Link copied to clipboard
fun removeChild(p0: Node)
Link copied to clipboard
open fun removeLifecycleListener(p0: Node.LifecycleListener)
Link copied to clipboard

Removes the tap listener.

Link copied to clipboard

Removes the long-press listener.

Link copied to clipboard

Removes the scale listener.

Link copied to clipboard

Removes the scroll listener.

Link copied to clipboard
open fun removeTransformChangedListener(p0: Node.TransformChangedListener)
Link copied to clipboard
open fun setAlpha(alpha: Float)

Sets the node's transparency. (Currently only effective for view renderables and basic-shape 3D objects.)

Link copied to clipboard
fun setFacingCamera(enable: Boolean?)

Turns face-camera (billboard) mode on or off.

Link copied to clipboard
open fun setLight(@Nullable p0: Light?)
Link copied to clipboard
fun setLookDirection(p0: Vector3)
fun setLookDirection(p0: Vector3, p1: Vector3)
Link copied to clipboard
fun setOnClickListener(listener: (LiGBaseNode) -> Unit?)

Sets the listener called with this node when it is tapped (single tap up), on the main thread.

Link copied to clipboard

Sets the listener called with this node on a long press.

Link copied to clipboard
fun setOnScaleListener(listener: (detector: ScaleGestureDetector) -> Unit?)

Sets the listener called on each step of a two-finger scale gesture on the node.

Link copied to clipboard
fun setOnScrollListener(listener: (e1: MotionEvent?, e2: MotionEvent?, distanceX: Float, distanceY: Float) -> Unit?)

Sets the listener called while a finger scrolls (drags) on the node.

Link copied to clipboard
open fun setOnTapListener(@Nullable p0: Node.OnTapListener?)
Link copied to clipboard
open fun setOnTouchListener(@Nullable p0: Node.OnTouchListener?)
Link copied to clipboard
open fun setRenderable(@Nullable p0: Renderable?): RenderableInstance
Link copied to clipboard
open fun setWorldPosition(p0: Vector3)
Link copied to clipboard
open fun setWorldRotation(p0: Quaternion)
Link copied to clipboard
open fun setWorldScale(p0: Vector3)
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun worldToLocalDirection(p0: Vector3): Vector3
Link copied to clipboard
fun worldToLocalPoint(p0: Vector3): Vector3