Libraries.Game.Graphics.PointLight Documentation

Inherits from: Libraries.Game.Graphics.Light, Libraries.Interface.Item3D, Libraries.Interface.Item, Libraries.Language.Object

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)

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)

Copy()

This action will create a copy of this PointLight that has the same color, position, intensity, and offsets as this light.

Return

Libraries.Game.Graphics.PointLight:

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

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.

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)

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

GetColor()

This action will return the current color of this light.

Return

Libraries.Game.Graphics.Color:

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

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

GetIntensity()

This action returns the intensity of this light. The intensity is a measure of the brightness of the light.

Return

number:

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)

GetMass()

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

Return

number:

Example

use Libraries.Interface.Item3D

Item3D myItem
myItem:SetX(50)
myItem:MoveX(25)

GetMouseListeners()

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

Return

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

GetMouseMovementListeners()

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

Return

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

GetMouseWheelListeners()

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

Return

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

GetName()

This action returns the current internal name of the Item.

Return

text:

Example

use Libraries.Interface.Item

Item item
item:SetName("My Item")
output "My item's name is " + item:GetName()

GetNextFocus()

This action returns the next focus item. When this Item has the focus and the user requests the focus to advance (e.g. by pressing the tab key), the returned value is the next item to receive that focus, if it is defined. If it isn't defined, the focus can not advance from this Item.

Return

Libraries.Interface.Item: The next Item to receive focus after this one.

GetNode(integer index)

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

Parameters

  • integer index

Return

Libraries.Game.Collision.Item3DNode: 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()

GetNodeCount()

This action returns whether or not any items are contained in this Item.

Return

integer: Whether or not this item contains any children.

Example

use Libraries.Interface.Item3D

Item3D parentItem
Item3D child1
parentItem:Add(child1)
boolean wasEmpty = parentItem:IsEmpty()

GetNodes()

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

Return

Libraries.Containers.Array: 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()

GetOffsetX()

This action returns 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

number: The current X offset.

Example

use Libraries.Interface.Item3D
Item3D myItem
myItem:SetOffsetX(100)
number offset = myItem:GetOffsetX()

GetOffsetY()

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

Return

number: The current Y offset.

Example

use Libraries.Interface.Item3D
Item3D myItem
myItem:SetOffsetY(75)
number offset = myItem:GetOffsetY()

GetOffsetZ()

This action returns 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

number: The current Z offset.

Example

use Libraries.Interface.Item3D
Item3D myItem
myItem:SetOffsetZ(75)
number offset = myItem:GetOffsetZ()

GetOrientation()

GetParent()

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.Item3D: The parent Item.

Example

use Libraries.Interface.Item3D

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

GetPhysicsProperties()

GetPitch()

This action will rotate this Item3D clockwise about an axis passing through the given point. The direction of the axis is represented by the given Vector3 object. The last parameter is a boolean that determines whether or not children should also be rotated - a value of true will rotate the children, a value of false will not. Note that the children will still maintain relative position to this item, regardless of the boolean passed.

Return

number:

Example

use Libraries.Interface.Item3D
use Libraries.Compute.Vector3
Item3D parentItem
Item3D child1
Item3D child2

parentItem:Add(child1)
parentItem:Add(child2)

// We will rotate about the point 0, 0, 0 for this example.
Vector3 point
point:Set(0, 0, 0)

Vector3 axis

// This will rotate the item and its children 90 degrees clockwise around a ray passing 
// through the given point and pointing to the right.
axis:Set(1, 0, 0)
myItem:RotateAround(point, axis, 90, true)

// This will rotate the item and its children 45 degrees clockwise around a ray passing 
// through the given point and pointing straight down.
axis:Set(0, -1, 0, 45)
myItem:RotateAround(point, axis, 45, true)

// This will rotate the item (but not its children) 60 degrees counter-clockwise around a ray  
// passing through the given point and pointing to the right.
axis:Set(1, 0, 0)
myItem:RotateAround(point, axis, -60, false)

// When setting the ray with multiple non-zero values, each value is
// relative to each other. Since this vector is set with a larger x
// value than y value, this ray points mostly left and a little upwards.
axis:Set(3, 1, 0)
myItem:RotateAround(point, axis, 45, true)

// Because the values are relative to each other, this code has the same
// effect as the last Rotate call we used (because the x value is still
// 3 times larger than the y value).
axis:Set(9, 3, 0)
myItem:RotateAround(point, axis, 45, true)

GetPosition()

GetPosition will return a Vector3 object containing the X, Y, and Z coordinates of this Item3D object. Note that if this object has been added to an Item3D, then this coordinate is relative to the parent item - to get the non-relative coordinates, use the GetGlobalPosition() action instead.

Return

Libraries.Compute.Vector3: A new Vector3 object containing the x, y, and z coordinates of this Item, relative to the parent Item (if there is one).

Example

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

Item3D myItem
myItem:SetX(50)
Vector3 vector = myItem:GetPosition()

GetPreviousFocus()

This action returns the previous focus item. When this Item has the focus and the user requests the focus to move backwards (e.g. by pressing shift & tab), the returned value is the previous item to receive that focus, if it is defined. If it isn't defined, the focus can not move backwards from this Item.

Return

Libraries.Interface.Item: The previous Item to receive focus before this one.

GetPropertiesSize()

Return

integer

GetProperty(text key)

GetPropertyKeyIterator()

GetPushVelocity()

GetResponsiveness()

This action sets the height of the Item.

Return

integer:

Example

use Libraries.Interface.Item3D
Item3D myItem
myItem:SetHeight(210.0)

GetRestitution()

GetX will return the X 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 X coordinate, use the GetGlobalX() action instead.

Return

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

Example

use Libraries.Interface.Item3D

Item3D myItem
myItem:SetX(50)
number x = myItem:GetX()

GetRoll()

This action will rotate this Item3D clockwise about an axis passing through the given point. The direction of the axis is represented by the given Vector3 object. The children of this Item3D will also be rotated.

Return

number:

Example

use Libraries.Interface.Item3D
use Libraries.Compute.Vector3
Item3D parentItem
Item3D child1
Item3D child2

parentItem:Add(child1)
parentItem:Add(child2)

// We will rotate about the point 0, 0, 0 for this example.
Vector3 point
point:Set(0, 0, 0)

Vector3 axis

// This will rotate the item and its children 90 degrees clockwise around a ray passing 
// through the given point and pointing to the right.
axis:Set(1, 0, 0)
myItem:RotateAround(point, axis, 90)

// This will rotate the item and its children 45 degrees clockwise around a ray passing 
// through the given point and pointing straight down.
axis:Set(0, -1, 0, 45)
myItem:RotateAround(point, axis, 45)

// This will rotate the item and its children 60 degrees counter-clockwise around a ray  
// passing through the given point and pointing to the right.
axis:Set(1, 0, 0)
myItem:RotateAround(point, axis, -60)

// When setting the ray with multiple non-zero values, each value is
// relative to each other. Since this vector is set with a larger x
// value than y value, this ray points mostly left and a little upwards.
axis:Set(3, 1, 0)
myItem:RotateAround(point, axis, 45)

// Because the values are relative to each other, this code has the same
// effect as the last Rotate call we used (because the x value is still
// 3 times larger than the y value).
axis:Set(9, 3, 0)
myItem:RotateAround(point, axis, 45)

GetRotationTransform()

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.Compute.Matrix4: 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()

GetScaleX()

This action will scale the Item3D by values of the given Vector3. If the boolean parameter is set to true, and if the Item3D has any children items, they will also be scaled, and their offsets will be adjusted to maintain the same relative position to this item. If the boolean parameter is set to false, only this Item will be scaled.

Return

number:

Example

use Libraries.Interface.Item3D
use Libraries.Compute.Vector3
Item3D myItem
Vector3 vector
vector:Set(5, 2, 1)
myItem:Scale(vector, false)

GetScaleY()

This action will rotate all of the children of this Item3D clockwise about an axis passing through this item. The direction of the axis is represented by the given Vector3, and the children will be rotated by the given number of degrees.

Return

number:

Example

use Libraries.Interface.Item3D
use Libraries.Compute.Vector3
Item3D parentItem
Item3D child1
Item3D child2

parentItem:Add(child1)
parentItem:Add(child2)

Vector3 axis

// This will rotate the item's children 90 degrees clockwise around a ray passing 
// through the item's center and pointing to the right.
axis:Set(1, 0, 0)
myItem:RotateChildren(axis, 90)

// This will rotate the item's children 45 degrees clockwise around a ray passing 
// through the item's center and pointing straight down.
axis:Set(0, -1, 0)
myItem:RotateChildren(axis, 45)

// This will rotate the item's children 60 degrees counter-clockwise around a ray  
// passing through the item's center and pointing to the right.
axis:Set(1, 0, 0)
myItem:RotateChildren(axis, -60)

// When setting the ray with multiple non-zero values, each value is
// relative to each other. Since this vector is set with a larger x
// value than y value, this ray points mostly left and a little upwards.
axis:Set(3, 1, 0)
myItem:Rotate(axis, 45)

// Because the values are relative to each other, this code has the same
// effect as the last Rotate call we used (because the x value is still
// 3 times larger than the y value).
axis:Set(9, 3, 0)
myItem:RotateChildren(axis, 45)

GetScaleZ()

This action will rotate the Item3D about an axis represented by the given Vector3. The item will be rotated by an angle given in degrees. If the boolean parameter is set to true, and if the Item3D has any children items, they will also be rotated, and their offsets will be adjusted to maintain the same relative position to this item. If the boolean parameter is set to false, only this Item will be rotated.

Return

number:

Example

use Libraries.Interface.Item3D
use Libraries.Compute.Vector3
Item3D myItem
Vector3 vector
vector:Set(5, 2, 1)
myItem:Rotate(vector, 90, false)

GetScreenBounds()

This action returns a 2D rectangle describing the approximate bounds of this Item3D on the screen. The rectangle isn't rotated (i.e. the rectangle's edges are aligned with the screen's edges), so the rectangle may be significantly larger than the space taken by the Item3D on the screen in some cases.

Return

Libraries.Game.Shapes.Rectangle:

GetScreenX()

This action returns the x coordinate of the Item on the screen. If the Item hasn't been attached to a Layer, this will return a "Not a Number" value instead.

Return

number:

GetScreenY()

This action returns the y coordinate of the Item on the screen. If the Item hasn't been attached to a Layer, this will return a "Not a Number" value instead.

Return

number:

GetShape()

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.Game.Collision.Shapes.CollisionShape3D: 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()

GetShapeType()

This action is used by the Game libraries to create a reference to the layer that this Item3D exists on. It is automatically called as needed by the Layer3D class. Most users will never need to use this action directly.

Return

integer:

GetSleepTime()

Return

number

GetTimeOfImpact()

transform:Set(matrix)

Return

number:

GetTorque()

This action