CLEAR

SceneModule


The SceneModule class exposes properties and methods to access the objects in a scene.

Example

// The following example demonstrates how to retrieve named elements from a Scene.

const Scene = require('Scene');

// This example assumes the following scene tree in AR Studio:
//
// - Device (Default)
//   - Camera (Default)
//     - Focal Distance (Default)
//       - plane3D (3D Plane)
//         - planeText (2D Text)

// A common practice is to parent most scene objects to the Focal Distance.
const fd = Scene.root.child('Device').child('Camera').child('Focal Distance');

// 3D objects are addressed using the child() method:
var plane = fd.child('plane3D')

// 2D objects are addressed using the planarChild() method:
var text = plane.planarChild('planeText2D');

Properties

PropertyDescription

root

(get) root: SceneObjectBase (set) (Not Available)

Returns an object that is the root of the scene tree. Other objects are accessed by walking down the scene tree from the root using the SceneObjectBase.child and SceneObjectBase.find methods.

Methods

MethodDescription

unprojectToFocalPlane

unprojectToFocalPlane(location: PixelPointSignal): PointSignal

Returns a signal with the value that corresponds to the 3d point (in World Space, in current units) of the given screenSpace point from the PixelPointSignal. The z coordinate of the PointSignal will be calculated so that the 3d point will always be on the canvas (which should be on the Focal Plane).

This function can be combined with TouchGestures to create a 3d point signal. var S = require('Scene') TouchGestures.onPan().subscribe(function(gesture) { var signal = S.unprojectToFocalPlane(gesture.location); });

unprojectWithDepth

unprojectWithDepth(location: PixelPointSignal, depth: number): PointSignal Returns a signal with the value that corresponds to the 3d point value (in World Space, in current units) of the given screenSpace point from the PixelPointSignal The z coordinate of the PointSignal will always be equal to the given depth value. The depth should be given in current units.

This function can be combined with TouchGestures to create a 3d point signal. var Scene = require('Scene') var TouchGestures = require('TouchGestures') TouchGestures.onPan().subscribe(function(gesture) { var signal = Scene.unprojectWithDepth(gesture.location, 0.5); });

Classes

ClassDescription

AmbientLightSource

The AmbientLightSource class describes an ambient lighting source.

BlendShape

The BlendShape class describes a face which can be blended.

BlendShapesFace

The BlendShapesFace class encapsulates multiple blend faces.

BlendShapesMesh

The BlendShapesMesh class encapsulates multiple blendable meshes.

BoundingBox

The BoundingBox class describes the bounds of a scene element in the local coordinate system.

Bounds2D

The Bounds2D class describes the bounds of a scene element.

Camera

The Camera class exposes details about the device camera focal area.

CameraVisibility

The CameraVisibility class describes whether or not an object is visible from various camera views.

Canvas

The Canvas class describes a scene canvas.

DirectionalLightSource

The DirectionalLightSource class describes a directional light source.

DynamicExtrusion

The DynamicExtrusion class provides functionality for creating extruded 3D objects using a brush.

FaceAnchor

The FaceAnchor class describes an anchored face.

FaceMesh

The FaceMesh class describes a face mesh.

FaceTracker

The FaceTracker class propagates details of detected faces to the scene.

FocalDistance

The FocalDistance class describes a focal distance.

FocalPlane

The FocalPlane class exposes details about the focal plane of the device camera.

HandTrackerSceneObject

The HandTrackerSceneObject class encapsulates a hand tracking object.

Joint

The Joint class encapsulates a joint scene object.

Mesh

The Mesh class describes a scene mesh.

OutputVisibility

The OutputVisibility class describes whether or not an object is visible from various outputs.

ParticleEmitterInterpolations

The ParticleEmitterInterpolations class controls the particle interpolation system.

ParticleSystem

The ParticleSystem class implements the particle management system for the scene.

ParticleTypeDescription

The ParticleTypeDescription class provides functionality for setting particle sprite densities in the scene.

ParticleTypeDescriptions

The ParticleTypeDescriptions class provides a container for particle type descriptions.

PlanarDiv

The PlanarDiv class describes a div on a plane.

PlanarFlexContainer

The PlanarFlexContainer class describes a flex container on a plane.

PlanarFlexItem

The PlanarFlexItem class describes a flex item on a plane.

PlanarImage

The PlanarImage class describes an image rendered on a plane.

PlanarObject

The PlanarObject class describes an object on a plane.

PlanarText

The PlanarText class describes text on a plane.

Plane

The Plane class describes a plane.

PlaneTracker

The PlaneTracker class provides functionality for locating a 3D plane based on 2D screen coordinates.

PointLightSource

The PointLightSource class describes a point light source.

PointTracker

The 'PointerTracker' class describes a point tracker object.

Scene

The Scene class implements properties and methods to access the objects in a scene.

SceneObject

The SceneObject class describes an object in a scene.

SceneObjectBase

The SceneObjectBase class describes a scene object.

ScreenPlane

The ScreenPlane class describes a screen plane.

Skeleton

The Skeleton class describes a skeleton object.

Speaker

The Speaker class encapsulates an speaker for a scene. Old class name is AudioSource.

SpotLightSource

The SpotLightSource class describes a spot light source.

SvgImage

TargetTracker

The TargetTracker encapsulates a tracker for some target.

TextAlignmentWrapper

The TextAlignmentWrapper class contains text alignment details.

TextExtrusion

Transform

The Transform class describes an object transform for a scene.

WorldTransform

The WorldTransform class describes an object tranform for a sceneObject in world space.

segmentation

The segmentation class encapsulates image segmentation.

Enums

ValueDescription

HorizontalAlignment

The HorizontalAlignment enum describes how an element is aligned horizontally.

RenderMode

The RenderMode enum describes how to render a scene object.

ScalingOption

The ScalingOption enum describes how an element is scaled.

TextAlignment

The TextAlignment enum describes how a text element is aligned horizontally.

TrackingMode

The TrackingMode enum describes how a PlaneTracker is tracking an object.

VerticalAlignment

The VerticalAlignment enum describes how an element is aligned vertically.

VerticalTextAlignment

The VerticalTextAlignment enum describes how a text element is aligned vertically.