Options
All
  • Public
  • Public/Protected
  • All
V1.7
  • V1.6
  • V1.7
Menu

Class Prism

Represents the bounded volume within which the Scenegraph renders. Prisms are created via the App::requestNewPrism function.

Hierarchy

  • Prism

Index

Constructors

Methods

Constructors

constructor

Methods

createAll

  • createAll(objectModelName: string): Node | null
  • Create all objects from a loaded object model and return them as children of newly created root Node.

    priv

    none

    Parameters

    • objectModelName: string

      The name of the object model.

    Returns Node | null

    Root node containing all objects from model or nullptr if creation failed

createAnimationBlendSetupResourceId

  • createAnimationBlendSetupResourceId(a_fileName: string | null, a_absolutePath?: boolean, a_descriptor?: number, a_basePath?: string | null): bigint
  • Creates animation blend setup resource

    priv

    none

    Parameters

    • a_fileName: string | null

      File name of the resource to load. By default assumed to be a relative path from the executable file.

    • Optional a_absolutePath: boolean

      default = false
      Flag that a_fileName is an absolute path name, instead of a relative path.

    • Optional a_descriptor: number

      default = -1
      - optional file descriptor that points to a resource. If passed to the resource the resource takes ownership of the File Descriptor.

    • Optional a_basePath: string | null

      default = null
      - If you are loading a resource from an absolute path, and that path != The current process path, set this field to the equivalent base path in the other client directory. This allows path relative dependencies to solve a fully qualified (absolute) path outside of the current process. This value defaults to the currently executing process root.

      NOTE: In case a Standard resource is already created. And a new resource is created with the same filename but instanced, it will not overwrite the standard resource. In that case, you will have to delete that resource, and post that, create a new instanced resource. This is not required if you want to use an instanced resource as a standard resource.

    Returns bigint

    ID for the Resource

createAnimationResourceId

  • createAnimationResourceId(a_fileName: string | null, a_absolutePath?: boolean, a_descriptor?: number, a_basePath?: string | null): bigint
  • Creates animation resource

    priv

    none

    Parameters

    • a_fileName: string | null

      File name of the resource to load. By default assumed to be a relative path from the executable file.

    • Optional a_absolutePath: boolean

      default = false
      Flag that a_fileName is an absolute path name, instead of a relative path.

    • Optional a_descriptor: number

      default = -1
      - optional file descriptor that points to a resource. If passed to the resource the resource takes ownership of the File Descriptor.

    • Optional a_basePath: string | null

      default = null
      - If you are loading a resource from an absolute path, and that path != The current process path, set this field to the equivalent base path in the other client directory. This allows path relative dependencies to solve a fully qualified (absolute) path outside of the current process. This value defaults to the currently executing process root.

      NOTE: In case a Standard resource is already created. And a new resource is created with the same filename but instanced, it will not overwrite the standard resource. In that case, you will have to delete that resource, and post that, create a new instanced resource. This is not required if you want to use an instanced resource as a standard resource.

    Returns bigint

    ID for the Resource

createAnimationSetResourceId

  • createAnimationSetResourceId(a_fileName: string | null, a_absolutePath?: boolean, a_descriptor?: number, a_basePath?: string | null): bigint
  • Creates animation set resource

    priv

    none

    Parameters

    • a_fileName: string | null

      File name of the resource to load. By default assumed to be a relative path from the executable file.

    • Optional a_absolutePath: boolean

      default = false
      Flag that a_fileName is an absolute path name, instead of a relative path.

    • Optional a_descriptor: number

      default = -1
      - optional file descriptor that points to a resource. If passed to the resource the resource takes ownership of the File Descriptor.

    • Optional a_basePath: string | null

      default = null
      - If you are loading a resource from an absolute path, and that path != The current process path, set this field to the equivalent base path in the other client directory. This allows path relative dependencies to solve a fully qualified (absolute) path outside of the current process. This value defaults to the currently executing process root.

      NOTE: In case a Standard resource is already created. And a new resource is created with the same filename but instanced, it will not overwrite the standard resource. In that case, you will have to delete that resource, and post that, create a new instanced resource. This is not required if you want to use an instanced resource as a standard resource.

    Returns bigint

    ID for the Resource

createAudioNode

  • Create a new AudioNode. After calling this createAudioNode(), must call one of the AudioNode::createSoundXxxxX() methods to create a specific type of audio node.

    Returns AudioNode | null

    New AudioNode on success; nullptr on failure.

createDefaultText2dNode

  • Create a 2D text node using the Magic Leap UI font (regular weight).

    priv

    none

    Parameters

    • desc: Text2dDesc

      Information about the Text2dNode to create.

    • Optional style: FontStyle

      default = resources.FontStyle.kNormal
      Either normal or italic style are supported.

    Returns Text2dNode | null

    The new Text2dNode.

createFont2dResourceId

  • createFont2dResourceId(fontDesc: Font2dDesc, fontFile: string, a_absolutePath?: boolean): bigint
  • Create a Font2dResource with the given description.

    priv

    none

    Parameters

    • fontDesc: Font2dDesc

      Initialization parameters for the resource. For reasonable default values, use the DEFAULT static member.

    • fontFile: string

      The font file from which to load the glyphs. By default assumed to be a relative path from the executable file.

    • Optional a_absolutePath: boolean

      default = false
      Flag that fontFile is an absolute path name, instead of a relative path.

    Returns bigint

    The new Font2dResource.

createImage2d

  • createImage2d(format: Format, width: number, height: number): Image2d | null
  • Create a Image-2D data.

    Parameters

    • format: Format

      The format of the pixel data.

    • width: number

      The width of the image(in pixels).

    • height: number

      The height of the image(in pixels).

    Returns Image2d | null

    Return a valid Image-2D that should be used to create Texture Resource, null otherwise.

createImage3d

  • createImage3d(format: Format, width: number, height: number, depth: number): Image3d | null
  • Create a Image-3D data.

    Parameters

    • format: Format

      The format of the pixel data.

    • width: number

      The width of the image(in pixels).

    • height: number

      The height of the image(in pixels).

    • depth: number

      The depth of the image(in pixels).

    Returns Image3d | null

    Return a valid Image-3D that should be used to create Texture-3D Resource, null otherwise.

createInstancedModelResourceId

  • createInstancedModelResourceId(a_fileName: string | null, a_maxInstances: number, a_absolutePath?: boolean, a_descriptor?: number, a_basePath?: string | null): bigint
  • Creates instanced model resource

    priv

    none

    Parameters

    • a_fileName: string | null

      File name of the resource to load. By default assumed to be a relative path from the executable file.

    • a_maxInstances: number

      MaximumInstances the resource can have

    • Optional a_absolutePath: boolean

      default = false
      Flag that a_fileName is an absolute path name, instead of a relative path.

    • Optional a_descriptor: number

      default = -1
      - optional file descriptor that points to a resource. If passed to the resource the resource takes ownership of the File Descriptor.

    • Optional a_basePath: string | null

      default = null
      - If you are loading a resource from an absolute path, and that path != The current process path, set this field to the equivalent base path in the other client directory. This allows path relative dependencies to solve a fully qualified (absolute) path outside of the current process. This value defaults to the currently executing process root.

      NOTE: In case a Standard resource is already created. And a new resource is created with the same filename but instanced, it will not overwrite the standard resource. In that case, you will have to delete that resource, and post that, create a new instanced resource. This is not required if you want to use an instanced resource as a standard resource.

    Returns bigint

    ID for the Resource

createLightNode

createLineNode

createLoadedFileAudioResourceId

  • createLoadedFileAudioResourceId(a_fileName: string | null, a_absolutePath?: boolean, a_descriptor?: number, a_basePath?: string | null): bigint
  • Creates audio resource by loading the entire audio file in the memory. Use this method for audio files which are not too big to hog memory. For big files you may use the createStreamedFileAudioResource method.

    Parameters

    • a_fileName: string | null

      File name of the resource to load. By default assumed to be a relative path from the executable file.

    • Optional a_absolutePath: boolean

      default = false
      Flag that a_fileName is an absolute path name, instead of a relative path.

    • Optional a_descriptor: number

      default = -1
      - optional file descriptor that points to a resource. If passed to the resource the resource takes ownership of the File Descriptor.

    • Optional a_basePath: string | null

      default = null
      - If you are loading a resource from an absolute path, and that path != The current process path, set this field to the equivalent base path in the other client directory. This allows path relative dependencies to solve a fully qualified (absolute) path outside of the current process. This value defaults to the currently executing process root.

    Returns bigint

    Resource ID

createMaterialResourceId

  • createMaterialResourceId(a_fileName: string | null, a_localScopeOnly?: boolean, a_absolutePath?: boolean, a_descriptor?: number, a_basePath?: string | null): bigint
  • Creates a MaterialResource

    Parameters

    • a_fileName: string | null

      File name of the resource to load. By default assumed to be a relative path from the executable file.

    • Optional a_localScopeOnly: boolean

      default = false
      The scope of this material. When set to true the kmat's contained in the material will not be added to the prism's list of materials for general resolve.

    • Optional a_absolutePath: boolean

      default = false
      Flag that a_fFileName is an absolute path name, instead of a relative path.

    • Optional a_descriptor: number

      default = -1
      - optional file descriptor that points to a resource. If passed to the resource the resource takes ownership of the File Descriptor.

    • Optional a_basePath: string | null

      default = null
      - If you are loading a resource from an absolute path, and that path != The current process path, set this field to the equivalent base path in the other client directory. This allows path relative dependencies to solve a fully qualified (absolute) path outside of the current process. This value defaults to the currently executing process root.

    Returns bigint

    resource instance

createModelAttachmentNode

  • Create a new ModelAttachmentNode.

    Parameters

    • modelNode: ModelNode | null

      the ModelNode to which the bone is attached

    • boneName: string

      the name of the bone

    Returns ModelAttachmentNode | null

    New ModelAttachmentNode on success; nullptr on failure.

createModelNode

  • createModelNode(resourceId: bigint): ModelNode | null
  • Create a new ModelNode.

    priv

    none

    Parameters

    • resourceId: bigint

      optional resource Id to use for the node.

    Returns ModelNode | null

    New ModelNode on success; nullptr on failure.

createModelResourceId

  • createModelResourceId(a_fileName: string | null, a_importScale: number, a_absolutePath?: boolean, a_descriptor?: number, a_basePath?: string | null, a_materialScopeId?: bigint, a_forceMaterialScope?: boolean): bigint
  • Creates a ModelResource

    Parameters

    • a_fileName: string | null

      File name of the resource to load. By default assumed to be a relative path from the executable file.

    • a_importScale: number

      The scale that will be applied to this resource

    • Optional a_absolutePath: boolean

      default = false
      Flag that a_fileName is an absolute path name, instead of a relative path.

    • Optional a_descriptor: number

      default = -1
      - optional file descriptor that points to a resource. If passed to the resource the resource takes ownership of the File Descriptor.

    • Optional a_basePath: string | null

      default = null
      - If you are loading a resource from an absolute path, and that path != The current process path, set this field to the equivalent base path in the other client directory. This allows path relative dependencies to solve a fully qualified (absolute) path outside of the current process. This value defaults to the currently executing process root.

    • Optional a_materialScopeId: bigint

      default = INVALID_RESOURCE_ID
      Optional MaterialResouce. When set the new ModelResoure will only use KMATs that are available in this MaterialResources scope. When not set, ModelResource will resolve KMAT's from the Prism's scope. See a_forceMaterialScope.

    • Optional a_forceMaterialScope: boolean

      default = false
      When optionally set the new ModelResource will only attempt to resolve KMAT's from embedded materials, or when a_materialScopeId also from that MaterialResource.

    Returns bigint

    ID for the Resource

createNode

  • createNode(): Node | null
  • createNode(objectModelName: string, objectName?: string): Node | null
  • Creates a node of the base type, suitable for organizing a group of child nodes.

    Returns Node | null

  • Create a node from a loaded object model.

    priv

    none

    Parameters

    • objectModelName: string

      The name of the object model.

    • Optional objectName: string

      default = ""
      The name of an object in the object model. If empty, the first object in the object model is used.

    Returns Node | null

    Newly created node or nullptr if creation failed.

createObjMtlResourceId

  • createObjMtlResourceId(a_fileName: string | null, a_absolutePath?: boolean): bigint
  • Creates mtl resource

    Parameters

    • a_fileName: string | null

      File name of the resource to load. By default assumed to be a relative path from the executable file.

    • Optional a_absolutePath: boolean

      default = false
      Flag that a_fileName is an absolute path name, instead of a relative path.

    Returns bigint

    ID for the Resource

createParticleNode

  • createParticleNode(packageResource: bigint): ParticleNode | null
  • Create a new ParticleNode.

    Parameters

    • packageResource: bigint

      resource Id of the particle effect package to use.

    Returns ParticleNode | null

    New ParticleNode on success; nullptr on failure.

createParticlePackageResourceId

  • createParticlePackageResourceId(a_fileName: string | null, a_absolutePath?: boolean): bigint
  • Creates particle package resource

    Parameters

    • a_fileName: string | null

      File name of the resource to load. By default assumed to be a relative path from the executable file.

    • Optional a_absolutePath: boolean

      default = false
      Flag that a_fileName is an absolute path name, instead of a relative path.

    Returns bigint

    ID for the Resource

createPlanarEGLResourceId

  • createPlanarEGLResourceId(a_width?: number, a_height?: number): bigint
  • Creates a PlanarResource of given size which provides access to EGL Context and EGL Surface.

    priv

    none

    Parameters

    • Optional a_width: number

      default = 512
      - The Width 1 to 2048

    • Optional a_height: number

      default = 512
      - The Height 1 to 2048

    Returns bigint

    The new PlanarResource

createQuad3dNode

  • createQuad3dNode(resourceId: bigint): Quad3dNode | null
  • Create a new Quad3dNode with a Texture3dResource id.

    It works only with Texture3dResource. The call would return nullptr, for any other resource types.

    priv

    none

    Parameters

    • resourceId: bigint

      resource Id to use for the node.

    Returns Quad3dNode | null

    New Quad3dNode on success; nullptr on failure.

createQuadNode

  • createQuadNode(resourceId: bigint): QuadNode | null
  • Create a new QuadNode.

    priv

    none

    Parameters

    • resourceId: bigint

      optional resource Id to use for the node.

    Returns QuadNode | null

    New QuadNode on success; nullptr on failure.

createSpriteNode

  • createSpriteNode(resourceId: bigint): SpriteNode | null
  • Create a new SpriteNode from a texture pack resource.

    priv

    none

    Parameters

    • resourceId: bigint

      id of the resource that contains the frames for the sprite.

    Returns SpriteNode | null

    New SpriteNode on success; nullptr on failure.

createStreamedFileAudioResourceId

  • createStreamedFileAudioResourceId(a_fileName: string | null, a_absolutePath?: boolean, a_descriptor?: number, a_basePath?: string | null): bigint
  • Create audio resource with streamed file. Use this resource for big audio files where the audio file is loaded only chunk at a time in then memory. Normally audio resource will be fully loaded in memory, in which case use createLoadedFileAudioResource() method.

    Uses same params as createLoadedFileAudioResource method.

    Parameters

    • a_fileName: string | null
    • Optional a_absolutePath: boolean
    • Optional a_descriptor: number
    • Optional a_basePath: string | null

    Returns bigint

    Resource ID

createText2dNode

  • Create a 2D text node with the given font and properties encapsulated in the description object.

    priv

    none

    Parameters

    • fontResourceId: bigint

      Id of a FontResource to use.

    • desc: Text2dDesc

      Information about the Text2dNode to create.

    Returns Text2dNode | null

    The new Text2dNode.

createTexture3dResourceId

  • createTexture3dResourceId(image: Image3d | null, desc?: Desc3d): bigint
  • Create a Texture-3D resource with the decoded image data.

    Parameters

    • image: Image3d | null

      Decoded Image data to be used for rendering.

    • Optional desc: Desc3d

      default = Desc3d.DEFAULT
      Optional Initialization parameters for the resource to control rendering.

    Returns bigint

    The new Texture-3D resource id.

createTexturePackResourceId

  • createTexturePackResourceId(a_vMetaDataNames: Array<string>, a_params: Params, absolutePath?: boolean): bigint
  • createTexturePackResourceId(directory: string, params: Params, absolutePath?: boolean): bigint
  • createTexturePackResourceId(desc: Descriptor, absolutePath?: boolean): bigint
  • Create and initialize a TexturePackResource.

    priv

    none

    Parameters

    • a_vMetaDataNames: Array<string>

      a list of json files that define the TexturePack.

    • a_params: Params

      control how the textures are rendered;

    • Optional absolutePath: boolean

      default = false
      flag that the location is an absolute path instead of a relative path.

    Returns bigint

    The new TexturePackResource.

  • Create and initialize a TexturePackResource.

    priv

    none

    Parameters

    • directory: string

      file-system directory where the data to initialize the resource is located.

    • params: Params

      control how the textures are rendered; see PackedTextureParams::DEFAULT.

    • Optional absolutePath: boolean

      default = false
      flag that the location is an absolute path instead of a relative path.

    Returns bigint

    The new TexturePackResource.

  • Create and initialize a TexturePackResource.

    priv

    none

    Parameters

    • desc: Descriptor

      user-created descriptor object, which includes the location of the data.

    • Optional absolutePath: boolean

      default = false
      flag that the location is an absolute path instead of a relative path.

    Returns bigint

    The new TexturePackResource.

createTextureResourceId

  • createTextureResourceId(tex2dDesc: Desc2d, imageFile: string, a_absolutePath?: boolean, a_fileDescriptor?: number): bigint
  • createTextureResourceId(tex2dDesc: Desc2d, image: Image2d | null): bigint
  • Create a TextureResource with the given description from the PNG image file.

    priv

    none

    Parameters

    • tex2dDesc: Desc2d

      Initialization parameters for the resource. For reasonable default values, use the DEFAULT static member.

    • imageFile: string

      PNG or JPEG-encoded image file. By default assumed to be a relative path from the executable file.

    • Optional a_absolutePath: boolean

      default = false
      Flag that pngFile is an absolute path name, instead of a relative path.

    • Optional a_fileDescriptor: number

      default = -1
      - optional file descriptor that points to a png resource. If passed to the resource the resource takes ownership of the File Descriptor.

    Returns bigint

    The new TextureResource.

  • Create a Texture-2D resource with the decoded image data.

    Parameters

    • tex2dDesc: Desc2d

      Initialization parameters for the resource. For reasonable default values, use the DEFAULT static member.

    • image: Image2d | null

      Decoded Image data to be used for rendering.

    Returns bigint

    The new TextureResource Id when succeeded, INVALID_RESOURCE_ID otherwise.

createTransformNode

  • createTransformNode(localTransform: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number] | Float32Array): TransformNode | null
  • Create a new TransformNode.

    priv

    none

    Parameters

    • localTransform: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number] | Float32Array

      The local transform of the new node; use glm::mat4() for the identity matrix.

    Returns TransformNode | null

    New TransformNode on success; nullptr on failure.

createTree

  • createTree(objectModelName: string, objectName?: string): Node | null
  • Create a node tree from a loaded object model.

    priv

    none

    Parameters

    • objectModelName: string

      The name of the object model.

    • Optional objectName: string

      default = ""
      The name of an object in the object model. A node tree will be created using this node and its descendants. If empty, the first object in the object model is used.

    Returns Node | null

    Root node of a newly created node tree or nullptr if creation failed.

createVideoNode

  • createVideoNode(a_width?: number, a_height?: number): VideoNode | null
  • Creates a VideoNode with the given resolution and display mode.

    priv

    none

    Parameters

    • Optional a_width: number

      default = 512
      - The surface initial resolution width 1 to 2048 (will be overwritten by video resolution)

    • Optional a_height: number

      default = 512
      - The surface initial resolution height 1 to 2048 (will be overwritten by video resolution)

    Returns VideoNode | null

    The new VideoNode

createVolumeCubeNode

  • Creates a VolumeCubeNode with a Texture3dResource id.

    It works only with Texture3dResource. The call would return nullptr, for any other resource types.

    priv

    none

    Parameters

    • resourceId: bigint

      resource Id to use for the node.

    Returns VolumeCubeNode | null

    The new VolumeCubeNode on success; nullptr on failure.

deleteNode

  • deleteNode(a_pNode: Node | null): void
  • Tells the Prism to delete this Node and all its children

    priv

    none

    Parameters

    • a_pNode: Node | null

      The Node that will be deleted

    Returns void

destroyResource

  • destroyResource(a_iID: bigint): void
  • Destroys a Resource with a given ResourceIDType. Paired with createResource(). For each create() there should be a destroy().

    priv

    none

    Parameters

    • a_iID: bigint

      ID of the resource

    Returns void

enableVisualState

  • enableVisualState(value: boolean): void
  • Enable/Disable the Prism Visual state changes

    priv

    none

    Parameters

    • value: boolean

      Enable/Disable the state changing

    Returns void

findNode

  • findNode(a_name: string, a_parent: Node | null): Node | null
  • Find a Node by name.

    priv

    none

    Parameters

    • a_name: string

      The Node name to look for

    • a_parent: Node | null

      The node which to look for a decendant node of.

    Returns Node | null

getHandGestureHoverDistance

  • getHandGestureHoverDistance(): number
  • priv

    none

    Returns number

    the distance threshold the hand gesture cursor must be at for a node register as hovered

getHandGestureTouchDistance

  • getHandGestureTouchDistance(): number
  • priv

    none

    Returns number

    the distance threshold the hand gesture cursor must be at for a node register as touched

getNode

  • getNode(a_id: bigint): Node | null
  • Get a Node by its Id

    priv

    none

    Parameters

    • a_id: bigint

      The Node id to look for

    Returns Node | null

    the Node

getPosition

  • getPosition(): [number, number, number]
  • Get the position of this prism in world space

    Returns [number, number, number]

    Prism position

getPrismController

  • Returns the current root scene controller.

    priv

    none

    Returns PrismController | null

    The current root scene controller or nullptr if there is none.

getPrismId

  • getPrismId(): bigint

getPrismType

getResource

  • getResource(a_iID: bigint): Resource | null
  • getResource(name: string): bigint
  • Get the resource with the given ID. Should only be called on the render thread for resources related to rendering.

    priv

    none

    Parameters

    • a_iID: bigint

      the unique ID of the resource to find.

    Returns Resource | null

    pointer to the resource or else nullptr if not found.

  • Acquire loaded resource mapped to the given name in the declarative system.

    priv

    none

    Parameters

    • name: string

      The name of the resource.

    Returns bigint

    ID of named resource or INVALID_RESOURCE_ID if no resource is loaded with that name.

getRootNode

  • Get the root node of the scene graph. The node version will be the last seen version.

    priv

    none

    Returns RootNode | null

    the root node

getRotation

  • getRotation(): [number, number, number, number]
  • Get the rotation of this prism in world space

    Returns [number, number, number, number]

    Prism rotation

getScale

  • getScale(): [number, number, number]
  • Get the scale of this prism

    Returns [number, number, number]

    Prism scale

getSize

  • getSize(): [number, number, number]
  • Get the Bounding size

    priv

    none

    Returns [number, number, number]

    Size (width,height,depth)

getSound

  • getSound(name: string): Sound | null
  • Acquire loaded sound mapped to the given name in the declarative system.

    priv

    none

    Parameters

    • name: string

      The name of the sound.

    Returns Sound | null

    Pointer to named sound or nullptr if no sound is loaded with that name.

getTransform

  • getTransform(): [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]
  • Get the Real World Transform of this prism

    Returns [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]

    Prism transform matrix

getUserAutoHapticGesture

  • getUserAutoHapticGesture(): number
  • Gives the current set of Auto Haptic Gestures for this prism required by User

    priv

    none

    Returns number

    • Active DeviceGestureFlags

getUserHandGesture

  • getUserHandGesture(): number
  • Gives the current set of Hand Gesture for this prism required by User

    priv

    none

    Returns number

    • Active HandGesture Flags

hasPropertyOnPcf

  • hasPropertyOnPcf(a_name: string): boolean
  • Tests if a user defined property exists on the Prism's Pcf data. A property is a generic key-value pair.

    Parameters

    • a_name: string

      The property name.

    Returns boolean

    true on if the property exists, otherwise false.

isPrismSelected

  • isPrismSelected(): boolean
  • Get whether this Prism is selected.

    priv

    none

    Returns boolean

    the selected state of the prism.

loadObjectModel

  • loadObjectModel(filePath: string): string | null
  • Load an object model into memory.

    priv

    none

    Parameters

    • filePath: string

      Path to object model file.

    Returns string | null

    If successful this string will be populated with the object model's name.

loadResourceModel

  • loadResourceModel(filePath: string): boolean
  • Load a resource model into memory, and create its defined resources.

    priv

    none

    Parameters

    • filePath: string

      Path to resource model file.

    Returns boolean

    True if the resource model was successfully loaded.

loadSoundModel

  • loadSoundModel(filePath: string): boolean
  • Load a sound model into memory, and create its defined sounds.

    priv

    none

    Parameters

    • filePath: string

      Path to sound model file.

    Returns boolean

    True if the sound model was successfully loaded.

objectModelLoaded

  • objectModelLoaded(name: string): boolean
  • Determine whether or not an object model is loaded.

    priv

    none

    Parameters

    • name: string

      The name of the object model.

    Returns boolean

    True if a object model with the given name is loaded.

onDestroyEventSub

  • onDestroyEventSub(callback: ((arg0: Prism | null) => void) | null): CallbackID
  • Returns an Event that will be triggered right before this prism is destroyed.

    This event will be dispatched after PrismController::onDetachPrism is called (if there is a PrismController attached to the prism).

    priv

    none

    Parameters

    • callback: ((arg0: Prism | null) => void) | null

    Returns CallbackID

onDestroyEventUnsub

  • onDestroyEventUnsub(callbackID: CallbackID): boolean

parseObjectModel

  • parseObjectModel(modelString: string): string | null
  • Load an object model from a string into memory.

    priv

    none

    Parameters

    • modelString: string

      Object model data as a string.

    Returns string | null

    If successful this string will be populated with the object model's name.

readBoolPropertyFromPcf

  • readBoolPropertyFromPcf(a_name: string): boolean | null
  • Reads a user defined property from within the Prism's Pcf data. A property is a generic key-value pair.

    Parameters

    • a_name: string

      The property name.

    Returns boolean | null

    The property value.

readNumberPropertyFromPcf

  • readNumberPropertyFromPcf(a_name: string): number | null

readQuatPropertyFromPcf

  • readQuatPropertyFromPcf(a_name: string): [number, number, number, number] | null
  • Parameters

    • a_name: string

    Returns [number, number, number, number] | null

readStringPropertyFromPcf

  • readStringPropertyFromPcf(a_name: string): string | null

readVec2PropertyFromPcf

  • readVec2PropertyFromPcf(a_name: string): [number, number] | null

readVec3PropertyFromPcf

  • readVec3PropertyFromPcf(a_name: string): [number, number, number] | null

readVec4PropertyFromPcf

  • readVec4PropertyFromPcf(a_name: string): [number, number, number, number] | null
  • Parameters

    • a_name: string

    Returns [number, number, number, number] | null

retainEyeTrackingUpdates

  • Retain this shared pointer to force the prism to receive eye tracking updates.

    NOTE: Must be called on client main thread.

    priv

    none

    Returns PrismDataHandle | null

retainFPSMode

  • retainFPSMode(): KEmpty | null

retainFloorUpdates

  • Retain this shared pointer to force the volume to receive floor updates.

    NOTE: Must be called on client main thread.

    priv

    none

    Returns PrismDataHandle | null

retainHeadposeUpdates

  • Retain this shared pointer to force the prism to receive headpose updates.

    NOTE: Must be called on client main thread.

    priv

    none

    Returns PrismDataHandle | null

savePropertyWithPcf

  • savePropertyWithPcf(a_name: string, a_value: boolean): number
  • savePropertyWithPcf(a_name: string, a_value: number): number
  • savePropertyWithPcf(a_name: string, a_value: string): number
  • savePropertyWithPcf(a_name: string, a_value: [number, number] | Float32Array): number
  • savePropertyWithPcf(a_name: string, a_value: [number, number, number] | Float32Array): number
  • savePropertyWithPcf(a_name: string, a_value: [number, number, number, number] | Float32Array): number
  • savePropertyWithPcf(a_name: string, a_value: [number, number, number, number] | Float32Array): number
  • Save a user defined property within the Prism's Pcf data. A property is a generic key-value pair.

    Parameters

    • a_name: string

      The property name.

    • a_value: boolean

      The property value.

    Returns number

    utils::OK on success, otherwise an error code is returned.

  • Parameters

    • a_name: string
    • a_value: number

    Returns number

  • Parameters

    • a_name: string
    • a_value: string

    Returns number

  • Parameters

    • a_name: string
    • a_value: [number, number] | Float32Array

    Returns number

  • Parameters

    • a_name: string
    • a_value: [number, number, number] | Float32Array

    Returns number

  • Parameters

    • a_name: string
    • a_value: [number, number, number, number] | Float32Array

    Returns number

  • Parameters

    • a_name: string
    • a_value: [number, number, number, number] | Float32Array

    Returns number

setExcludeFromAutoFocus

  • setExcludeFromAutoFocus(exclude: boolean): void
  • If true, this prism will be excluded from the server's auto focus calculation

    priv

    none

    Parameters

    • exclude: boolean

    Returns void

setHandGestureFilterConfidenceLevel

  • setHandGestureFilterConfidenceLevel(confidenceLevel: number): void
  • Set the input service hand gesture confidence level filter

    priv

    none

    Parameters

    • confidenceLevel: number

      the confidence level filter (between 0.0f and 1.0f, default is 0.0f)

    Returns void

setHandGestureFilterPollRate

  • setHandGestureFilterPollRate(pollRate: number): void
  • Set the input service hand gesture poll rate

    priv

    none

    Parameters

    • pollRate: number

      the poll rate (in Hz, default is 20.0f)

    Returns void

setHandGestureFilterPositionDelta

  • setHandGestureFilterPositionDelta(positionDelta: number): void
  • Set the input service hand gesture position delta filter

    priv

    none

    Parameters

    • positionDelta: number

      the position delta (in world space meters, default is 0.03f)

    Returns void

setHandGestureHoverDistance

  • setHandGestureHoverDistance(distance: number): void
  • Set how close the hand gesture cursor must be to a node for a hover to register

    priv

    none

    Parameters

    • distance: number

      The hover distance threshold

    Returns void

setHandGestureTouchDistance

  • setHandGestureTouchDistance(distance: number): void
  • Set how close the hand gesture cursor must be to a node for a touch to register

    priv

    none

    Parameters

    • distance: number

      The touch distance threshold

    Returns void

setPhysicsEnabled

  • Enables/disables physics simulation on the prism. Until physics is enabled, no simulation will be run on the prism, even if Nodes in the prism have physics data associated with them. Once enabled, a physics system will be attached to the prism, in paused mode. setPhysicsPaused(false) should then be called to start the simulation.

    This function MUST be called before any other physics function.

    If this function is called with a_enable = false, the physics system for the prism will be shut down and removed from the prism; the current state of the simulation will not be preserved.

    This is an expensive function, ideally it should only ever called once during the initialization of a program.

    Parameters

    • a_enable: boolean

      Flag to enable/disable the simulation.

    • Optional a_data: PhysicsInitializationData | null

      default = null
      Optional data used to initialize the simulation. Ignored if a_enable = false.

    Returns void

setPhysicsPaused

  • setPhysicsPaused(a_pause: boolean): void
  • Pauses/resumes the physics simulation on the prism. setPhysicsEnabled(true) must have been called for this to have an effect.

    Note that setPhysicsEnabled starts the physics simulation in paused mode.

    Parameters

    • a_pause: boolean

      Flag to pause/resume the physics simulation

    Returns void

setPhysicsWorldMeshEnabled

  • setPhysicsWorldMeshEnabled(a_enable: boolean): void
  • setPhysicsWorldMeshEnabled(a_enable: boolean, a_material: PhysicsMaterial): void
  • Enables/disables physics interaction with the world mesh. When enabled, physics bodies will collide against the world mesh generated by the headset. By default, world mesh interaction is disabled, and must be explicitly enabled to work. Like other physics functions, physics must be enabled via setPhysicsEnabled(true) before this function can be called.

    Although the world mesh will be added to the prism as static bodies, the body shape data will be replaced by new mesh data as it comes in. This means that dynamic bodies can be "pushed" by the world mesh. However, as the world mesh updates slowly, do not expect this to be able to handle real-time changes of the world mesh.

    IMPORTANT: As turning the world mesh into data that the physics system can understand is expensive, this is done on a background thread. This means the world mesh will not become available collisions instantly. It is highly recommended that this function be called a few seconds before adding other physics bodies to the prism in order to facilitate accurate collisions.

    IMPORTANT: Currently the physics system cannot handle changing the prism transform while world mesh collisions are enabled. If the prism needs to be changed, disable world mesh collisions, move the prism, and reenable collisions.

    Parameters

    • a_enable: boolean

      Flag to enable/disable world mesh physics.

    Returns void

  • Enables/disables physics interaction with the world mesh. When enabled, physics bodies will collide against the world mesh generated by the headset. By default, world mesh interaction is disabled, and must be explicitly enabled to work. Like other physics functions, physics must be enabled via setPhysicsEnabled(true) before this function can be called.

    Although the world mesh will be added to the prism as static bodies, the body shape data will be replaced by new mesh data as it comes in. This means that dynamic bodies can be "pushed" by the world mesh. However, as the world mesh updates slowly, do not expect this to be able to handle real-time changes of the world mesh.

    IMPORTANT: As turning the world mesh into data that the physics system can understand is expensive, this is done on a background thread. This means the world mesh will not become available collisions instantly. It is highly recommended that this function be called a few seconds before adding other physics bodies to the prism in order to facilitate accurate collisions.

    IMPORTANT: Currently the physics system cannot handle changing the prism transform while world mesh collisions are enabled. If the prism needs to be changed, disable world mesh collisions, move the prism, and reenable collisions.

    Parameters

    • a_enable: boolean

      Flag to enable/disable world mesh physics.

    • a_material: PhysicsMaterial

      Physics material that will be assigned to the world mesh.

    Returns void

setPrismBloomStrength

  • setPrismBloomStrength(a_prismBloomStrength: number): void
  • Set the Bloom Strength for this prism. Default is set to 1.0

    Parameters

    • a_prismBloomStrength: number

      Bloom strength that will be applied to all the RenderNodes of the prism

    Returns void

setPrismController

  • Sets the root prism controller that will receive event and update loop callbacks for this prism.

    The root prism controller's scene graph will be attached to the prism root node.

    priv

    none

    Parameters

    • rootPrismController: PrismController | null

      The prism controller to use or nullptr to just remove the current root prism controller

    Returns void

setVolumeBloomStrength

  • setVolumeBloomStrength(a_volumeBloomStrength: number): void
  • deprecated, please use setPrismBloomStrength instead

    Parameters

    • a_volumeBloomStrength: number

    Returns void

startTrackHandGesture

  • startTrackHandGesture(a_uieHandGesture: number): void
  • Tracks a set of Hand gesture directed at this prism

    when Gesture occurs it is deliverd on the eventCallback

    priv

    none

    Parameters

    • a_uieHandGesture: number

      The HandGestureFlags to start Tracking

    Returns void

startTrackingAutoHapticOnGesture

  • startTrackingAutoHapticOnGesture(a_uieGesture: number): void
  • Tracks a set of gestures we wish to enable auto haptics on

    priv

    none

    Parameters

    • a_uieGesture: number

      The DeviceGestureFlags to start Tracking

    Returns void

stopTrackHandGesture

  • stopTrackHandGesture(a_uieHandGesture: number): void
  • Stops Tracking a set of Hand Gesture

    priv

    none

    Parameters

    • a_uieHandGesture: number

      The HandGestureFlags to stop Tracking

    Returns void

stopTrackingAutoHapticOnGesture

  • stopTrackingAutoHapticOnGesture(a_uieGesture: number): void
  • Stops tracking a set of gestures for auto haptics

    priv

    none

    Parameters

    • a_uieGesture: number

      The DeviceGestureFlags to stop Tracking

    Returns void

unloadObjectModel

  • unloadObjectModel(name: string): boolean
  • Unload cached object model.

    priv

    none

    Parameters

    • name: string

      The name of the object model.

    Returns boolean

    True if an object model with the given name was found and unloaded.

unloadResourceModels

  • unloadResourceModels(): void
  • Unload all resource models. Current behaviour is to clear all name to resource mappings, but will not destroy resources.

    priv

    none

    Returns void

unloadSoundModels

  • unloadSoundModels(): void
  • Unload all sound models. Current behaviour is to clear all sound mappings and destroy sound instances.

    priv

    none

    Returns void

updateNode

  • updateNode(node: Node | null, objectModelName: string, objectName?: string): boolean
  • Update a node with property values from an object in an object model.

    priv

    none

    Parameters

    • node: Node | null

      The node to be updated.

    • objectModelName: string

      The name of a loaded object model.

    • Optional objectName: string

      default = ""
      The name of an object in the object model. If empty, the first object in the object model is used.

    Returns boolean

    True if the object model is loaded, the object was found in the object model and all object properties were successfully updated to the node.

updateNodeFromString

  • updateNodeFromString(node: Node | null, modelString: string, objectName: string): boolean
  • Update a node with property values from an object in an object model as a string.

    priv

    none

    Parameters

    • node: Node | null

      The node to be updated.

    • modelString: string

      The object model as a string.

    • objectName: string

      The name of an object in the object model. If empty, the first object in the object model is used.

    Returns boolean

    True if the object was found in the object model and all object properties were successfully updated to the node.

Generated using TypeDoc