Create all objects from a loaded object model and return them as children of newly created root Node.
The name of the object model.
Root node containing all objects from model or nullptr if creation failed
Creates animation blend setup resource
File name of the resource to load. By default assumed to be a relative path from the executable file.
default = false
Flag that a_fileName is an absolute path name, instead of a relative path.
default = -1
- optional file descriptor that points to a resource.
If passed to the resource the resource takes ownership of the File Descriptor.
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.
ID for the Resource
Creates animation resource
File name of the resource to load. By default assumed to be a relative path from the executable file.
default = false
Flag that a_fileName is an absolute path name, instead of a relative path.
default = -1
- optional file descriptor that points to a resource.
If passed to the resource the resource takes ownership of the File Descriptor.
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.
ID for the Resource
Creates animation set resource
File name of the resource to load. By default assumed to be a relative path from the executable file.
default = false
Flag that a_fileName is an absolute path name, instead of a relative path.
default = -1
- optional file descriptor that points to a resource.
If passed to the resource the resource takes ownership of the File Descriptor.
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.
ID for the Resource
Create a new AudioNode. After calling this createAudioNode(), must call one of the AudioNode::createSoundXxxxX() methods to create a specific type of audio node.
New AudioNode on success; nullptr on failure.
Create a 2D text node using the Magic Leap UI font (regular weight).
Information about the Text2dNode to create.
default = resources.FontStyle.kNormal
Either normal or italic style are supported.
The new Text2dNode.
Create a Font2dResource with the given description.
Initialization parameters for the resource. For reasonable default values, use the DEFAULT static member.
The font file from which to load the glyphs. By default assumed to be a relative path from the executable file.
default = false
Flag that fontFile is an absolute path name, instead of a relative path.
The new Font2dResource.
Create a Image-3D data.
The format of the pixel data.
The width of the image(in pixels).
The height of the image(in pixels).
The depth of the image(in pixels).
Return a valid Image-3D that should be used to create Texture-3D Resource, null otherwise.
Creates instanced model resource
File name of the resource to load. By default assumed to be a relative path from the executable file.
MaximumInstances the resource can have
default = false
Flag that a_fileName is an absolute path name, instead of a relative path.
default = -1
- optional file descriptor that points to a resource.
If passed to the resource the resource takes ownership of the File Descriptor.
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.
ID for the Resource
Creates directional light node
The new LightNode
Create a new LineNode.
New LineNode on success; nullptr on failure.
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.
File name of the resource to load. By default assumed to be a relative path from the executable file.
default = false
Flag that a_fileName is an absolute path name, instead of a relative path.
default = -1
- optional file descriptor that points to a resource.
If passed to the resource the resource takes ownership of the File Descriptor.
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.
Resource ID
Creates a MaterialResource
File name of the resource to load. By default assumed to be a relative path from the executable file.
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.
default = false
Flag that a_fFileName is an absolute path name, instead of a relative path.
default = -1
- optional file descriptor that points to a resource.
If passed to the resource the resource takes ownership of the File Descriptor.
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.
resource instance
Create a new ModelAttachmentNode.
the ModelNode to which the bone is attached
the name of the bone
New ModelAttachmentNode on success; nullptr on failure.
Create a new ModelNode.
optional resource Id to use for the node.
New ModelNode on success; nullptr on failure.
Creates a ModelResource
File name of the resource to load. By default assumed to be a relative path from the executable file.
The scale that will be applied to this resource
default = false
Flag that a_fileName is an absolute path name, instead of a relative path.
default = -1
- optional file descriptor that points to a resource.
If passed to the resource the resource takes ownership of the File Descriptor.
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.
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.
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.
ID for the Resource
Creates a node of the base type, suitable for organizing a group of child nodes.
Create a node from a loaded object model.
The name of the object model.
default = ""
The name of an object in the object model. If empty, the first object in the object model is used.
Newly created node or nullptr if creation failed.
Creates mtl resource
File name of the resource to load. By default assumed to be a relative path from the executable file.
default = false
Flag that a_fileName is an absolute path name, instead of a relative path.
ID for the Resource
Create a new ParticleNode.
resource Id of the particle effect package to use.
New ParticleNode on success; nullptr on failure.
Creates particle package resource
File name of the resource to load. By default assumed to be a relative path from the executable file.
default = false
Flag that a_fileName is an absolute path name, instead of a relative path.
ID for the Resource
Creates a PlanarResource of given size which provides access to EGL Context and EGL Surface.
default = 512
- The Width 1 to 2048
default = 512
- The Height 1 to 2048
The new PlanarResource
Create a new Quad3dNode with a Texture3dResource id.
It works only with Texture3dResource. The call would return nullptr, for any other resource types.
resource Id to use for the node.
New Quad3dNode on success; nullptr on failure.
Create a new QuadNode.
optional resource Id to use for the node.
New QuadNode on success; nullptr on failure.
Create a new SpriteNode from a texture pack resource.
id of the resource that contains the frames for the sprite.
New SpriteNode on success; nullptr on failure.
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.
Resource ID
Create a 2D text node with the given font and properties encapsulated in the description object.
Id of a FontResource to use.
Information about the Text2dNode to create.
The new Text2dNode.
Create a Texture-3D resource with the decoded image data.
Decoded Image data to be used for rendering.
default = Desc3d.DEFAULT
Optional Initialization parameters for the resource to control rendering.
The new Texture-3D resource id.
Create and initialize a TexturePackResource.
a list of json files that define the TexturePack.
control how the textures are rendered;
default = false
flag that the location is an absolute path instead of a relative path.
The new TexturePackResource.
Create and initialize a TexturePackResource.
file-system directory where the data to initialize the resource is located.
control how the textures are rendered; see PackedTextureParams::DEFAULT.
default = false
flag that the location is an absolute path instead of a relative path.
The new TexturePackResource.
Create and initialize a TexturePackResource.
user-created descriptor object, which includes the location of the data.
default = false
flag that the location is an absolute path instead of a relative path.
The new TexturePackResource.
Create a TextureResource with the given description from the PNG image file.
Initialization parameters for the resource. For reasonable default values, use the DEFAULT static member.
PNG or JPEG-encoded image file. By default assumed to be a relative path from the executable file.
default = false
Flag that pngFile is an absolute path name, instead of a relative path.
default = -1
- optional file descriptor that points to a png resource.
If passed to the resource the resource takes ownership of the File Descriptor.
The new TextureResource.
Create a Texture-2D resource with the decoded image data.
Initialization parameters for the resource. For reasonable default values, use the DEFAULT static member.
Decoded Image data to be used for rendering.
The new TextureResource Id when succeeded, INVALID_RESOURCE_ID otherwise.
Create a new TransformNode.
The local transform of the new node; use glm::mat4() for the identity matrix.
New TransformNode on success; nullptr on failure.
Create a node tree from a loaded object model.
The name of the object model.
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.
Root node of a newly created node tree or nullptr if creation failed.
Creates a VideoNode with the given resolution and display mode.
default = 512
- The surface initial resolution width 1 to 2048 (will be overwritten by video resolution)
default = 512
- The surface initial resolution height 1 to 2048 (will be overwritten by video resolution)
The new VideoNode
Creates a VolumeCubeNode with a Texture3dResource id.
It works only with Texture3dResource. The call would return nullptr, for any other resource types.
resource Id to use for the node.
The new VolumeCubeNode on success; nullptr on failure.
Tells the Prism to delete this Node and all its children
The Node that will be deleted
Destroys a Resource with a given ResourceIDType. Paired with createResource(). For each create() there should be a destroy().
ID of the resource
Enable/Disable the Prism Visual state changes
Enable/Disable the state changing
the distance threshold the hand gesture cursor must be at for a node register as hovered
the distance threshold the hand gesture cursor must be at for a node register as touched
Get a Node by its Id
The Node id to look for
the Node
Get the position of this prism in world space
Prism position
Returns the current root scene controller.
The current root scene controller or nullptr if there is none.
Get the Prism ID
Prism ID
Returns the Prism type.
The Prism type.
Get the resource with the given ID. Should only be called on the render thread for resources related to rendering.
the unique ID of the resource to find.
pointer to the resource or else nullptr if not found.
Acquire loaded resource mapped to the given name in the declarative system.
The name of the resource.
ID of named resource or INVALID_RESOURCE_ID if no resource is loaded with that name.
Get the root node of the scene graph. The node version will be the last seen version.
the root node
Get the rotation of this prism in world space
Prism rotation
Get the scale of this prism
Prism scale
Get the Bounding size
Size (width,height,depth)
Acquire loaded sound mapped to the given name in the declarative system.
The name of the sound.
Pointer to named sound or nullptr if no sound is loaded with that name.
Get the Real World Transform of this prism
Prism transform matrix
Gives the current set of Auto Haptic Gestures for this prism required by User
Gives the current set of Hand Gesture for this prism required by User
Tests if a user defined property exists on the Prism's Pcf data. A property is a generic key-value pair.
The property name.
true on if the property exists, otherwise false.
Get whether this Prism is selected.
the selected state of the prism.
Load an object model into memory.
Path to object model file.
If successful this string will be populated with the object model's name.
Load a resource model into memory, and create its defined resources.
Path to resource model file.
True if the resource model was successfully loaded.
Load a sound model into memory, and create its defined sounds.
Path to sound model file.
True if the sound model was successfully loaded.
Determine whether or not an object model is loaded.
The name of the object model.
True if a object model with the given name is loaded.
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).
Load an object model from a string into memory.
Object model data as a string.
If successful this string will be populated with the object model's name.
Reads a user defined property from within the Prism's Pcf data. A property is a generic key-value pair.
The property name.
The property value.
Retain this shared pointer to force the prism to receive eye tracking updates.
NOTE: Must be called on client main thread.
Retain this shared pointer to force the prism to enter fps mode
Retain this shared pointer to force the volume to receive floor updates.
NOTE: Must be called on client main thread.
Retain this shared pointer to force the prism to receive headpose updates.
NOTE: Must be called on client main thread.
Save a user defined property within the Prism's Pcf data. A property is a generic key-value pair.
The property name.
The property value.
utils::OK on success, otherwise an error code is returned.
If true, this prism will be excluded from the server's auto focus calculation
Set the input service hand gesture confidence level filter
the confidence level filter (between 0.0f and 1.0f, default is 0.0f)
Set the input service hand gesture poll rate
the poll rate (in Hz, default is 20.0f)
Set the input service hand gesture position delta filter
the position delta (in world space meters, default is 0.03f)
Set how close the hand gesture cursor must be to a node for a hover to register
The hover distance threshold
Set how close the hand gesture cursor must be to a node for a touch to register
The touch distance threshold
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.
Flag to enable/disable the simulation.
default = null
Optional data used to initialize the simulation. Ignored if a_enable = false.
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.
Flag to pause/resume the physics simulation
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.
Flag to enable/disable world mesh physics.
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.
Flag to enable/disable world mesh physics.
Physics material that will be assigned to the world mesh.
Set the Bloom Strength for this prism. Default is set to 1.0
Bloom strength that will be applied to all the RenderNodes of the prism
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.
The prism controller to use or nullptr to just remove the current root prism controller
deprecated, please use setPrismBloomStrength instead
Tracks a set of Hand gesture directed at this prism
when Gesture occurs it is deliverd on the eventCallback
The HandGestureFlags to start Tracking
Tracks a set of gestures we wish to enable auto haptics on
The DeviceGestureFlags to start Tracking
Stops Tracking a set of Hand Gesture
The HandGestureFlags to stop Tracking
Stops tracking a set of gestures for auto haptics
The DeviceGestureFlags to stop Tracking
Unload cached object model.
The name of the object model.
True if an object model with the given name was found and unloaded.
Unload all resource models. Current behaviour is to clear all name to resource mappings, but will not destroy resources.
Unload all sound models. Current behaviour is to clear all sound mappings and destroy sound instances.
Update a node with property values from an object in an object model.
The node to be updated.
The name of a loaded object model.
default = ""
The name of an object in the object model. If empty, the first object in the object model is used.
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.
Update a node with property values from an object in an object model as a string.
The node to be updated.
The object model as a string.
The name of an object in the object model. If empty, the first object in the object model is used.
True if the object was found in the object model and all object properties were successfully updated to the node.
Generated using TypeDoc
Represents the bounded volume within which the Scenegraph renders. Prisms are created via the App::requestNewPrism function.