AudioNode

lumin. AudioNode

new AudioNode()

Extends

Methods

addChild(a_pChild) → {boolean}

Inherited From:

Adds a child to the current Node, removing it from its current parent.

A child can only have a single Parent

Parameters:
Name Type Description
a_pChild lumin.Node

The Node to add as a child to this Node.

Returns:

true if successful, false if failed

Type
boolean

addMoveCallback(trackopt)

Inherited From:

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.

Parameters:
Name Type Attributes Default Description
track number <optional>
0

addResource(resourceID) → {boolean}

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 must be called after initializing the AudioNode
with the above mentioned createSoundWithXxxx APIs.

After initializing with createSoundWithXxxx API, Optionally additional audio resources can be added
using this addResouce API.
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 LoadedFile sound.
AudioNode->addResource( loadedFileResourceID_2 ); // OK - loaded file resource
AudioNode->addResource( streamedFileResourceID_3 ); // ERROR - streamed file resource

Subsequently, when startSound() API is called, it will play the audio associated with the
most recently added resource. That is, addResource() will make the resource being added
the current resource.

Some use cases:
Example 1:
Alternative to having multiple AudioNodes for sounds playing from same position and
orientation (but not playing at same time or overlapped), use just one AudioNode and set
multiple audio resources(files) for that AudioNode. Make whichever resource you want to play
as current resource by calling addResource (can call multiple times on same resource) and
then call startSound to play.

Example 2:
For playing repeated sounds with slight variations for realism like, footsteps, breathing,
bullets, etc.. associate slightly varying audio resources with the same AudioNode and call
audioNode->playRandom();

Parameters:
Name Type Description
resourceID BigInt

Additional AudioResource ID to be associated with this AudioNode.
It also makes this resource current. That is, when startSound() called
will play this resource. Also calling addResource on same resource again
to make it current is okay. Resource is actually associated only first time
with the AudioNode, subsequent calls just makes it current.

Returns:
  • true, if successful added or already associated.
        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 unnecessary calls to
under-laying audio engine for resources which are not current. So, only associate
multiple resources if necessary(eg. playRandom) and do not add resources to AudioNode
which will be never used(on that node) or used only once. If the resource is not
going to be used any more, remove the association using remoceResource() API.

Type
boolean

addToLayer(a_layer)

Inherited From:

Adds this node to the specified node layer. Nodes can be members of multiple layers.

Parameters:
Name Type Description
a_layer BigInt

createSoundWithLoadedFile(resourceIDs, autoDestroyopt, dynamicDecodeopt) → {boolean}

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 and make the first one the
current resource.

NOTE: 1) Must be called only once to set the AudioNode's behavior in terms of it's sound resource(s).
2) Associating many resources to one AudioNode will result in unnecessary calls to
under-laying audio engine for resources which are not current. So, only associate
multiple resources if necessary(eg. playRandom) and do not add resources to AudioNode
which will be never used(on that node) or used only once. If the resource is not
going to be used any more, remove the association using remoceResource() API.

Parameters:
Name Type Attributes Default Description
resourceIDs Array.<BigInt>
autoDestroy boolean <optional>
false
dynamicDecode boolean <optional>
false
Returns:
Type
boolean

createSoundWithLoadedFile(resourceID, autoDestroyopt, dynamicDecodeopt) → {boolean}

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).

Parameters:
Name Type Attributes Default Description
resourceID BigInt

ID of the audio resource which is already created.

autoDestroy boolean <optional>
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.

dynamicDecode boolean <optional>
false

true = The file resource is compressed and will be decoded when playing.
false = The file\resource is an uncompressed PCM data.

Returns:

bool - Returns true on success else, returns false.

Type
boolean

createSoundWithStreamedFile(resourceIDs, autoDestroyopt) → {boolean}

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 and make the first one the
current resource.

NOTE: 1) Must be called only once to set the AudioNode's behavior in terms of it's sound resource(s).
2) Associating many resources to one AudioNode will result in unnecessary calls to
under-laying audio engine for resources which are not current. So, only associate
multiple resources if necessary(eg. playRandom) and do not add resources to AudioNode
which will be never used(on that node) or used only once. If the resource is not
going to be used any more, remove the association using remoceResource() API.

Parameters:
Name Type Attributes Default Description
resourceIDs Array.<BigInt>
autoDestroy boolean <optional>
false
Returns:
Type
boolean

createSoundWithStreamedFile(resourceID, autoDestroyopt) → {boolean}

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.

Parameters:
Name Type Attributes Default Description
resourceID BigInt

resource id of sound resource

autoDestroy boolean <optional>
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.

Returns:

bool - Returns true on success else, returns false.

Type
boolean

createSoundWithSystemEnum() → {boolean}

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.

Returns:
Type
boolean

createWithSound(sound, autoDestroyopt)

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).

Parameters:
Name Type Attributes Default Description
sound lumin.Sound

A Sound object to apply it's properties to this AudioNode.

autoDestroy boolean <optional>
false

Default is false and currently ignored.

delayMove(durationSecs, trackopt)

Inherited From:

Adds a delay to the current move sequence.

Parameters:
Name Type Attributes Default Description
durationSecs number

How long to delay, in seconds.

track number <optional>
0

which animation track to add the delay to.

findChild(name) → {lumin.Node}

Inherited From:

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.

Parameters:
Name Type Description
name string

The name to search for.

Returns:
Type
lumin.Node

findChildren(a_type, a_bExactTypeopt, a_bIncludeSelfopt) → {Array.<lumin.Node>}

Inherited From:

Does a breadth-first search of the child node hierarchy
for the specified Node type.

Parameters:
Name Type Attributes Default Description
a_type number

The type of Node to find in the child hierarchy.

a_bExactType boolean <optional>
false

Flag to indicate if the child node must be the exact type or can be derived from the type (default false).

a_bIncludeSelf boolean <optional>
false

Flag to indicate if the search should include this Node (default false).

Returns:

A vector of Node pointers containing the results.

Type
Array.<lumin.Node>

findParent(a_type, a_bExactTypeopt) → {lumin.Node}

Inherited From:

Searches up the tree parentage for the specific Node type.

Parameters:
Name Type Attributes Default Description
a_type number

The type of Node to find in the parent hierarchy.

a_bExactType boolean <optional>
false

Flag to indicate if the parent node must be the exact type or can be derived from the type (default false).

Returns:

The parent node, if found, null if not found.

Type
lumin.Node

getAABB() → {lumin.math.AABB}

Inherited From:

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.

Returns:

The bounding box

Type
lumin.math.AABB

getAnchorPosition() → {vec3}

Inherited From:

Returns the anchor position of the node.

Returns:

The anchor position.

Type
vec3

getChild(a_iIndex) → {lumin.Node}

Inherited From:

Gets the n'th child from this Node's children

Parameters:
Name Type Description
a_iIndex number

The index of the child.

Returns:

Child Node

Type
lumin.Node

getChildCount() → {number}

Inherited From:

Gets the number of immediate children this Node has

Returns:

Count of immediate child Nodes

Type
number

getCurrentPrismTransform() → {mat4}

Inherited From:

Get the Cached Prism Transform of this Node

Returns:

Transform Matrix

Type
mat4

getCurrentResource() → {BigInt}

Gets the current audio resource for this AudioNode.
Note, AudioNode can have multiple resources associated with it.

Returns:

resourceID - returns the resource ID which is current that is,
the resource which is played when startSound() on the AudioNode is called.

Type
BigInt

getCurrentWorldTransform() → {mat4}

Inherited From:

Get the Cached World Transform of this Node

Returns:

Transform Matrix

Type
mat4

getCursorHoverState() → {lumin.CursorHoverState}

Inherited From:

Get the cursor hover state for this Node.

Returns:

the cursor state.

Type
lumin.CursorHoverState

getLocalAABB() → {lumin.math.AABB}

Inherited From:

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.

Returns:

The bounding box.

Type
lumin.math.AABB

getLocalPosition() → {vec3}

Inherited From:

Get the Local Position of this Node

Returns:

Position

Type
vec3

getLocalRotation() → {quat}

Inherited From:

Get the Local Rotation of this Node

Returns:

Rotation

Type
quat

getLocalScale() → {vec3}

Inherited From:

Get the Local Scale of this Node

Returns:

Scale

Type
vec3

getLocalTransform() → {mat4}

Inherited From:

Get the Local Transform of this Node

Returns:

Transform Matrix

Type
mat4

getName() → {string}

Inherited From:

Get the name of the Node.

This call returns EMPTY_STRING if the Node's
name has not been set.

Returns:

The name of the Node, if set.

Type
string

getNodeId() → {BigInt}

Inherited From:

Gets the Node Id of this Node

Every Node is assigned a unique ID per Prism

Returns:

Node id of the current Node

Type
BigInt

getNumResources() → {number}

Gets total number of resources associated with this AudioNode.

Returns:

Number of resources.

Type
number

getParent() → {lumin.Node}

Inherited From:

Gets this Node's immediate parent

Returns:

Parent Node, nullptr = no parent

Type
lumin.Node

getParentedBoneName() → {string}

Inherited From:

When parented to a parents bone with setParentedBoneName

Returns:

Parents bone name we are attached to

Type
string

getPrismId() → {BigInt}

Inherited From:

Returns the id of the prism the node belongs to.

Returns:

the prism id (0 = invalid prism)

Type
BigInt

getPrismPosition() → {vec3}

Inherited From:

Get the Prism Position of this Node

Returns:

Position

Type
vec3

getRigidBody() → {lumin.PhysicsRigidBody}

Inherited From:

Returns the PhysicsRigidBody attached to the node, if the node is participating in the physics
system.

Returns:

the rigid body

Type
lumin.PhysicsRigidBody

getRoot() → {lumin.RootNode}

Inherited From:

Gets the root node of the node tree this node belongs to.

Returns:

The root node, or nullptr if none.

Type
lumin.RootNode

getSoundPitch() → {number}

Get sound pitch.

Returns:
  • Reference to a float to output current value.
Type
number

getSoundState() → {lumin.AudioState}

Gets the current state of the audio, see enum AudioState.

Returns:
  • Output parameter where the audio state will be stored.
Type
lumin.AudioState

getSoundVolumeLinear() → {number}

Gets the current audio volume.

Returns:
  • Reference to a float to output current value.
Type
number

getSpatialSoundDirection(channel) → {quat}

Get sound direction of a given audio channel.
Direction is relative to audio node's local orientation.

Parameters:
Name Type Description
channel number

Channel index(zero based).

Returns:
  • A quaternion (glm::quat) which gets populated by direction
            of the sound for the given channel.
Type
quat

getSpatialSoundDirectSendLevels(channel) → {lumin.SpatialSoundSendLevels}

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.

Parameters:
Name Type Description
channel number

selects the channel whose direct send levels are being read

Returns:
  • SpatialSoundSendLevels struct to return the levels
Type
lumin.SpatialSoundSendLevels

getSpatialSoundDistanceProperties(channel) → {lumin.SpatialSoundDistanceProperties}

Get spatial sound distance parameters for a given channel.

Parameters:
Name Type Description
channel number

Channel index(zero based).

Returns:
  • Reference to distance properties struct.
            See struct SpatialSoundDistanceProperties
Type
lumin.SpatialSoundDistanceProperties

getSpatialSoundEnable() → {boolean}

Query if spatial sound is enabled or disabled.

Returns:
  • true, Enabled
                       false, Disabled
Type
boolean

getSpatialSoundPosition(channel) → {vec3}

Get position of the given audio channel. Position is relative to audio node's
local position.

Parameters:
Name Type Description
channel number

Channel index(zero based).

Returns:
  • A glm::vec3 which gets populated by the offset
            of channels position.
Type
vec3

getSpatialSoundRadiationProperties(channel) → {lumin.SpatialSoundRadiationProperties}

Get spatial sound radiation parameters for a given channel.

Parameters:
Name Type Description
channel number

Channel index(zero based).

Returns:
  • Reference to radiation properties struct.
            See struct SpatialSoundRadiationProperties
Type
lumin.SpatialSoundRadiationProperties

getSpatialSoundRoomSendLevels(channel) → {lumin.SpatialSoundSendLevels}

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.

Parameters:
Name Type Description
channel number

selects the channel whose room send levels are being read

Returns:
  • SpatialSoundSendLevels struct to return the levels
Type
lumin.SpatialSoundSendLevels

getStreamedFileOffset() → {number}

Gets the currently set starting point for playback of a streamed-file sound.

Returns:
  • Reference to uint32_t to output the current value of offset.
Type
number

getWorldPosition() → {vec3}

Inherited From:

Get the World Position of this Node

Returns:

Position

Type
vec3

isInLayer(a_layer) → {boolean}

Inherited From:

Checks to see if node subscribes to the specified node layer.

Parameters:
Name Type Description
a_layer BigInt

The layer to test if this node is a member of.

Returns:

True if this node subscribes to the specified layer.

Type
boolean

isInSubtree(pParent) → {boolean}

Inherited From:

Determines if this Node is within the subtree.

Parameters:
Name Type Description
pParent lumin.Node
Returns:

true if this Node is within the subtree, false if not.

Type
boolean

isSkipRaycast() → {boolean}

Inherited From:

Returns the skip raycast state of the node.

Returns:

True if the node is skipped during raycasting.

Type
boolean

isSoundLooping() → {boolean}

Queries if the sound is looping or not.

Returns:
  • true, if sound is looping.
                       false, if not.
Type
boolean

isSoundMuted() → {boolean}

Check if sound is muted or not.

Returns:
  • Reference to a bool to output current value.
            true - muted
            false - not muted
Type
boolean

isTriggerable() → {boolean}

Inherited From:

Returns true if this node should handle trigger presses directly.

Returns:

true if this node will handle trigger presses directly when focused,
false if trigger press will instead enter prism placement mode.

Type
boolean

isVisibilityInherited() → {boolean}

Inherited From:

Returns whether this Node's visibility is inherited by its children or not.

Returns:

True if the Node's visiblity is inherited.

Type
boolean

isVisible() → {boolean}

Inherited From:

Returns the visibility state of the node. Note that only the local state is checked, the
effect of a parent's visibility is ignored.

Returns:

True if the Node is visible.

Type
boolean

isVisibleInPrism() → {boolean}

Inherited From:

Returns the visibility of the Node in the hierarchy based on self visibility and any
potential inherited visibility.

Returns:

True if the Node is visible in the Prism.

Type
boolean

pauseSound()

Pause the sound if already playing.

playRandom(numSoundsopt) → {boolean}

Plays given number of sounds out of total number of associated resources.
Picks randomly and plays in random order.
Expects multiple resources associated with this AudioNode using addResource(resId) API.

Example usage of this API:
Lets say total 20 sound resources, each slightly different sound of squeaking-footsteps are
associate with an AudioNode. playRandom(3) or playRandom(5) will only play any 3 and 5
sounds out of those 20.
The idea is to feel realism by slight-random variation. Exact same sound
repeated is very obvious and doesn't feel real.

Parameters:
Name Type Attributes Default Description
numSounds number <optional>
0

Number of sounds to play randomly from associated resources.
Valid values, 0 - (default) play all associated resources in random order.
n - (n < # of associated resources) play n out of total resource.
Picks n resources randomly and plays in random order.

Returns:

false if only one resource associated or numSound greater than number of
associated resources.

Type
boolean

(static) playSound(prism, soundName) → {boolean}

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.

Parameters:
Name Type Description
prism lumin.Prism

Prism instance that the created node will belong to.

soundName string

name of a Sound instance that contains audio properties for the created AudioNode.

Returns:

True if the audio node was successfully created, added to the scene and set to delete on play end.

Type
boolean

(static) playSound(prism, soundName, pos) → {boolean}

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.

Parameters:
Name Type Description
prism lumin.Prism

Prism instance that the created node will belong to.

soundName string

name of a Sound instance that contains audio properties for the created AudioNode.

pos vec3

Position to set to the created AudioNode.

Returns:

True if the audio node was successfully created, added to the scene and set to delete on play end.

Type
boolean

(static) playSound(prism, sound, pos) → {boolean}

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.

Parameters:
Name Type Description
prism lumin.Prism

Prism instance that the created node will belong to.

sound lumin.Sound

Sound instance that contains audio properties for the created AudioNode.

pos vec3

Position to set to the created AudioNode.

Returns:

True if the audio node was successfully created, added to the scene and set to delete on play end.

Type
boolean

(static) playSound(prism, sound) → {boolean}

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.

Parameters:
Name Type Description
prism lumin.Prism

Prism instance that the created node will belong to.

sound lumin.Sound

Sound instance that contains audio properties for the created AudioNode.

Returns:

True if the audio node was successfully created, added to the scene and set to delete on play end.

Type
boolean

playSystemSound(sysSound) → {boolean}

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);

Parameters:
Name Type Description
sysSound lumin.SystemSoundEnum

The system sound to be played.

Returns:

Returns true if successful, else returns false.

Type
boolean

(static) ReleaseInputBuffer(audioId) → {boolean}

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.

Parameters:
Name Type Description
audioId BigInt

MLHandle used to identify the sound input

Returns:

true if successful. false on any failure.

Type
boolean

releaseOutputStreamBuffer() → {boolean}

Lets the audio service know that the buffer is filled and ready.

Returns:

bool - Returns true on success else false.

Type
boolean

releaseOutputStreamBuffer(streamId) → {boolean}

Lets the audio service know that the buffer is filled and ready.

Parameters:
Name Type Description
streamId BigInt

OutputStream's Id whose buffer is being released.

Returns:

bool - Returns true on success else false.

Type
boolean

removeChild(a_pChild)

Inherited From:

Remove a child from the current Node

Parameters:
Name Type Description
a_pChild lumin.Node

The child Node to remove.

removeFromLayer(a_layer)

Inherited From:

Removes this node from the specified node layer.

Parameters:
Name Type Description
a_layer BigInt

The layer this node will be removed from.

removeResource(resourceID) → {boolean}

Parameters:
Name Type Description
resourceID BigInt
Returns:

true, if resource successfully removed or if resource is not associated with the node.
false, if 1) the resource is the current resource or
2) the node had only one resource in which case it cannot be removed.

Type
boolean

replaceResource(resourceID) → {boolean}

Parameters:
Name Type Description
resourceID BigInt
Returns:
Type
boolean

resumeSound()

Resume the sound if already playing and is paused.

setAnchorPosition(a_position)

Inherited From:

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.

Parameters:
Name Type Description
a_position vec3

Anchor position. This is relative to the default 0,0,0 position of the
transform.

setCursorHoverState(state)

Inherited From:

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.

Parameters:
Name Type Description
state lumin.CursorHoverState

The cursor state

setLocalPosition(aPos)

Inherited From:

Set the local position of this Node

Parameters:
Name Type Description
aPos vec3

new position

setLocalRotation(aRot)

Inherited From:

Set the local rotation of this Node

Parameters:
Name Type Description
aRot quat

new rotation

setLocalScale(aScale)

Inherited From:

Set the local scale of this Node

Parameters:
Name Type Description
aScale vec3

new scale

setLocalTransform(aTransform)

Inherited From:

Set the local transform of this Node

Parameters:
Name Type Description
aTransform mat4

transform matrix

setName(a_name) → {boolean}

Inherited From:

Set the name of the Node

By default a Node has no name.

Parameters:
Name Type Description
a_name string

The new name of the Node.

Returns:

true if the name of the Node was successfully set, false otherwise.

Type
boolean

setParentedBoneName(a_boneName) → {boolean}

Inherited From:

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.

Parameters:
Name Type Description
a_boneName string

bone name to attach to

Returns:

true if successful, false if failed

Type
boolean

setSkipRaycast(a_skipRaycast, a_propagateToChildrenopt)

Inherited From:

Sets the skip raycast state of the node.

Parameters:
Name Type Attributes Default Description
a_skipRaycast boolean

Raycast skip flag.

a_propagateToChildren boolean <optional>
false

Flag to also set the raycast state of any children

setSoundLooping(isLooping)

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.

Parameters:
Name Type Description
isLooping boolean

true enables loop mode.
false disables loop mode.

setSoundMute(isMuted)

Mute or unmute the sound.

Parameters:
Name Type Description
isMuted boolean

true, mute the sound.
false, unmute.

setSoundPitch(pitch)

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.

Parameters:
Name Type Description
pitch number

Pitch value to set. Range 0.5 t0 2.0

setSoundProperties(sound)

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=<res_id> properties(from XML from which
the Sound object was created) will be ignored because the AudioNode was
already initialized using either createSoundWithLoadedfile,
createSoundWithStreamedFile or any other createSoundXxxx APIs.

Parameters:
Name Type Description
sound lumin.Sound

A Sound object to apply it's properties to this AudioNode.

setSoundVolumeLinear(volume)

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.

Parameters:
Name Type Description
volume number

Range 0.0f to 8.0f

setSpatialSoundDirection(channel, channelDirection)

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.

Parameters:
Name Type Description
channel number

Channel index(zero based).

channelDirection quat

A quaternion (glm::quat) specifying the direction of the sound for the given channel
relative to the node's local orientation.

setSpatialSoundDirectSendLevels(channel, channelSendlevels)

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