Libraries.Game.Audio3D Documentation

Inherits from: Libraries.Interface.Item3D, Libraries.Interface.Item, Libraries.Language.Object, Libraries.Sound.Audio

Actions Documentation

Add(Libraries.Interface.Item3D newItem)

This action adds a different Item3D into this one. This makes a few things happen. 1. The added item will get this item as its parent. 2. The added item's x, y, and z coordinates will become relative to this Item. 3. Most actions on this Item will also affect the added Item.

Parameters

Example

use Libraries.Interface.Item3D

Item3D parentItem
Item3D child
parentItem:Add(child)

Add(integer index, Libraries.Interface.Item3D newItem)

This action adds a different Item3D into this one, storing the added Item3D at a specific index in the internal array.

Parameters

Example

use Libraries.Interface.Item3D

Item3D parentItem
Item3D child
parentItem:Add(0, child)

AddBehavior(Libraries.Interface.Behaviors.Behavior behavior)

This action adds a new Behavior to this Item.

Parameters

AddFocusListener(Libraries.Interface.Events.FocusListener listener)

This action adds a FocusListener to the Item. When the Item receives a FocusEvent due to either gaining or losing the focus, the listener will be notified.

Parameters

Example

use Libraries.Interface.Item
use Libraries.Interface.Events.FocusListener
Item myItem
FocusListener listener
myItem:AddFocusListener(listener)

AddGestureListener(Libraries.Interface.Events.GestureListener listener)

This action adds a GestureListener to the Item. If the Item ever receives a GestureEvent, the listener will be notified.

Parameters

Example

use Libraries.Interface.Item
use Libraries.Interface.Events.GestureListener
Item myItem
GestureListener listener
myItem:AddGestureListener(listener)

AddMouseListener(Libraries.Interface.Events.MouseListener listener)

This action adds a MouseListener to the Item. If the Item ever receives a MouseEvent due to a mouse click, the mouse listener will be notified.

Parameters

Example

use Libraries.Interface.Item
use Libraries.Interface.Events.MouseListener
Item myItem
MouseListener listener
myItem:AddMouseListener(listener)

AddMouseMovementListener(Libraries.Interface.Events.MouseMovementListener listener)

This action adds a MouseMovementListener to the Item. If the Item ever receives a MouseEvent due to mouse movement, the listener will be notified.

Parameters

Example

use Libraries.Interface.Item
use Libraries.Interface.Events.MouseMovementListener
Item myItem
MouseMovementListener listener
myItem:AddMouseMovementListener(listener)

AddMouseWheelListener(Libraries.Interface.Events.MouseWheelListener listener)

This action adds a MouseWheelListener to the Item. If the Item ever receives a MouseEvent due to the mouse wheel being scrolled, the listener will be notified.

Parameters

Example

use Libraries.Interface.Item
use Libraries.Interface.Events.MouseWheelListener
Item myItem
MouseWheelListener listener
myItem:AddMouseWheelListener(listener)

AddToQueue(Libraries.Sound.AudioSamples samples)

The AddToQueue action adds AudioSamples to the end of the data stored in this Audio object. To use this, the Audio must have been initialized using LoadToStream using an AudioSamples object, or must not have been initialized yet. This action can't be combined with actions that load a file into the Audio.

Parameters

Example



use Libraries.Sound.AudioSamples
use Libraries.Sound.Audio

Audio audio

AudioSamples samples1
AudioSamples samples2
AudioSamples samples3

samples1:Load("Sonata-Part1.ogg")
samples2:Load("Sonata-Part2.ogg")
samples3:Load("Sonata-Part3.ogg")

audio:LoadToStream(samples1)
audio:AddToQueue(samples2)
audio:AddToQueue(samples3)

audio:Play()
repeat while audio:IsPlaying()
    audio:Stream()
end

AddTouchListener(Libraries.Interface.Events.TouchListener listener)

This action adds a TouchListener to the Item. If the Item ever receives a TouchEvent, the listener will be notified.

Parameters

Example

use Libraries.Interface.Item
use Libraries.Interface.Events.TouchListener
Item myItem
TouchListener listener
myItem:AddTouchListener(listener)

ApplyAngularImpulse(Libraries.Compute.Vector3 impulse)

This action will increase the y-coordinate of this Item by the given amount.

Parameters

Example

use Libraries.Interface.Item3D

Item3D myItem
myItem:SetY(50)
myItem:MoveY(25)

ApplyDamping(number seconds)

Parameters

  • number seconds

ApplyForce(Libraries.Compute.Vector3 force, Libraries.Compute.Vector3 point)

transform:Translate(xAmount, yAmount, -zAmount)

Parameters

ApplyForceToCenter(Libraries.Compute.Vector3 force)

This action will increase the x, y, and z coordinates of this Item by the given amounts.

Parameters

Example

use Libraries.Interface.Item3D

Item3D myItem
myItem:SetPosition(50, 25, 80)
myItem:Move(25, 15, -20)

ApplyImpulse(Libraries.Compute.Vector3 impulse, Libraries.Compute.Vector3 localPositionToApply)

ACTIONS MADE FOR JOINTS.

Parameters

ApplyLinearImpulse(Libraries.Compute.Vector3 impulse, Libraries.Compute.Vector3 point)

This action will increase the z-coordinate of this Item by the given amount.

Parameters

Example

use Libraries.Interface.Item3D

Item3D myItem
myItem:SetZ(50)
myItem:MoveZ(25)

ApplyLinearImpulseToCenter(Libraries.Compute.Vector3 impulse)

ACTIONS MADE FOR JOINTS.

Parameters

ApplyTorque(Libraries.Compute.Vector3 torque)

transform:Translate(0, 0, -zAmount)

Parameters

ApplyTorqueImpulse(Libraries.Compute.Vector3 torque)

BeginCollision(Libraries.Interface.Item item)

This action is used to indicate that two items have just begun colliding. When two Items collide, the BeginCollision action should be called on both of them, with the other item passed as a parameter to the action. Note that this action does nothing by default, but classes that inherit from Item may override it.

Parameters

Example

use Libraries.Interface.Item

Item collider1
Item collider2
collider1:BeginCollision(collider2)
collider2:BeginCollision(collider1)

CanRotate(boolean flag)

Parameters

  • boolean flag

CancelBehaviors()

This action stops all behaviors this Item is following without finishing them.

CollideWithChildren()

Return

boolean

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

ComputeAngularImpulseDenominator(Libraries.Compute.Vector3 axis)

Parameters

Return

number

ComputeImpulseDenominator(Libraries.Compute.Vector3 position, Libraries.Compute.Vector3 normal)

CreateNodes(Libraries.Game.Collision.BroadphaseCollision3D broadphase, Libraries.Game.Collision.PhysicsPosition3D transform)

This action will take a TouchEvent and distribute it to any TouchListeners that have been added to this Item3D. This action will also set the event to the "handled" state.

Parameters

Example

use Libraries.Interface.Item2D
use Libraries.Interface.Events.TouchEvent
use Libraries.Interface.Events.TouchListener
Item2D myItem
TouchListener listener
myItem:AddTouchListener(listener)
TouchEvent event
event:eventType = event:BEGAN
myItem:ProcessTouchEvent(event)

DestroyNodes(Libraries.Game.Collision.BroadphaseCollision3D broadphase)

This action will remove all Items from this Item's children hierarchy. Note that this will not empty the hierarchies of the contained Items.

Parameters

Example

use Libraries.Interface.Item3D

Item3D parentItem
Item3D child1
Item3D child2
Item3D grandchild
parentItem:Add(child1)
parentItem:Add(child2)
child1:Add(grandChild)
parentItem:Empty()

DisableDoppler()

DisableDoppler will stop the audio from automatically calculating doppler shift.

Example



use Libraries.Sound.Audio

Audio audio
audio:Load("Sound.wav")

// The doppler effect is only noticable if the audio has velocity.
audio:SetVelocity(4, 0, -2)

// Because we disable the doppler effect here, the velocity we just set will
// have no effect.
audio:DisableDoppler()

DisableListenerDoppler()

DisableListenerDoppler will make the audio engine stop using the velocity of the listener when calculating doppler effect. This will NOT stop the engine from using the velocity of other audio objects that do have doppler enabled when calculating the doppler shift. The listener is universal to all audio objects, so disabling doppler effect on the listener will be in effect during calculation of doppler shift for ALL audio objects.

Example



use Libraries.Sound.Audio

Audio audio
audio:Load("Whale.wav")

// In order to hear the doppler effect in action, the listener needs
// to have velocity.
audio:SetListenerVelocity(5, 0, 4)

// Because we are now disabling the doppler effect on the listener, the
// velocity we gave it will have no effect.
audio:DisableListenerDoppler()

DisableLooping()

DisableLooping will ensure that an audio file stops playing when it reaches the end of the sound, instead of repeating. This is the default behavior, so it is only necessary to call this if there was a call to EnableLooping earlier in the program.

Example



use Libraries.Sound.Audio

// To use audio, we'll first need to create an object for it.
Audio audio

// We need to load our audio before we change whether or not it will loop.
audio:Load("test.wav")

// We now enable looping. This will make the sound repeat forever until we
// stop it or call "audio:DisableLooping()".
audio:EnableLooping()

// Our audio is currently set to loop. We can disable it again using DisableLooping().
audio:DisableLooping()

Dispose()

This action is used to free up any additional memory that is being used by this Item for purposes such as graphics. Note that the Item class doesn't have any extra memory that needs to be released with this action, but some classes which inherit from Item, such as Libraries.Game.Graphics.Drawable, do.

DisposeAll()

This action is used to call Dispose on this Item and on the entire children hierarchy of this Item.

DisposeChildren()

This action is used to call Dispose on the entire children hierarchy of this Item. This will not call Dispose on this Item.

Draw(Libraries.Game.Graphics.Painter3D painter)

This action is used to draw this Item on the screen, and then draw all of the Item's children hierarchy on the screen. Note that Items themselves can not be drawn, but some classes that extend the Item class, such as the Libraries.Game.Graphics.Model class, can be. To see how they draw, see their documentation.

Parameters

Empty()

This action will remove all Items from this Item's children hierarchy. Note that this will not empty the hierarchies of the contained Items.

Example

use Libraries.Interface.Item3D

Item3D parentItem
Item3D child1
Item3D child2
Item3D grandchild
parentItem:Add(child1)
parentItem:Add(child2)
child1:Add(grandChild)
parentItem:Empty()

EmptyAll()

This action will call Empty on the entire children hierarchy of this item, and then empty this item as well.

EmptyChildren()

This action is used to call Empty on all children contained in this item's children hierarchy. This will not empty the children of this item.

EnableDoppler()

EnableDoppler will make the audio automatically calculate doppler shift for this audio. Doppler is enabled by default for audio, but will have no effect until the user provides the velocity of the audio via an action, such as SetVelocity(Vector3).

Example



use Libraries.Sound.Audio

Audio audio
audio:Load("Sound.wav")

// We need to set the velocity of the audio in order to hear the doppler effect.
audio:SetVelocity(4, 0, -2)

// Doppler is already enabled by default, so this call would only be needed
// if we had previously disabled the doppler effect on this audio.
audio:EnableDoppler()

EnableListenerDoppler()

EnableListenerDoppler will make the audio engine consider the velocity of the listener when calculating doppler effects. The listener is universal to all audio objects, which means that if you enable doppler calculations for the listener, it will enable it when calculating doppler for ALL audio objects. By default, the listener already has doppler enabled, but this will have no effect until the listener is given a velocity.

Example



use Libraries.Sound.Audio

Audio audio
audio:Load("Whale.wav")

// In order to hear the doppler effect in action, the listener needs
// to have velocity.
audio:SetListenerVelocity(5, 0, 4)

// We now enable the doppler effect for the listener -- by default, this
// is already on, so this is only needed if we'd previously disabled it.
audio:EnableListenerDoppler()

EnableLooping()

EnableLooping will set the audio to continuously repeat itself when reaching the end of the audio instead of stopping.

Example



use Libraries.Sound.Audio

// To use audio, we'll first need to create an object for it.
Audio audio

// We need to load our audio before we change whether or not it will loop.
audio:Load("test.wav")

// We now enable looping. This will make the sound repeat forever until we
// stop it or call "audio:DisableLooping()".
audio:EnableLooping()

EnablePhysics(boolean flag)

This action will return the global y coordinate of the Item3D. This is the item's position plus any offset applied by its relation to its parent (if it has one).

Parameters

  • boolean flag

Example

use Libraries.Interface.Item3D
Item3D myItem
Item3D parentItem
parentItem:SetY(50)
myItem:SetY(25)
parentItem:Add(myItem)
number y = myItem:GetGlobalY()

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

Example

use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)

FastMoving(boolean flag)

This action sets the x, y, and z coordinates of the Item3D.

Parameters

  • boolean flag

Example

use Libraries.Interface.Item3D
Item3D myItem
myItem:SetPosition(50, 200, 35)

FinishCollision(Libraries.Interface.Item item)

This action is used to indicate that two items that were previously colliding no longer are. The FinishCollision action should be called on both Items involved, with the other item passed as a parameter to the action. Note that this action does nothing by default, but classes that inherit from Item may override it.

Parameters

Example

use Libraries.Interface.Item

Item collider1
Item collider2
collider1:FinishCollision(collider2)
collider2:FinishCollision(collider1)

Focus()

This action sets focus on this Item. If the Item is not focusable, it will instead look through the parent hierarchy and set focus on the first focusable ancestor. If no focusable Item can be found, this action will have no effect.

GainedFocus(Libraries.Interface.Events.FocusEvent event)

This action is fired if the item received the focus.

Parameters

GetAccessibilityCode()

This action returns the current accessiblity code for this Item

Return

integer:

GetAccessibilityRoleDescription()

This action returns the custom accessibility role description for this item, if any.

Return

text:

GetAccessibilityType()

This action returns the name of the accessiblity code for this Item as Text

Return

text:

GetAccessibleParent()

This action returns the parent of this Item3D. An Item3D gets a parent when it is added to another Item using the Add action.

Return

Libraries.Interface.Item: The parent Item.

Example

use Libraries.Interface.Item3D

Item3D parentItem
Item3D child
parentItem:Add(child)
Item3D item = child:GetParent()

GetAngularDamping()

This action sets the width, height, and depth of the Item3D.

Return

number:

Example

use Libraries.Interface.Item3D
Item3D myItem
myItem:SetDimensions(50, 200, 35)

GetAngularFactor()

Source: http://answers.unity3d.com/storage/temp/12048-lefthandedtorighthanded.pdf

Return

number:

GetAngularVelocity()

This action sets the Z offset of the item. The offset tells the Item where to relate its Z position to. In other words, the Z offset is where a Z coordinate of 0 is for this item. This is automatically set when using an action to add an Item to another Item.

Return

Libraries.Compute.Vector3:

Example

use Libraries.Interface.Item3D
Item3D myItem
myItem:SetOffsetZ(75)

GetBalance()

GetBalance will return the current balance value of the sound. A value of -1 represents audio fully from the left speaker. A value of 1 represents audio fully from the right speaker. A value of 0 represents audio equally from both speakers.

Return

number:

Example



use Libraries.Sound.Audio

// To use audio, we'll first need to create an object for it.
Audio audio

// We always have to load a sound before use.
audio:Load("ding.wav")

// For this example, we will set the balance to -1.
audio:SetBalance(-1)

// We can get the balance back as a number using the GetBalance() action.
number balance = audio:GetBalance()

GetBoundingBox(integer childIndex)

This action is used to draw this Item on the screen, and then draw all of the Item's children hierarchy on the screen. Note that Items themselves can not be drawn, but some classes that extend the Item class, such as the Libraries.Game.Graphics.Model class, can be. To see how they draw, see their documentation.

Parameters

  • integer childIndex

Return

Libraries.Game.BoundingBox:

GetCenterOfMassPosition()

GetCenterOfMassTransform()

GetCollisionGroupFlag()

This action lets the 3D collision solver actions (inside the class CollisionSolver3D) know that if this object needs its physics to be updated.

Return

boolean:

GetCollisionGroupIndex()

This action sets where in the "list of objects that needs to be updated because collision happened" that this object resides in. This "list of objects that needs to be updated because collision happened" is stored inside the CollisionSolver3D class as tempSolverBodyPool.

Return

integer:

GetCollisionList()

This action will return the Matrix4 containing the rotations applied to the Item3D. The values inside the Matrix are used during transform calculations, so they shouldn't be changed unless you know what you're doing!

Return

Libraries.Game.Collision.CollisionEdge3D: The Matrix4 used by this item to store and calculate rotations.

Example

use Libraries.Interface.Item3D
use Libraries.Compute.Matrix4
Item3D myItem
Matrix4 matrix = myItem:GetRotationTransform()

GetCollisionTransform()

This action removes an Item3D that was previously added to this Item3D.

Return

Libraries.Game.Collision.PhysicsPosition3D: Whether or not the item was found and removed.

Example

use Libraries.Interface.Item3D

Item3D parentItem
Item3D child1
Item3D child2
parentItem:Add(child1)
parentItem:Add(child2)
parentItem:Remove(child1)

GetCollisionTransform0()

GetCurrentAudioSamples()

This action returns which AudioSample is currently queued when used on an Audio object that is streaming AudioSamples.

Return

Libraries.Sound.AudioSamples: The currently queued AudioSamples.

GetDefaultMaximumVolumeDistance()

This action returns the default maximum volume distance for all newly created Audio objects. It will not change the maximum volume distance of any Audio objects that have already been loaded.

Return

number: The default maximum volume distance to use for all newly loaded Audio objects.

Example



use Libraries.Sound.Audio

Audio audio1
Audio audio2

// We test to see what the default maximum volume distance is using audio1.
output "The default rolloff rate is " + audio1:GetDefaultMaximumVolumeDistance()

audio2:SetDefaultMaximumVolumeDistance(0.5)

// Even though we changed the default max volume distance using audio2,
// we can still see the changed default using audio1.
output "Now the default rolloff rate is " + audio1:GetDefaultMaximumVolumeDistance()

GetDefaultRolloffRate()

This action returns the default rolloff rate of newly loaded Audio objects. It can be changed using the SetDefaultRolloffRate action. The default value is shared across all Audio objects.

Return

number:

Example



use Libraries.Sound.Audio

Audio audio1
Audio audio2

// We test to see what the default rolloff rate is using audio1.
output "The default rolloff rate is " + audio1:GetDefaultRolloffRate()

audio2:SetDefaultRolloffRate(0.5)

// Even though we changed the default rolloff rate using audio2,
// we can still see the changed default using audio1.
output "Now the default rolloff rate is " + audio1:GetDefaultRolloffRate()

GetDepth()

GetDepth will return the depth of this Item3D.

Return

number: The depth of this item.

Example

use Libraries.Interface.Item3D

Item3D myItem
myItem:SetDepth(50)
number depth = myItem:GetDepth()

GetDescription()

This action returns the current internal description of the Item.

Return

text:

Example

use Libraries.Interface.Item

Item item
item:SetDescription("Used for demo purposes.")
output "My item's description is : " + item:GetDescription()

GetDimensions()

GetDimensions will return a Vector3 object containing the width, height, and depth of this Item3D object.

Return

Libraries.Compute.Vector3: A new Vector3 object containing the width, height, and depth of this item.

Example

use Libraries.Interface.Item3D
use Libraries.Compute.Vector3

Item3D myItem
myItem:SetWidth(50)
Vector3 vector = myItem:GetDimensions()

GetFade()

GetFade will return the current fade value of the sound. A value of -1 represents audio fully from the rear channel. A value of 1 represents audio fully from the front channel. A value of 0 represents audio equally from both channels.

Return

number:

Example



use Libraries.Sound.Audio

// To use audio, we'll first need to create an object for it.
Audio audio

// We always have to load a sound before use.
audio:Load("ding.wav")

// For this example, we will set the fade to -1.
audio:SetFade(-1)

// We can get the fade back as a number using the GetFade() action.
number fade = audio:GetFade()

GetFocusListeners()

This action returns an Iterator containing all of the FocusListeners that have been added to this Item using the AddFocusListener action.

Return

Libraries.Containers.Iterator: An iterator containing all of the registered FocusListeners.

GetForce()

This action sets the X offset of the Item. The offset tells the Item where to relate its X position to. In other words, the X offset is where an X coordinate of 0 is for this Item. This is automatically set when using an action to add an Item to another Item.

Return

Libraries.Compute.Vector3:

Example

use Libraries.Interface.Item3D
Item3D myItem
myItem:SetOffsetX(100)

GetFriction()

GetZ will return the Z coordinate of this Item3D in 3D space. Note that if if this object has been added to an Item3D, then this coordinate is relative to the parent item - to get the non-relative Z coordinate, use the GetGlobalZ() action instead.

Return

number: The current z coordinate of this Item, relative to the parent Item (if there is one).

Example

use Libraries.Interface.Item3D

Item3D myItem
myItem:SetZ(50)
number z = myItem:GetZ()

GetGestureListeners()

This action returns an Iterator containing all of the GestureListeners that have been added to this Item using the AddGestureListener action.

Return

Libraries.Containers.Iterator: An iterator containing all of the registered GestureListeners.

GetGlobalPosition()

This action will return the global position of the Item3D as a Vector3. This is the item's position plus any offset applied by its relation to its parent (if it has one).

Return

Libraries.Compute.Vector3: A new Vector3 object containing the global coordinates of this Item (not relative to any parent).

Example

use Libraries.Interface.Item3D
use Libraries.Compute.Vector3
Item3D myItem
Item3D parentItem
parentItem:SetPosition(50, 40, 30)
myItem:SetPosition(25, 30, 45)
parentItem:Add(myItem)
Vector3 position = myItem:GetGlobalPosition()

GetGlobalX()

This action will return the global x coordinate of the Item3D. This is the item's position plus any offset applied by its relation to its parent (if it has one).

Return

number: The global X coordinate of this Item (not relative to any parent).

Example

use Libraries.Interface.Item3D
Item3D myItem
Item3D parentItem
parentItem:SetX(50)
myItem:SetX(25)
parentItem:Add(myItem)
number x = myItem:GetGlobalX()

GetGlobalY()

This action will return the global y coordinate of the Item3D. This is the item's position plus any offset applied by its relation to its parent (if it has one).

Return

number: The global Y coordinate of this Item (not relative to any parent).

Example

use Libraries.Interface.Item3D
Item3D myItem
Item3D parentItem
parentItem:SetY(50)
myItem:SetY(25)
parentItem:Add(myItem)
number y = myItem:GetGlobalY()

GetGlobalZ()

This action will return the global z coordinate of the Item3D. This is the item's position plus any offset applied by its relation to its parent (if it has one).

Return

number: The global Z coordinate of this Item (not relative to any parent).

Example

use Libraries.Interface.Item3D
Item3D myItem
Item3D parentItem
parentItem:SetZ(50)
myItem:SetZ(25)
parentItem:Add(myItem)
number z = myItem:GetGlobalZ()

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetHeight()

GetHeight will return the height of this Item3D.

Return

number: The height of this item.

Example

use Libraries.Interface.Item3D

Item3D myItem
myItem:SetHeight(50)
number height = myItem:GetHeight()

GetInputGroup()

This action returns the input group for this Item. When used with the Game libraries, this tag describes what InputTable (if any) can interact with this Item due to input.

Return

text: The input group tag being used by this Item.

Example

use Libraries.Interface.Item

Item item
item:SetInputGroup("arrowKeys")
output "My item's input group is : " + item:GetInputGroup()

GetInputTable()

GetInterpolatedAngularVelocity()

GetInterpolatedLinearVelocity()

GetInterpolationTransform()

This action adds a different Item3D into this one, storing the added Item3D at a specific index in the internal array.

Return

Libraries.Game.Collision.PhysicsPosition3D:

Example

use Libraries.Interface.Item3D

Item3D parentItem
Item3D child
parentItem:Add(0, child)

GetInterpolationWorldTransform()

GetInverseInertiaLocal()

GetInverseInertiaWorld()

GetHeight will return the height of this Item3D.

Return

Libraries.Compute.Matrix3: The height of this item.

Example

use Libraries.Interface.Item3D

Item3D myItem
myItem:SetHeight(50)
number height = myItem:GetHeight()

GetInverseMass()

GetDepth will return the depth of this Item3D.

Return

number: The depth of this item.

Example

use Libraries.Interface.Item3D

Item3D myItem
myItem:SetDepth(50)
number depth = myItem:GetDepth()

GetItem(integer index)

This action returns an Item3D that was previously added to this Item3D by finding it at the given index in the internal array of children Items.

Parameters

  • integer index: The index to retrieve from the children array.

Return

Libraries.Interface.Item3D: The child Item stored at the index.

Example

use Libraries.Interface.Item3D

Item3D parentItem
Item3D child1
Item3D child2
parentItem:Add(child1)
parentItem:Add(child2)
Item3D temp = parentItem:GetItem(0)

GetItemCount()

This action returns the number of items contained in this Item3D.

Return

integer: The number of children in this Item3D.

Example

use Libraries.Interface.Item3D

Item3D parentItem
Item3D child1
Item3D child2
parentItem:Add(child1)
parentItem:Add(child2)
integer size = parentItem:GetItemCount()

GetItems()

This action returns an iterator containing all the items contained in this Item3D.

Return

Libraries.Containers.Iterator: An iterator containing all children in this Item3D.

Example

use Libraries.Interface.Item3D
use Libraries.Containers.Iterator

Item3D parentItem
Item3D child1
Item3D child2
parentItem:Add(child1)
parentItem:Add(child2)
Iterator<Item3D> iterator = parentItem:GetItems()

GetJointList()

vector:Scale(1, 1, -1)

Return

Libraries.Game.Physics.Joints.JointEdge3D:

GetLayer()

This action returns the current Layer3D that this Item3D is a part of in the Game libraries.

Return

Libraries.Game.Layer3D: The current Layer3D that this Item3D is attached to (if any).

GetLights(Libraries.Containers.Array<Libraries.Game.Graphics.Light> array)

This action will find all of the Light objects contained in the children hierarchy of this Item3D and add it to the end of the given array. If this object is a Light, it will be added to the array first before adding any descendents where are Lights.

Parameters

Example

use Libraries.Interface.Item3D
use Libraries.Game.Graphics.PointLight
use Libraries.Game.Graphics.Light
use Libraries.Containers.Array

Item3D item
PointLight light1
PointLight light2
item:Add(light1)
item:Add(light2)
Array<Light> lightArray
item:GetLights(lightArray)

GetLights()

This action will return an array of all Light objects contained in the children hierarchy of this Item3D. If this object is a Light, it will also be included as the first item in the array.

Return

Libraries.Containers.Array: An array of all Lights stored in this Item3D.

Example

use Libraries.Interface.Item3D
use Libraries.Game.Graphics.PointLight
use Libraries.Game.Graphics.Light
use Libraries.Containers.Array

Item3D item
PointLight light1
PointLight light2
item:Add(light1)
item:Add(light2)
Array<Light> lightArray = item:GetLights()

GetLinearDamping()

GetWidth will return the width of this Item3D.

Return

number: The width of this item.

Example

use Libraries.Interface.Item3D

Item3D myItem
myItem:SetWidth(50)
number width = myItem:GetWidth()

GetLinearVelocity()

This action sets the offsets of the item. The offsets tell the Item where to relate its position to. In other words, the offsets determine where each coordinate of 0 is for this item. This is automatically set when using an action to add an Item to another Item.

Return

Libraries.Compute.Vector3:

Example

use Libraries.Interface.Item3D
use Libraries.Compute.Vector3
Item3D myItem
Vector3 vector
vector:Set(75, 40, 35)
myItem:SetOffset(vector)

GetLinearVelocityAtLocalPoint(Libraries.Compute.Vector3 relativePosition)

GetListenerDirection()

This action will get the direction that the listener is currently facing in.

Return

Libraries.Compute.Vector3:

Example



use Libraries.Sound.Audio
use Libraries.Compute.Vector3

// We load an audio object and set its position to 1 meter in front of the
// default listener position.
Audio audio
audio:Load("Chime.wav")
audio:SetPosition(0, 0, 1)

// Now we set the listener to face the right by calling SetListenerDirection.
// We can do this using any Audio object - it won't affect the result.
audio:SetListenerDirection(1, 0, 0)

// The audio is now located to the left of the listener's "ears", so when we
// play it, it should play through the left speaker.
audio:PlayUntilDone()

// Once we've set the direction of the listener, we can get back each
// of the values we've set it with using the GetListenerDirection actions.
// We can do this using any Audio object - it won't affect the result.
Vector3 direction = audio:GetListenerDirection()
output "The direction of the listener is " + direction:GetX() + ", " + direction:GetY() + ", " + direction:GetZ()

GetListenerDirectionX()

This action will get the x-component of the direction that the listener is currently facing in.

Return

number:

Example



use Libraries.Sound.Audio

// We load an audio object and set its position to 1 meter in front of the
// default listener position.
Audio audio
audio:Load("Chime.wav")
audio:SetPosition(0, 0, 1)

// Now we set the listener to face the right by calling SetListenerDirection.
// We can do this using any Audio object - it won't affect the result.
audio:SetListenerDirection(1, 0, 0)

// The audio is now located to the left of the listener's "ears", so when we
// play it, it should play through the left speaker.
audio:PlayUntilDone()

// Once we've set the direction of the listener, we can get back each
// of the values we've set it with using the GetListenerDirection actions.
// We can do this using any Audio object - it won't affect the result.
number x = audio:GetListenerDirectionX()
output "The direction of the listener on the x-axis is " + x

GetListenerDirectionY()

This action will get the y-component of the direction that the listener is currently facing in.

Return

number:

Example



use Libraries.Sound.Audio

// We load an audio object and set its position to 1 meter in front of the
// default listener position.
Audio audio
audio:Load("Chime.wav")
audio:SetPosition(0, 0, 1)

// Now we set the listener to face the right by calling SetListenerDirection.
// We can do this using any Audio object - it won't affect the result.
audio:SetListenerDirection(1, 0, 0)

// The audio is now located to the left of the listener's "ears", so when we
// play it, it should play through the left speaker.
audio:PlayUntilDone()

// Once we've set the direction of the listener, we can get back each
// of the values we've set it with using the GetListenerDirection actions.
// We can do this using any Audio object - it won't affect the result.
number y = audio:GetListenerDirectionY()
output "The direction of the listener on the y-axis is " + y

GetListenerDirectionZ()

This action will get the z-component of the direction that the listener is currently facing in.

Return

number:

Example



use Libraries.Sound.Audio

// We load an audio object and set its position to 1 meter in front of the
// default listener position.
Audio audio
audio:Load("Chime.wav")
audio:SetPosition(0, 0, 1)

// Now we set the listener to face the right by calling SetListenerDirection.
// We can do this using any Audio object - it won't affect the result.
audio:SetListenerDirection(1, 0, 0)

// The audio is now located to the left of the listener's "ears", so when we
// play it, it should play through the left speaker.
audio:PlayUntilDone()

// Once we've set the direction of the listener, we can get back each
// of the values we've set it with using the GetListenerDirection actions.
// We can do this using any Audio object - it won't affect the result.
number z = audio:GetListenerDirectionZ()
output "The direction of the listener on the z-axis is " + z

GetListenerPosition()

This action will return the current coordinates of the listener in virtual 3D space. The returned result will be stored in a new Vector3.

Return

Libraries.Compute.Vector3:

Example



use Libraries.Sound.Audio
use Libraries.Compute.Vector3

// In this example, we will use two audio objects. 
Audio buzzer
buzzer:Load("Buzzer.wav")
Audio bell
bell:Load("Bell.ogg")

// We will now set the listener's position. Although we can set all 3
// coordinates with this action, we will set just the x-coordinate for
// this example. This is the same as using SetListenerX(3)
Vector3 vector
vector:Set(3, 0, 0)
buzzer:SetListenerPosition(vector)

// Now when we play our audio, both sounds should come from the left
// side in 3D space - this is because both sounds are at their default
// location of 0, 0, 0, but the listener is 3 units to the right.
buzzer:PlayUntilDone()
bell:PlayUntilDone()

// We can get the listener's position back by using GetListenerPosition.
// It doesn't matter what Audio object we call this from - the result is the same.
Vector3 position = bell:GetListenerPosition()
output "Listener position is " + position:GetX() + ", " + position:GetY() + ", " + position:GetZ()

GetListenerUp()

This action will get the direction that the listener currently considers "up".

Return

Libraries.Compute.Vector3:

Example



use Libraries.Sound.Audio
use Libraries.Compute.Vector3

// We load an audio object and set its position to 1 meter above the
// default listener position.
Audio audio
audio:Load("Chime.wav")
audio:SetPosition(0, 1, 0)

// The listener's default direction is straight forward, with the "up" direction
// being along the positive y-axis. For this example, we'll set the "up"
// direction to be along the negative x-axis. This effectively means the
// listener is lying on their left side, with their left ear pointed towards the
// ground and their right ear pointed up towards the sky.
// We can do this using any Audio object - it won't affect the result.
audio:SetListenerUp(-1, 0, 0)

// Although the sound is located above the listener, since the listener has
// their right ear pointed upwards, the audio will play through the right speaker.
audio:PlayUntilDone()

// We can retrieve the direction the listener considers to be "up" at
// any time by using the GetListenerUp actions. Just like setting the
// "up", it doesn't matter which Audio object is used to retrieve it.
Vector3 up = audio:GetListenerUp()
output "The up direction of the audio along the x-axis is " + up:GetX() + ", " + up:GetY() + ", " + up:GetZ()

GetListenerUpX()

This action will get the x-component of the direction that the listener currently considers "up".

Return

number:

Example



use Libraries.Sound.Audio

// We load an audio object and set its position to 1 meter above the
// default listener position.
Audio audio
audio:Load("Chime.wav")
audio:SetPosition(0, 1, 0)

// The listener's default direction is straight forward, with the "up" direction
// being along the positive y-axis. For this example, we'll set the "up"
// direction to be along the negative x-axis. This effectively means the
// listener is lying on their left side, with their left ear pointed towards the
// ground and their right ear pointed up towards the sky.
// We can do this using any Audio object - it won't affect the result.
audio:SetListenerUp(-1, 0, 0)

// Although the sound is located above the listener, since the listener has
// their right ear pointed upwards, the audio will play through the right speaker.
audio:PlayUntilDone()

// We can retrieve the direction the listener considers to be "up" at
// any time by using the GetListenerUp actions. Just like setting the
// "up", it doesn't matter which Audio object is used to retrieve it.
number x = audio:GetListenerUpX()
output "The up direction of the audio along the x-axis is " + x

GetListenerUpY()

This action will get the y-component of the direction that the listener currently considers "up".

Return

number:

Example



use Libraries.Sound.Audio

// We load an audio object and set its position to 1 meter above the
// default listener position.
Audio audio
audio:Load("Chime.wav")
audio:SetPosition(0, 1, 0)

// The listener's default direction is straight forward, with the "up" direction
// being along the positive y-axis. For this example, we'll set the "up"
// direction to be along the negative x-axis. This effectively means the
// listener is lying on their left side, with their left ear pointed towards the
// ground and their right ear pointed up towards the sky.
// We can do this using any Audio object - it won't affect the result.
audio:SetListenerUp(-1, 0, 0)

// Although the sound is located above the listener, since the listener has
// their right ear pointed upwards, the audio will play through the right speaker.
audio:PlayUntilDone()

// We can retrieve the direction the listener considers to be "up" at
// any time by using the GetListenerUp actions. Just like setting the
// "up", it doesn't matter which Audio object is used to retrieve it.
number y = audio:GetListenerUpY()
output "The up direction of the audio along the y-axis is " + y

GetListenerUpZ()

This action will get the z-component of the direction that the listener currently considers "up".

Return

number:

Example



use Libraries.Sound.Audio

// We load an audio object and set its position to 1 meter above the
// default listener position.
Audio audio
audio:Load("Chime.wav")
audio:SetPosition(0, 1, 0)

// The listener's default direction is straight forward, with the "up" direction
// being along the positive y-axis. For this example, we'll set the "up"
// direction to be along the negative x-axis. This effectively means the
// listener is lying on their left side, with their left ear pointed towards the
// ground and their right ear pointed up towards the sky.
// We can do this using any Audio object - it won't affect the result.
audio:SetListenerUp(-1, 0, 0)

// Although the sound is located above the listener, since the listener has
// their right ear pointed upwards, the audio will play through the right speaker.
audio:PlayUntilDone()

// We can retrieve the direction the listener considers to be "up" at
// any time by using the GetListenerUp actions. Just like setting the
// "up", it doesn't matter which Audio object is used to retrieve it.
number z = audio:GetListenerUpZ()
output "The up direction of the audio along the z-axis is " + z

GetListenerVelocity()

This action will return the current velocity of the listener in virtual 3D space. The returned result will be stored in a new Vector3.

Return

Libraries.Compute.Vector3:

Example



use Libraries.Sound.Audio
use Libraries.Compute.Vector3

Audio flute
flute:Load("Flute.ogg")

Vector3 vector
vector:Set(15, 8, 11)

// The listener is given a velocity of 15 meters per second along the
// x-axis, 8 meters per second along the y-axis, and 11 meters-per-second
// along the z-axis.
flute:SetListenerVelocity(vector)

// We can now retrieve the velocity of the listener by using
// GetListenerVelocity. It doesn't matter what Audio object we
// call this from - the result is the same.
Vector3 velocity = flute:GetListenerVelocity()
output "The listener's velocity is " + velocity:GetX() + ", " + velocity:GetY() + ", " + velocity:GetZ()

GetListenerVelocityX()

This action will return the current x velocity of the listener in virtual 3D space.

Return

number:

Example



use Libraries.Sound.Audio

Audio flute
flute:Load("Flute.ogg")

// The listener is given a velocity of 15 meters per second along the
// x-axis.
flute:SetListenerVelocityX(15)

// We can now retrieve the velocity of the listener along the x-axis by
// using GetListenerVelocityX. It doesn't matter what Audio object we
// call this from - the result is the same.
number x = flute:GetListenerVelocityX()
output "The listener's x velocity is " + x

GetListenerVelocityY()

This action will return the current y velocity of the listener in virtual 3D space.

Return

number:

Example



use Libraries.Sound.Audio

Audio flute
flute:Load("Flute.ogg")

// The listener is given a velocity of 8 meters per second along the
// y-axis.
flute:SetListenerVelocityY(8)

// We can now retrieve t