The Node to add as a child to this Node.
true if successful, false if failed
Adds a client-side callback event to the move list. When the event is reached during the animation playback, the ServerEventCallback function set in Client will be called with an event TransformAnimationEventData.
AudioNode can have multiple AudioResource(s) associated with it. The first resource is associated when AudioNode is initialized by calling createSoundWithLoadefFile or createSoundWithStreamedFile API. This addResource API may be called to add(associate) more resources. However, it must be called after initializing the AudioNode with the above mentioned createSoundWithXxxx APIs.
Note that the same resource type must be used when adding additional resources as the one used in createSoundWithXxxx API Example: AudioNode->createSoundWithLoadedFile( loadedFileResourceID_1 ); // Node initialized with "loaded file" type resource. AudioNode->addResource( loadedFileResourceID_2 ); // OK - adding "loaded file" resource AudioNode->addResource( streamedFileResourceID_3 ); // ERROR - adding "streamed file" resource ... Later, when startSound() API is called, it will play any one randomly picked resource sound.
Some use cases: Example 1: Using just one AudioNode, an alternative to having multiple AudioNodes for different sounds playing from the same position(and orientation) but not at the same time(not overlapped). Just add (associate) multiple resources using this addResource(resID_n) API and call startSound(resID_n) different times with different resource IDs to play. NOTE: Intentionally not adding resource if not already added when startSound(resId_n) is called. This, is to avoid accidentally or easily associating too many resources which, has performance implications.
Example 2: Randomly playing different sound(from set of already added resources) each time startSound() is called. This can be used to repeated sounds with slight variations for realism like, footsteps, breathing, bullets, etc.. In this case, associate slightly varying audio resources with the same AudioNode and call audioNode->statrtSound() with no arguments. It will play one randomly picked resource each time startSound() is called.
Additional AudioResource ID to be associated with this AudioNode. Calling addResource on same resource again is okay. The resource is added(associated) only the first time.
false, if the type of resource is not the same type of resource (LoadedFile
or StreamedFile) as the one when AudioNode was initialized with the resource using
createSoundWithXxxx API.
NOTE: Associating many resources to one AudioNode will result in slight performance penalty. So, only associate multiple resources if necessary(eg. playing random sounds) and do not add resources to AudioNode which will be never used or used only once. If the resource is not going to be used any more, remove the association using removeResource() API.
Adds this node to the specified node layer. Nodes can be members of multiple layers.
Initializes the AudioNode for using the already loaded resource(keyed on resource ID) Associates audio resource id with AudioNode. Also, sets resource related properties.
NOTE: Must be called only once to set the AudioNode's behavior in terms of it's sound resource(s).
ID of the audio resource which is already created.
default = false
- If true, play the sound once and delete the node. If false the audio
node will stay until scenegraph is destroyed.
It is good practice to remove the unused node sooner than later after
it's not required.
default = false
- true = The file resource is compressed and will be decoded when playing.
false = The file\resource is an uncompressed PCM data.
bool - Returns true on success else, returns false.
An overload of createSoundWithLoadedFile with a vector of resource IDs. See the comments for single resource Id overload. This API will associate all the resource IDs in the vector with the AudioNode.
NOTE: Must be called only once to set the AudioNode's behavior in terms of it's sound resource(s).
PERFORMANCE: Associating many resources to one AudioNode will result in slight performance penalty. So, only associate multiple resources if necessary(eg. playing random sounds) and do not add resources to AudioNode which will be never used or used only once. If the resource is not going to be used any more, remove the association using removeResource() API.
Initializes the AudioNode for loading the audio file chunk at a time in memory. Associates audio resource(file) with audio node. Also, sets resource related properties.
resource id of sound resource
default = false
- If true, play the sound once and delete the node. If false the audio node will
stay until scenegraph is destroyed.
It is good practice to remove the unused node sooner than later after it's not
required.
bool - Returns true on success else, returns false.
An overload of createSoundWithStreamedFile with a vector of resource IDs. See the comments for single resource Id overload. This API will associate all the resource IDs in the vector with the AudioNode.
NOTE: Must be called only once to set the AudioNode's behavior in terms of it's sound resource(s).
PERFORMANCE: Associating many resources to one AudioNode will result in slight performance penalty. So, only associate multiple resources if necessary(eg. playing random sounds) and do not add resources to AudioNode which will be never used or used only once. If the resource is not going to be used any more, remove the association using removeResource() API.
Sets the AudioNode for playing the predefined system sounds using the AudioSytemSound enums.
NOTE: Must be called only once to set the AudioNode's behavior in terms of it's sound resource(s).
1) The node can be the child of some visible node to perceive the sounds direction coming from that visual artifact\model's location. -- OR -- 2) The node may be the child of RootNode and set the audioNode->setLocalPosition(x,y,z) to perceive the sounds direction coming from the arbitrary location specified by x,y,z
Call audionode->playSystemSound(SystemSoundEnum sysSound); to play the specified system sound from the location specified by #1 or #2 method.
Creates the AudioNode using the properties set in Sound object. The Sound object reads it's properties from an XML Sound Model file. XML Sound Model which, contains AudioNode's properties are created for various purposes for example, internally, SystemSoundModel.xml is used to define each system sound's properties.
NOTE: Must be called only once to set the AudioNode's behavior in terms of it's sound resource(s).
A Sound object to apply it's properties to this AudioNode.
default = false
Default is false and currently ignored.
Adds a delay to the current move sequence.
How long to delay, in seconds.
default = 0
which animation track to add the delay to.
Find the first named child in the node hierarchy, including this Node.
Does a breadth-first search of the child node hierarchy for the specified named Node and will return the first encountered match, or nullptr if no named Node found.
The name to search for.
Does a breadth-first search of the child node hierarchy for the specified Node type.
The type of Node to find in the child hierarchy.
default = false
Flag to indicate if the child node must be the exact type or can be derived from the type (default false).
default = false
Flag to indicate if the search should include this Node (default false).
A vector of Node pointers containing the results.
Searches up the tree parentage for the specific Node type.
The type of Node to find in the parent hierarchy.
default = false
Flag to indicate if the parent node must be the exact type or can be derived from the type (default false).
The parent node, if found, null if not found.
Get the AABB of this Node's full hierarchy, including all descendants, with all Node transforms applied.
The returned AABB encompasses this Node and all descendant Nodes and is aligned to the coordinate system the Node resides within, i.e. the Node's parent coordinate system. Note, the returned AABB is not guaranteed to be the minimal, tightest fitting AABB to encompass the Node's descendant hierarchy, but it will fully enlose the Node's hierarchy.
The bounding box
Returns the anchor position of the node.
The anchor position.
Gets the n'th child from this Node's children
The index of the child.
Child Node
Gets the number of immediate children this Node has
Count of immediate child Nodes
Get the Cached Prism Transform of this Node
Transform Matrix
Get the Cached World Transform of this Node
Transform Matrix
Get the cursor hover state for this Node.
the cursor state.
Get the local AABB of this Node only, not including children, aligned to this Node's local coordinate system.
A local AABB of math::AABB::EMPTY indicates the Node either has no visual information or that local AABB is not supported for the Node.
Note: The local AABB for ModelNodes is currently not supported and will report math::AABB::EMPTY.
The bounding box.
Get the Local Position of this Node
Position
Get the Local Rotation of this Node
Rotation
Get the Local Scale of this Node
Scale
Get the Local Transform of this Node
Transform Matrix
Get the name of the Node.
This call returns EMPTY_STRING if the Node's name has not been set.
The name of the Node, if set.
Gets the Node Id of this Node
Every Node is assigned a unique ID per Prism
Node id of the current Node
Gets total number of resources associated with this AudioNode.
Number of resources.
Gets this Node's immediate parent
Parent Node, nullptr = no parent
When parented to a parents bone with setParentedBoneName
Parents bone name we are attached to
Returns the id of the prism the node belongs to.
the prism id (0 = invalid prism)
Get the Prism Position of this Node
Position
Gets the list of already associated resource IDs
std::vector of already associated resources.
Returns the PhysicsRigidBody attached to the node, if the node is participating in the physics system.
the rigid body
Gets the root node of the node tree this node belongs to.
The root node, or nullptr if none.
Get sound pitch.
Gets the current state of the audio, see enum AudioState.
Gets the current audio volume.
Gets the direct send levels for one channel of a sound output.
Multi-channel sounds require the direct send levels to be read individually for each channel by calling this function once for each channel. For mono sounds use channel = 0. For stereo sounds use channel = 0 for left and channel = 1 for right.
selects the channel whose direct send levels are being read
Get sound direction of a given audio channel. Direction is relative to audio node's local orientation.
Channel index(zero based).
of the sound for the given channel.
Get spatial sound distance parameters for a given channel.
Channel index(zero based).
See struct SpatialSoundDistanceProperties
Query if spatial sound is enabled or disabled.
false, Disabled
Get position of the given audio channel. Position is relative to audio node's local position.
Channel index(zero based).
of channels position.
Get spatial sound radiation parameters for a given channel.
Channel index(zero based).
See struct SpatialSoundRadiationProperties
Gets the room send levels for one channel of a sound output.
Multi-channel sounds require the room send levels to be read individually for each channel by calling this function once for each channel. For mono sounds use channel = 0. For stereo sounds use channel = 0 for left and channel = 1 for right.
selects the channel whose room send levels are being read
Gets the currently set starting point for playback of a streamed-file sound.
Get the World Position of this Node
Position
Checks to see if node subscribes to the specified node layer.
The layer to test if this node is a member of.
True if this node subscribes to the specified layer.
Determines if this Node is within the subtree.
true if this Node is within the subtree, false if not.
Returns the skip raycast state of the node.
True if the node is skipped during raycasting.
Queries if the sound is looping or not.
false, if not.
Check if sound is muted or not.
true - muted
false - not muted
Returns true if this node should handle trigger presses directly.
true if this node will handle trigger presses directly when focused, false if trigger press will instead enter prism placement mode.
Returns whether this Node's visibility is inherited by its children or not.
True if the Node's visiblity is inherited.
Returns the visibility state of the node. Note that only the local state is checked, the effect of a parent's visibility is ignored.
True if the Node is visible.
Returns the visibility of the Node in the hierarchy based on self visibility and any potential inherited visibility.
True if the Node is visible in the Prism.
Pause the sound if already playing.
Plays the specified system sound. By nature system sounds are expected to be of small duration like button_click etc... and are of fire-and-forget style, that is, cannot be stopped, paused and such. Usage: dialogBox_1->setLocalPosition(1.2, 0.0. -0.5); dialogBox_2->setLocalPosition(-0.7, 0.0. -0.5); AudioNode* audioNode = prism->createAudioNode(); audioNode->createSoundWithSystenEnum();
// Upon some event or a particular iteration of update loop. // To play sound from dialogBox_1's location: dialogBox_1->addChild(audioNode); audioNode->playSystemSound(SystemSoundEnum::kClose);
// Upon some other event or other iteration of update loop. // To play sound from dialogBox_2's location: dialogBox_2->addChild(audioNode); audioNode->playSystemSound(SystemSoundEnum::kClick);
// Upon yet other event or yet another iteration of update loop: // To play the sound from arbitrary location: rootNode->addChild(audioNode); audioNode->setLocalPosition(x,y,z); audioNode->playSystemSound(SystemSoundEnum::kAlert);
The system sound to be played.
Returns true if successful, else returns false.
Lets the audio service know that the buffer is filled and ready.
bool - Returns true on success else false.
Lets the audio service know that the buffer is filled and ready.
OutputStream's Id whose buffer is being released.
bool - Returns true on success else false.
Remove a child from the current Node
The child Node to remove.
Removes this node from the specified node layer.
The layer this node will be removed from.
Removes or disassociates the specified resource from the AudioNode. A valid AudioNode should have at least one resource associated with it. Hence, if the node has only one resource it will not be removed and the method will return false.
true, if resource successfully removed. false, if the node had only one resource in which case it cannot be removed. Or if the resource was not associated with the node.
Replaces the specified oldResourceID with the new one, newResourceID. If only one resource associated with the node, then the oldResourceID parameter is optional. In this case that resource will be replaced with the new one.
The new resource to be associated.
default = INVALID_RESOURCE_ID
The old resource to be disassociated.
@ return true, if the resource was successfully replaced. false, in the following scenarios: 1) If the specified old resource is not associated with the node. 2) If multiple resources are associated and oldResourceID argument not specified. 3) If this API called before any of the createSoundWithXxxx APIs were called.
Resume the sound if already playing and is paused.
Sets the anchor position of the Node's transform. Rotations, scaling, and translations of the transform will take place around this point. Changing the anchor point will recalculate the transform to the new anchor point.
Anchor position. This is relative to the default 0,0,0 position of the transform.
Set the cursor hover state for this Node.
Setting this will set the cursor state when this Node or any descendant Nodes, that are not explicitly set, are hovered over.
The cursor state
Set the local position of this Node
new position
Set the local rotation of this Node
new rotation
Set the local scale of this Node
new scale
Set the local transform of this Node
transform matrix
Set the name of the Node
By default a Node has no name.
The new name of the Node.
true if the name of the Node was successfully set, false otherwise.
Set the bone in the parent by name that this child will attach to This node must have a parent and the parent must be of type ModelNode.
bone name to attach to
true if successful, false if failed
Sets the skip raycast state of the node.
Raycast skip flag.
default = false
Flag to also set the raycast state of any children
Sets the mode of playing audio in repeat mode. If enabled, audio will play from start after reaching the end, until disabled. When audio is created, the default is disabled.
true enables loop mode. false disables loop mode.
Mute or unmute the sound.
true, mute the sound. false, unmute.
Sets sound pitch.
The range of the pitch is 0.5 to 2.0, with 0.5 being one octave down and 2.0 being one octave up (i.e., the pitch is a frequency multiple). A pitch of 1.0 is the default and means no change.
Pitch value to set. Range 0.5 t0 2.0
Similar to createWithSound with a difference that the sound has already been create using any of the createWithXxxx APIs. This method will set the AudioNodes properties as set in the Sound* parameter.
NOTE: The stream="false"|"true" and res=
A Sound object to apply it's properties to this AudioNode.
Sets the audio volume.
The range of the volume is 0 to 8, with 0 for silence, 1 for unity gain, and 8 for 8x gain.
Range 0.0f to 8.0f
Sets the direct send levels for one channel of a sound output.
When 3D audio processing is enabled for a sound output (see setSpatialSoundEnabled) this function sets the send levels for the direct component of the sound, i.e., the audio mix for the the part of the sound not affected by room acoustics. Multi-channel sounds require the direct send levels to be set individually for each channel by calling this function once for each channel. For mono sounds use channel = 0. For stereo sounds use channel = 0 for left and channel = 1 for right.
selects the channel whose direct send levels are being set
SpatialSoundSendLevels struct to set the levels
Set the sound direction of a given audio channel. Effective only if spatial sound is enabled (setSpatialSoundEnable) for an audio node. The Direction is relative to this nodes local orientation. By default that is, if this API not called then, the direction is same as the the parent nodes orientation. Will change the direction even if the audio clip is already playing.
Channel index(zero based).
A quaternion (glm::quat) specifying the direction of the sound for the given channel relative to the node's local orientation.
Set spatial sound distance parameters for a given channel.
Channel index(zero based).
spatial sound distance parameters, See struct SpatialSoundDistanceProperties
Enable\Disable the capability for spatial sound. If enabled, setSpatialSoundPosition must be called for positional sound to be effective.
true, Enable false, Disable
Set the position of a given audio channel relative to this nodes local position. Effective only if spatial sound is enabled explicitly for an audio node. Will change the position even if the audio clip is already playing.
Channel index(zero based).
A glm::vec3 specifying the offset of channel position relative to the node's local position.
Set spatial sound radiation parameters for a given channel.
Channel index(zero based).
spatial sound radiation parameters, See struct SpatialSoundRadiationProperties
Sets the room send levels for one channel of a sound output.
When 3D audio processing is enabled for a sound output (see setSpatialSoundEnabled) this function sets the send levels for the room component of the sound, i.e., the audio mix for the the part of the sound that's affected by room acoustics. Multi-channel sounds require the room send levels to be set individually for each channel by calling this function once for each channel. For mono sounds use channel = 0. For stereo sounds use channel = 0 for left and channel = 1 for right.
selects the channel whose room send levels are being set
SpatialSoundSendLevels struct to set the levels
Sets the starting point for playback of a streamed-file sound.
Value for offset in milliseconds.
Sets whether this node should handle trigger presses directly.
true if this node should handle trigger presses directly when focused, false if trigger press should instead enter prism placement mode.
Flags that the visibility state of this node should be inherited by its children. This does not change a child's visibility set by setVisible. A visibility of false will take precedence over a visibility of true. The tables below show the draw result for various combinations of node visibility and inheritance.
visible inherit drawn
node : false true no
child : true x no
visible inherit drawn
node : false false no
child : true x yes
visible inherit drawn
node : true true yes
child : false x no
visible inherit drawn
node : true false yes
child : false x no
Flag that this node's children should inherit its visibility.
Sets the visibility state of the node.
Visibility flag
default = false
Flag to also set the visibility state of any children
Starts capture for a sound input. This method must be called before acquiring audio data in the buffer using getInputBuffer().
true if successful. false on any failure.
Plays either the only one resource sound associated with the node or if more than one resources associated, picks any one of them randomly
NOTE: If looping is enabled [setLooping(true)] and multiple resources associated, startSound() will indefinitely play random sequence of all the associated sound resources. If only one resource associated, will indefinitely play that one resource back to back. To stop playing, call stopSound().
Plays the sound specified by the audio resource ID. The resource ID must be associated prior to this API call.
Intentionally not adding resource if not already added\associated with the node to avoid accidentally or easily associating too many resources which, has slight performance implications.
NOTE: If looping is enabled [setLooping(true)] will indefinitely play the specified resource back to back. To stop playing, call stopSound().
The resource sound to play.
Stops capture on sound input.
true if successful. false on any failure.
Stops the sound if already playing.
Stops all current property animations.
Client-side only: this static function is used to delete a node with its Prism's deleteNode function.
is the node to delete
Releases the input audio buffer for reuse.
After receiving a full buffer from getInputBuffer and reading the audio data from that buffer, call this function to indicate that the buffer has been read and can now be re-used.
MLHandle used to identify the sound input
true if successful. false on any failure.
Fire and forget API. Creates an AudioNode with the properties from the given Sound and sets a callback to destroy the node when it has finished playing.
Prism instance that the created node will belong to.
Sound instance that contains audio properties for the created AudioNode.
True if the audio node was successfully created, added to the scene and set to delete on play end.
Fire and forget API. Creates an AudioNode with the properties from the given Sound and sets a callback to destroy the node when it has finished playing.
Prism instance that the created node will belong to.
Sound instance that contains audio properties for the created AudioNode.
Position to set to the created AudioNode.
True if the audio node was successfully created, added to the scene and set to delete on play end.
Fire and forget API. Creates an AudioNode with the properties from the given Sound and sets a callback to destroy the node when it has finished playing.
Prism instance that the created node will belong to.
name of a Sound instance that contains audio properties for the created AudioNode.
True if the audio node was successfully created, added to the scene and set to delete on play end.
Fire and forget API. Creates an AudioNode with the properties from the given Sound and sets a callback to destroy the node when it has finished playing.
Prism instance that the created node will belong to.
name of a Sound instance that contains audio properties for the created AudioNode.
Position to set to the created AudioNode.
True if the audio node was successfully created, added to the scene and set to delete on play end.
Generated using TypeDoc
Adds a child to the current Node, removing it from its current parent.
A child can only have a single Parent
none