Skip to content

Latest commit

 

History

History
1892 lines (1352 loc) · 61.8 KB

doc.md

File metadata and controls

1892 lines (1352 loc) · 61.8 KB

Classes

VertoStudio

A singleton that represents the Verto Studio editor application

Scene

A Verto Studio Scene

Texture
Material
Camera

A 3D camera that uses spherical coordinates for positioning.

Model

A Verto Studio 3D model

Light

A Verto Studio 3D light

SceneSelection

Represents a user selection of Models

SelectedVertexItem

Represents a selected vertex

VertexSelection

Represents a user selection of Vertices (Points)

SelectedFaceItem

Represents a selected face

FaceSelection

Represents a user selection of Faces (Triangles or Quads)

ModelGenerator

A convenient ModelGenerator class

Quat

A utility class for generating Quaternion values

Vec3

A utility class representing a 3D Vector value

Triangle

A utility class representing a Triangle face

Quad

A utility class representing a Quad face

Animation

A utility class that drives animations inside of Verto Studio's Graphics Engine

VR

A special class containing functions for accessing the current VR state.

Note: This class must be imported via ```import { VR } from 'VR';``` before it can be used. This class will not be available on non-VR versions of Verto Studio.

Typedefs

Point3D : object
Point4D : object
InputDialogCallback : function

The inputDialog callback function

DialogParam : object
DialogOptions : object
ModelEditFinishCallback : function

The finish function used by Model.edit()

ModelEditFunction : function

The editor function used by Model.edit()

AnimationCallbackboolean

The Animation handler function that is called once per animation frame.

VRHMD : object
VRController : object

VertoStudio

A singleton that represents the Verto Studio editor application

Kind: global class

VertoStudio.globalState : object

Accesses the global state object. This object is persisted across multiple script executions.

Note: Any values stored in here will be readable by ALL other vertoJS scripts ran by the user.

Kind: static property of VertoStudio

VertoStudio.alert(Msg)

Presents up an OS-themed modal alert dialog.

Kind: static method of VertoStudio

Param Type Description
Msg string The message to display in the alert

VertoStudio.version() ⇒ number

Returns the Verto Studio version.

Kind: static method of VertoStudio
Returns: number - - The version of the application.

VertoStudio.inputDialog(dialogOptions, callback)

Presents an input dialog to the user with various parameter types.

Kind: static method of VertoStudio

Param Type Description
dialogOptions DialogOptions The options for presenting the dialog.
callback InputDialogCallback The callback that handles the user response.

VertoStudio.onScriptEnd(callback)

Registers a callback to signify the very end of the current script's execution, including all outstanding animations and input dialogs. This method can be useful for restoring the state of objects modified by transient operations such as animations.

Kind: static method of VertoStudio

Param Type Description
callback ScriptEndCallback The callback that signifies the end of the script execution.

VertoStudio.isVR() ⇒ boolean

Kind: static method of VertoStudio
Returns: boolean - True if running on a Virtual Reality device

VertoStudio.environmentType() ⇒ string

Obtains the current environment type that Verto Studio is running in.

Kind: static method of VertoStudio
Returns: string - 'PC', 'Tablet', 'Phone', 'Holographic', or 'VR'

Scene

A Verto Studio Scene

Kind: global class

scene.current : Scene

Accesses the currently active Scene

Kind: instance property of Scene
Read only: true

scene.models : Array.<Model>

The Scene's models

Kind: instance property of Scene
Read only: true

scene.camera : Camera

The Scene's current active camera

Kind: instance property of Scene
Read only: true

scene.textures : Array.<Texture>

The Scene's loaded textures

Kind: instance property of Scene
Read only: true

scene.materials : Array.<Material>

The Scene's materials

Kind: instance property of Scene
Read only: true

scene.selectionMode : string

The current selection mode ('vertex' or 'face')

Kind: instance property of Scene
Read only: true

scene.editTarget : Model

The current edit target (defined if editMode is true)

Kind: instance property of Scene
Read only: true

scene.editMode : boolean

Whether or not the Scene is currently in edit mode.

Kind: instance property of Scene
Read only: true

The Scene selection

Kind: instance property of Scene

scene.lights() : Array.<Light>

The Scene's lights

Kind: instance method of Scene
Read only: true

scene.loadAllTextures()

Loads all of the Scene's textures

Kind: instance method of Scene

scene.selectAll()

Selects all models, vertices, or faces depending upon the current Scene's selection mode & edit mode state.

Kind: instance method of Scene

scene.selectNone()

Clears the current Scene's selection

Kind: instance method of Scene

scene.selectInverse()

Inverts the current Scene's selection

Kind: instance method of Scene

Texture

Kind: global class

new Texture([scene], name, path)

Creates a Texture and adds it to a Scene

Note: On macOS platforms, this method may trigger a security open dialog to prompt the user to allow access to the texture file.

Param Type Description
[scene] Scene The scene to add this texture to (defaults to Scene.current)
name string The unique name of this texture.
path string A full path to the texture's location on the disk. Currently PNG & JPG file formats are supported.

texture.mipmapped : boolean

The textures mipmap state

Kind: instance property of Texture

Material

Kind: global class

new Material([scene], [name])

Creates a Material and adds it to a Scene

Param Type Description
[scene] Scene The scene to add this material to (defaults to Scene.current)
[name] string The unique name of this material.

material.texture : Texture

The Material's texture assignment

Kind: instance property of Material

material.textureTileY : number

The Material's texture tiling in the Y(V) direction

Kind: instance property of Material

material.textureTileX : number

The Material's texture tiling in the X(U) direction

Kind: instance property of Material

material.shininess : number

The Material's shininess component (phong model)

Kind: instance property of Material

material.emissive : Array.<number>

The Material's RGBA emissive component (phong model)

Kind: instance property of Material

material.specular : Array.<number>

The Material's RGBA specular (reflective) component (phong model)

Kind: instance property of Material

material.ambient : Array.<number>

The Material's RGBA ambient component (phong model)

Kind: instance property of Material

material.diffuse : Array.<number>

The Material's RGBA diffuse (main color) component (phong model)

Kind: instance property of Material

Camera

A 3D camera that uses spherical coordinates for positioning.

Kind: global class

camera.pos : Point3D

The Camera's current position in 3D space

Kind: instance property of Camera
Read only: true

camera.distance : number

The Camera's r-value distance from its center in spherical coordinates.

Kind: instance property of Camera

camera.phi : number

The Camera's phi position in spherical coordinates (in degrees).

Kind: instance property of Camera

camera.theta : number

The Camera's theta position in spherical coordinates (in degrees).

Kind: instance property of Camera

camera.center : Point3D

The Camera's center position in spherical coordinates.

Kind: instance property of Camera

camera.lookAt(newCenter, newVantage)

Moves the camera to a given vantage point looking at a given center point.

Kind: instance method of Camera

Param Type Description
newCenter Point3D The new center position for which the camera will look towards.
newVantage Point3D The new vantage position from where the camera will look.

Model

A Verto Studio 3D model

Kind: global class

new Model()

Creates a new empty Model and adds it to a Scene

model.name : string

Accesses the Model's user-facing name.

Kind: instance property of Model

model.cullBackfaces : boolean

Change this to true to enable backface-culling on this model.

Kind: instance property of Model

model.quads : Uint32Array

Accesses the Model's Quad face index array

Note: Use Quad.array(model.quads) to obtain an array of Quad objects from this value.

Kind: instance property of Model
Read only: true

model.triangles : Uint32Array

Accesses the Model's Triangle face index array

Note: Use Triangle.array(model.triangles) to obtain an array of Triangle objects from this value.

Kind: instance property of Model
Read only: true

model.texcoords : Float32Array

Accesses the Model's texcoords vertex array

Note: Use Vec2.array(model.texcoords) to obtain an array of Vec2 objects from this value.

Kind: instance property of Model
Read only: true

model.normals : Float32Array

Accesses the Model's normals vertex array

Note: Use Vec3.array(model.normals) to obtain an array of Vec3 objects from this value.

Kind: instance property of Model
Read only: true

model.vertices : Float32Array

Accesses the Model's position (vertices) vertex array

Note: Use Vec3.array(model.vertices) to obtain an array of Vec3 objects from this value.

Kind: instance property of Model
Read only: true

model.material : Material

Accesses the Model's material

Kind: instance property of Model

model.hidden : boolean

Accesses the Model's hidden state.

Kind: instance property of Model

model.scale : Array.<number>

Accesses the Model's 3D XYZ scale value.

Kind: instance property of Model

model.orientation : Array.<number>

Accesses the Model's 3D XYZW quaternion orientation value

Note: You can use the Quat.fromAxisAngle() utility method to construct this value.

Kind: instance property of Model

model.pos : Point3D

Accesses the Model's 3D position

Kind: instance property of Model

model.z : number

Accesses the Model's 3D Z-position

Kind: instance property of Model

model.y : number

Accesses the Model's 3D Y-position

Kind: instance property of Model

model.x : number

Accesses the Model's 3D X-position

Kind: instance property of Model

model.edit(callback)

Performs an edit on this model. For the edit to be completed, the provided callback function must be called with the proper new model data values.

Kind: instance method of Model

Param Type Description
callback ModelEditFunction A function that implements the model edit.

model.fromSceneSpace(p) ⇒ Point3D

Converts the given vector from scene space to this model's space

Kind: instance method of Model
Returns: Point3D - - The converted position.

Param Type Description
p Point3D | Point4D The position or vector to convert.

model.toSceneSpace(p) ⇒ Point3D

Converts the given vector from this model's space to scene space.

Kind: instance method of Model
Returns: Point3D - - The converted position.

Param Type Description
p Point3D | Point4D The position or vector to convert.

Light

A Verto Studio 3D light

Kind: global class

new Light()

Creates a new Light and adds it to a Scene

Note: The default Verto Studio phong shader only supports up to 8 lights per scene.

light.type : string

Accesses the Light's light type. One of 'point', 'spot', or 'direction'

Kind: instance property of Light

light.w : number

Accesses the Light's position w-component. This is either 0 for direction lights or 1 for point lights.

Kind: instance property of Light

light.z : number

Accesses the Light's position z-component.

Kind: instance property of Light

light.y : number

Accesses the Light's position y-component.

Kind: instance property of Light

light.x : number

Accesses the Light's position x-component.

Kind: instance property of Light

light.spotAngleCutoff : number

Accesses the Light's spot angle cutoff. In the range of 0 to 90

Kind: instance property of Light

light.spotIntensity : number

Accesses the Light's spot intensity. In the range of 0 to 128

Kind: instance property of Light

light.spotDirection : Point3D

Accesses the Light's spot direction

Kind: instance property of Light

light.attenuation : Array.<number>

Accesses the Light's attenuation vector array. In the order of Constant, Linear, Quadratic.

Kind: instance property of Light

light.pos : Point3D

Accesses the Light's 3D position.

Kind: instance property of Light

light.specular : Array.<number>

The Lights's RGBA specular (highlight) component (phong model)

Kind: instance property of Light

light.ambient : Array.<number>

The Lights's RGBA ambient component (phong model)

Kind: instance property of Light

light.diffuse : Array.<number>

The Lights's RGBA diffuse component (phong model)

Kind: instance property of Light

SceneSelection

Represents a user selection of Models

Kind: global class

new SceneSelection([scene])

Creates a new empty Selection

Param Type Description
[scene] Scene The scene for which this selection will be for.

sceneSelection.items : Array.<Model>

The Selections items

Kind: instance property of SceneSelection
Read only: true

sceneSelection.count : integer

The Number of items in the selection

Kind: instance property of SceneSelection
Read only: true

sceneSelection.add(item)

Adds an item to the selection

Kind: instance method of SceneSelection

Param Type Description
item Model The item to add to the selection.

sceneSelection.remove(item)

Removes an item from the selection

Kind: instance method of SceneSelection

Param Type Description
item Model The item to remove from the selection.

sceneSelection.clear()

Clears all items from the selection

Kind: instance method of SceneSelection

sceneSelection.translate(delta)

Translates this Selection's items

Kind: instance method of SceneSelection

Param Type Description
delta Point3D The translation amount.

sceneSelection.rotate(axis, angle)

Translates this Selection's items about their local origin

Kind: instance method of SceneSelection

Param Type Description
axis Point3D The rotation axis.
angle number The rotation amount (in degrees).

sceneSelection.scale(scale)

Scales this Selection's items

Kind: instance method of SceneSelection

Param Type Description
scale Point3D The 3D scale amount.

sceneSelection.delete()

Deletes this Selection's items from the scene

Kind: instance method of SceneSelection

sceneSelection.duplicate()

Duplicate this Selection's items within the scene

Kind: instance method of SceneSelection

SelectedVertexItem

Represents a selected vertex

Kind: global class

selectedVertexItem.type : String

The type of this selected item ('vertex')

Kind: instance property of SelectedVertexItem

selectedVertexItem.index : integer

The index of this selected vertex

Kind: instance property of SelectedVertexItem

VertexSelection

Represents a user selection of Vertices (Points)

Kind: global class

new VertexSelection([scene])

Creates a new empty Selection for the currently edited model

Note: Verto Studio (the current scene) must be in edit mode to use this class

Param Type Description
[scene] Scene The scene for which this selection will be for.

vertexSelection.items : Array.<SelectedVertexItem>

The Selections items

Kind: instance property of VertexSelection
Read only: true

vertexSelection.count : integer

The Number of items in the selection

Kind: instance property of VertexSelection
Read only: true

vertexSelection.add(item)

Adds an item to the selection

Kind: instance method of VertexSelection

Param Type Description
item SelectedVertexItem The item to add to the selection.

vertexSelection.remove(item)

Removes an item from the selection

Kind: instance method of VertexSelection

Param Type Description
item SelectedVertexItem The item to remove from the selection.

vertexSelection.clear()

Clears all items from the selection

Kind: instance method of VertexSelection

vertexSelection.translate(delta)

Translates this Selection's items

Kind: instance method of VertexSelection

Param Type Description
delta Point3D The translation amount.

vertexSelection.rotate(axis, angle)

Translates this Selection's items about their local origin

Kind: instance method of VertexSelection

Param Type Description
axis Point3D The rotation axis.
angle number The rotation amount (in degrees).

vertexSelection.scale(scale)

Scales this Selection's items

Kind: instance method of VertexSelection

Param Type Description
scale Point3D The 3D scale amount.

vertexSelection.delete()

Deletes this Selection's items from the model

Kind: instance method of VertexSelection

vertexSelection.duplicate()

Duplicate this Selection's items within the scene

Kind: instance method of VertexSelection

vertexSelection.subdivide()

Subdivides all faces made up by this selection

Kind: instance method of VertexSelection

vertexSelection.flipFaces()

Flips (flips face normals and winding direction) all faces made up by this selection.

Kind: instance method of VertexSelection

vertexSelection.weld()

Welds this selection's vertices

Kind: instance method of VertexSelection

vertexSelection.selectConnected()

Expands the current selection by selecting all edge-connected vertices.

Kind: instance method of VertexSelection

vertexSelection.selectRing()

Expands the current selection by selecting the subtended edge ring.

Kind: instance method of VertexSelection

vertexSelection.splitQuads()

Splits (quad to triangle) all quads made up by this selection

Kind: instance method of VertexSelection

vertexSelection.mergeDoubles()

Merges duplicate vertices within this selection.

Kind: instance method of VertexSelection

vertexSelection.extrude(direction, cap)

Extrude the faces made up by this selection.

Kind: instance method of VertexSelection

Param Type Description
direction Point3D The extrusion vector.
cap boolean Whether or not to cap-off the extrusion (with new faces)

SelectedFaceItem

Represents a selected face

Kind: global class

selectedFaceItem.type : String

The type of this selected item ('triangle' or 'quad')

Kind: instance property of SelectedFaceItem

selectedFaceItem.group : integer

The index of the group this face belongs to within the model

Kind: instance property of SelectedFaceItem

selectedFaceItem.index : integer

The index of this selected face

Kind: instance property of SelectedFaceItem

FaceSelection

Represents a user selection of Faces (Triangles or Quads)

Kind: global class

new FaceSelection([scene])

Creates a new empty Selection for the currently edited model

Note: Verto Studio (the current scene) must be in edit mode to use this class

Param Type Description
[scene] Scene The scene for which this selection will be for.

faceSelection.items : Array.<SelectedFaceItem>

The Selections items

Kind: instance property of FaceSelection
Read only: true

faceSelection.count : integer

The Number of items in the selection

Kind: instance property of FaceSelection
Read only: true

faceSelection.add(item)

Adds an item to the selection

Kind: instance method of FaceSelection

Param Type Description
item SelectedFaceItem The item to add to the selection.

faceSelection.remove(item)

Removes an item from the selection

Kind: instance method of FaceSelection

Param Type Description
item SelectedFaceItem The item to remove from the selection.

faceSelection.clear()

Clears all items from the selection

Kind: instance method of FaceSelection

faceSelection.translate(delta)

Translates this Selection's items

Kind: instance method of FaceSelection

Param Type Description
delta Point3D The translation amount.

faceSelection.rotate(axis, angle)

Translates this Selection's items about their local origin

Kind: instance method of FaceSelection

Param Type Description
axis Point3D The rotation axis.
angle number The rotation amount (in degrees).

faceSelection.scale(scale)

Scales this Selection's items

Kind: instance method of FaceSelection

Param Type Description
scale Point3D The 3D scale amount.

faceSelection.delete()

Deletes this Selection's items from the model

Kind: instance method of FaceSelection

faceSelection.duplicate()

Duplicate this Selection's items within the scene

Kind: instance method of FaceSelection

faceSelection.subdivide()

Subdivides all faces made up by this selection

Kind: instance method of FaceSelection

faceSelection.flipFaces()

Flips (flips face normals and winding direction) all faces made up by this selection.

Kind: instance method of FaceSelection

faceSelection.weld()

Welds this selection's vertices

Kind: instance method of FaceSelection

faceSelection.selectConnected()

Expands the current selection by selecting all edge-connected vertices.

Kind: instance method of FaceSelection

faceSelection.selectRing()

Expands the current selection by selecting the subtended edge ring.

Kind: instance method of FaceSelection

faceSelection.splitQuads()

Splits (quad to triangle) all quads made up by this selection

Kind: instance method of FaceSelection

faceSelection.mergeDoubles()

Merges duplicate vertices within this selection.

Kind: instance method of FaceSelection

faceSelection.extrude(direction, cap)

Extrude the faces made up by this selection.

Kind: instance method of FaceSelection

Param Type Description
direction Point3D The extrusion vector.
cap boolean Whether or not to cap-off the extrusion (with new faces)

ModelGenerator

A convenient ModelGenerator class

Kind: global class

ModelGenerator.genSphere(radius, slices, stacks) ⇒ Model

Generates a UV-sphere and adds it to the scene.

Kind: static method of ModelGenerator
Returns: Model - - The newly generated model

Param Type Description
radius number The sphere radius
slices integer The number of U-subdivisions
stacks integer The number of V-subdivisions

ModelGenerator.genTorus(radius1, radius2, rings, segments) ⇒ Model

Generates a torus and adds it to the scene.

Kind: static method of ModelGenerator
Returns: Model - - The newly generated model

Param Type Description
radius1 number The first radius
radius2 number The second radius
rings integer The number of ring subdivisions
segments integer The number of segment subdivisions

ModelGenerator.genPlane(wt, ln) ⇒ Model

Generates a XZ plane and adds it to the scene.

Kind: static method of ModelGenerator
Returns: Model - - The newly generated model

Param Type Description
wt number The plane width
ln number The plane length

ModelGenerator.genCube(size) ⇒ Model

Generates a flat-shaded cube and adds it to the scene.

Kind: static method of ModelGenerator
Returns: Model - - The newly generated model

Param Type Description
size number The cube size.

Quat

A utility class for generating Quaternion values

Kind: global class

Quat.fromAxisAngle(angleDegrees, x, y, z) ⇒ Array.<number>

Generates a rotation quaternion from axis-angle.

Kind: static method of Quat
Returns: Array.<number> - - The 4-tuple quaternion array value.

Param Type Description
angleDegrees number The rotation angle in degrees.
x number Rotation Axis X
y number Rotation Axis Y
z number Rotation Axis Z

Quat.apply(q, v)

Applies a quaternion's rotation transform to a position.

Kind: static method of Quat

Param Type Description
q Array.<number> Quaternion value representing a rotation.
v Vec3 the position.

Vec3

A utility class representing a 3D Vector value

Kind: global class

new Vec3(x, [y], [z])

Creates a Vec3 from XYZ values

Param Type Description
x number | Point3D x-value or any point object with x,y,z values
[y] number y-value
[z] number y-value

vec3.equals(rhs)

Equality comparison

Kind: instance method of Vec3

Param Type
rhs Vec3

vec3.length() ⇒ number

Kind: instance method of Vec3
Returns: number - This vector's geometric length

vec3.dot(rhs) ⇒ number

Kind: instance method of Vec3
Returns: number - The vector dot product

Param Type
rhs Vec3

vec3.cross(rhs) ⇒ Vec3

Kind: instance method of Vec3
Returns: Vec3 - The vector cross product

Param Type
rhs Vec3

vec3.add(vec)

Perform vector addition (+=)

Kind: instance method of Vec3

Param Type
vec Vec3

vec3.added(vec) ⇒ Vec3

Perform vector addition (+)

Kind: instance method of Vec3

Param Type
vec Vec3

vec3.subract(vec)

Perform vector subtraction (-=)

Kind: instance method of Vec3

Param Type
vec Vec3

vec3.subtracted(vec) ⇒ Vec3

Perform vector subtraction (-)

Kind: instance method of Vec3

Param Type
vec Vec3

vec3.scalarMultiply(sc)

Perform component-wise multiplication (*=)

Kind: instance method of Vec3

Param Type Description
sc number A scalar

vec3.scalarMultiplied(sc) ⇒ Vec3

Perform component-wise multiplication (*)

Kind: instance method of Vec3

Param Type Description
sc number A scalar

vec3.negate()

Negates this vector

Kind: instance method of Vec3

vec3.negated() ⇒ Vec3

Negates this vector

Kind: instance method of Vec3

vec3.normalize()

Normalizes this vector

Kind: instance method of Vec3

vec3.normalized() ⇒ Vec3

Normalizes this vector

Kind: instance method of Vec3

Vec3.array(va) ⇒ Array.<Vec3>

Converts low-level vertex array type to convenient Vec3 array

Kind: static method of Vec3

Param Type Description
va Float32Array A vertex array (tightly packed sets of XYZ float values)

Vec3.float32Array(v3a) ⇒ Float32Array

Converts convenient Vec3 array to optimized low-level vertex array

Kind: static method of Vec3

Param Type Description
v3a Array.<Vec3> The array of Vec3's to convert

Triangle

A utility class representing a Triangle face

Kind: global class

new Triangle(a, b, c)

Creates a Triangle from indices

Param Type Description
a integer First triangle index
b integer Second triangle index
c integer Third triangle index

triangle.equals(rhs)

Equality comparison

Kind: instance method of Triangle

Param Type
rhs Triangle

triangle.reversed() ⇒ Triangle

Kind: instance method of Triangle
Returns: Triangle - This triangle with reversed index order.

Triangle.array(ia) ⇒ Array.<Triangle>

Converts low-level index array type to convenient Triangle array

Kind: static method of Triangle

Param Type Description
ia Uint32Array A Triangle array (tightly packed sets of ABC integer values)

Triangle.uint32Array(i3a) ⇒ Uint32Array

Converts convenient Triangle array to optimized low-level index array

Kind: static method of Triangle

Param Type Description
i3a Array.<Triangle> The array of Triangles to convert

Quad

A utility class representing a Quad face

Kind: global class

new Quad(a, b, c, d)

Creates a Quad from indices

Param Type Description
a integer First quad index
b integer Second quad index
c integer Third quad index
d integer Fourth quad index

quad.equals(rhs)

Equality comparison

Kind: instance method of Quad

Param Type
rhs Quad

quad.reversed() ⇒ Quad

Kind: instance method of Quad
Returns: Quad - This quad with reversed index order.

Quad.array(ia) ⇒ Array.<Quad>

Converts low-level index array type to convenient Triangle array

Kind: static method of Quad

Param Type Description
ia Uint32Array A Quad array (tightly packed sets of ABCD integer values)

Quad.uint32Array(i4a) ⇒ Uint32Array

Converts convenient Quad array to optimized low-level index array

Kind: static method of Quad

Param Type Description
i4a Array.<Quad> The array of Quads to convert

Animation

A utility class that drives animations inside of Verto Studio's Graphics Engine

Kind: global class

Animation.start([fps], callback)

Starts an animation that calls the given callback 30 or 60 times per second. When running in Verto Studio, the scene will automatically redraw itself after each time the handler is called.

Note: When running in Verto Studio, only one animation is permitted to run at a single time.

Kind: static method of Animation

Param Type Description
[fps] integer The FPS to run this animation at. Defaults to 30. Currently valid values are 60 or 30.
callback AnimationCallback The callback that is called once per animation frame.

Animation.stop()

Stops the current animation if one is in progress.

Kind: static method of Animation

VR

A special class containing functions for accessing the current VR state.

Note: This class must be imported via ```import { VR } from 'VR';``` before it can be used. This class will not be available on non-VR versions of Verto Studio.

Kind: global class

VR.hmd : VRHMD

Accesses the currently active VR HMD representing the position of the user's head in VR.

Kind: static property of VR
Read only: true

VR.controllers : Array.<VRController>

Accesses the current state of the VR controllers.
Controller index 0 always represents the user's dominant hand.

Kind: static property of VR
Read only: true

Point3D : object

Kind: global typedef
Properties

Name Type Description
x number X position
y number Y position
z number Z position

Point4D : object

Kind: global typedef
Properties

Name Type Description
x number X position
y number Y position
z number Z position
w number W position

InputDialogCallback : function

The inputDialog callback function

Kind: global typedef

Param Type Description
[values] Object The parameter values modified by the user.

DialogParam : object

Kind: global typedef
Properties

Name Type Description
name string The parameter name
type string The parameter type (one of string, decimal, integer, or bool)
[min] number The min value for the slider range affecting numeric param types.
[max] number The max value for the slider range affecting numeric param types.
value string | number | boolean The parameter name

DialogOptions : object

Kind: global typedef
Properties

Name Type Description
[title] string The dialog title
params Array.<DialogParam> The dialog parameters

ModelEditFinishCallback : function

The finish function used by Model.edit()

Kind: global typedef

Param Type Description
newVerts Float32Array The new vertices (can be constructed via Vec3.float32Array() utility method)
newNorms Float32Array The new normals (can be constructed via Vec3.float32Array() utility method)
newTexcoords Float32Array The new texture coordinates (can be constructed via Vec2.float32Array() utility method)
newTriangles Uint32Array The new triangle indices (can be constructed via Triangle.uint32Array() utility method)
newQuads Uint32Array The new quad indices (can be constructed via Quad.uint32Array() utility method)

ModelEditFunction : function

The editor function used by Model.edit()

Kind: global typedef

Param Type Description
m Model The model being edited (this model).
finish ModelEditFinishCallback The method that must be called at the end of the edit to provide the new model data values.

AnimationCallback ⇒ boolean

The Animation handler function that is called once per animation frame.

Kind: global typedef
Returns: boolean - True to keep animating, false to stop the animation.

VRHMD : object

Kind: global typedef
Properties

Name Type Description
pos Point3D The HMD position.
up Point3D The HMD up vector.
forward Point3D The forward (gaze) vector from the HMD.

VRController : object

Kind: global typedef
Properties

Name Type Description
pos Point3D The controller position.
up Point3D The controller up vector.
forward Point3D The forward (selection ray) vector from the controller.
cursorPos Point3D The ray-casted cursor position for this controller.
cursorNorm Point3D The ray-casted cursor normal for this controller.
trigger number The pressed state of the controller's trigger button.
grip number The pressed state of the controller's grip button.
button1 number The pressed state of the controller's first generic button.
button2 number The pressed state of the controller's second generic button.