Libraries.Game.Graphics.Model Documentation

The Model class represents a 3D model to be drawn on the screen by the Game engine. The Model can load data from .obj, .g3db, or .g3dj files, or can be set to some primitive shapes (such as boxes or cylinders).

Example Code

use Libraries.Game.Game
use Libraries.Game.Graphics.Model
use Libraries.Game.Graphics.Color

class Main is Game

    Model cube

    action Main
        StartGame()
    end

    action CreateGame
        Color cyan
        cyan:SetColor(0, 0.75, 1, 1)
        
        cube:LoadBox(2, 2, 2, cyan)
        Add(cube)
    end

    action Update(number seconds)
        cube:Rotate(0, 1, 0, 45 * seconds)
    end
end

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

Summary

Actions Summary Table

ActionsDescription
Add(Libraries.Interface.Item3D newItem)This action adds a different Item3D into this one.
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.
AddBehavior(Libraries.Interface.Behaviors.Behavior behavior)This action adds a new Behavior to this Item.
AddFocusListener(Libraries.Interface.Events.FocusListener listener)This action adds a FocusListener to the Item.
AddMouseListener(Libraries.Interface.Events.MouseListener listener)This action adds a MouseListener to the Item.
AddMouseMovementListener(Libraries.Interface.Events.MouseMovementListener listener)This action adds a MouseMovementListener to the Item.
AddMouseWheelListener(Libraries.Interface.Events.MouseWheelListener listener)This action adds a MouseWheelListener to the Item.
AddTouchListener(Libraries.Interface.Events.TouchListener listener)This action adds a TouchListener to the Item.
ApplyAngularImpulse(Libraries.Compute.Vector3 impulse)
ApplyDamping(number seconds)
ApplyForce(Libraries.Compute.Vector3 force, Libraries.Compute.Vector3 point)
ApplyForceToCenter(Libraries.Compute.Vector3 force)
ApplyLinearImpulse(Libraries.Compute.Vector3 impulse, Libraries.Compute.Vector3 point)
ApplyTorque(Libraries.Compute.Vector3 torque)
BeginCollision(Libraries.Interface.Item item)This action is used to indicate that two items have just begun colliding.
CalculateBoundingBox()CalculateBoundingBox will create a new BoundingBox object that contains the bounds of the Model.
CalculateBoundingBox(Libraries.Game.BoundingBox box)CalculateBoundingBox will compute the bounds of this Model, and then store them inside the provided BoundingBox object.
CanRotate(boolean flag)
CancelBehaviors()This action stops all behaviors this Item is following without finishing them.
CollideWithChildren()
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns a CompareResult.
ComputeAngularImpulseDenominator(Libraries.Compute.Vector3 axis)
ComputeImpulseDenominator(Libraries.Compute.Vector3 position, Libraries.Compute.Vector3 normal)
CreateNodes(Libraries.Game.Collision.BroadphaseCollision3D broadphase, Libraries.Game.Collision.PhysicsPosition3D transform)transform:Translate(vector:GetX(), vector:GetY(), vector:GetZ() * -
DestroyNodes(Libraries.Game.Collision.BroadphaseCollision3D broadphase)transform:Translate(0, 0, -zAmoun
Dispose()This action is used to free up any additional memory that is being used by this Item for purposes such as graphics.
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.
Draw(Libraries.Game.Graphics.Painter3D painter)The Draw action is what makes a Model appear on the screen.
Empty()This action will remove all Items from this Item's children hierarchy.
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.
EnablePhysics(boolean flag)
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
ExtendBoundingBox(Libraries.Game.BoundingBox box)ExtendBoundingBox will expand the bounds of the given BoundingBox to fully encapsulate the bounds of this Model.
FastMoving(boolean flag)
FinishCollision(Libraries.Interface.Item item)This action is used to indicate that two items that were previously colliding no longer are.
Focus()This action sets focus on this Item.
GainedFocus(Libraries.Interface.Events.FocusEvent event)This action is fired if the item received the focus.
GetAccessibilityCode()This action returns the current accessiblity code for this Item
GetAccessibilityType()This action returns the name of the accessiblity code for this Item as Text
GetAngularDamping()
GetAngularFactor()
GetAngularVelocity()
GetAnimations()This action returns an array containing all Animation objects used by this Model.
GetBlueprintKey()This action will return the identifier for the ModelBlueprint that this model was loaded from.
GetBoundingBox(integer childIndex)Item3D child = undefin
GetCenterOfMassPosition()
GetCenterOfMassTransform()
GetCollisionGroupFlag()
GetCollisionGroupIndex()
GetCollisionList()
GetCollisionTransform()
GetCollisionTransform0()
GetDepth()GetDepth will return the depth of this Item3D.
GetDescription()This action returns the current internal description of the Item.
GetDimensions()GetDimensions will return a Vector3 object containing the width, height, and depth of this Item3D object.
GetFocusListeners()This action returns an Iterator containing all of the FocusListeners that have been added to this Item using the AddFocusListener action.
GetForce()
GetFriction()
GetGlobalPosition()This action will return the global position of the Item3D as a Vector3.
GetGlobalX()This action will return the global x coordinate of the Item3D.
GetGlobalY()This action will return the global y coordinate of the Item3D.
GetGlobalZ()This action will return the global z coordinate of the Item3D.
GetHashCode()This action gets the hash code for an object.
GetHeight()GetHeight will return the height of this Item3D.
GetInputGroup()This action returns the input group for this Item.
GetInputTable()
GetInterpolatedAngularVelocity()
GetInterpolatedLinearVelocity()
GetInterpolationTransform()
GetInterpolationWorldTransform()
GetInverseInertiaLocal()
GetInverseInertiaWorld()
GetInverseMass()
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.
GetItemCount()This action returns the number of items contained in this Item3D.
GetItems()This action returns an iterator containing all the items contained in this Item3D.
GetJointList()
GetLayer()This action returns the current Layer3D that this Item3D is a part of in the Game libraries.
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.
GetLights()This action will return an array of all Light objects contained in the children hierarchy of this Item3D.
GetLinearDamping()
GetLinearVelocity()
GetLinearVelocityAtLocalPoint(Libraries.Compute.Vector3 relativePosition)
GetMass()
GetMaterials()This action returns an array containing all Material objects used by this Model.
GetModelBlueprint()This action will return the ModelBlueprint that this model was loaded from.
GetMouseListeners()This action returns an Iterator containing all of the MouseListeners that have been added to this Item using the AddMouseListener action.
GetMouseMovementListeners()This action returns an Iterator containing all of the MouseMovementListeners that have been added to this Item using the AddMouseMovementListener action.
GetMouseWheelListeners()This action returns an Iterator containing all of the MouseWheelListeners that have been added to this Item using the AddMouseWheelListener action.
GetName()This action returns the current internal name of the Item.
GetNextFocus()This action returns the next focus item.
GetNode(integer index)
GetNodeCount()transform:Translate(xAmount, yAmount, -zAmoun
GetNodes()This action returns an array containing all Node objects used by this Model.
GetOffsetX()This action returns the X offset of the Item.
GetOffsetY()This action returns the Y offset of the item.
GetOffsetZ()This action returns the Z offset of the item.
GetOrientation()
GetParent()This action returns the parent of this Item3D.
GetPhysicsProperties()
GetPosition()GetPosition will return a Vector3 object containing the X, Y, and Z coordinates of this Item3D object.
GetPreviousFocus()This action returns the previous focus item.
GetPushVelocity()
GetRenderables(Libraries.Containers.Array<Libraries.Game.Graphics.Renderable> renderables)GetRenderables is used to retrieve all of the individual renderable components of this Model.
GetResponsiveness()
GetRestitution()
GetShape()vector3:Normalize
GetShapeType()Vector3 localOffset = child:GetGlobalPosition
GetSleepTime()
GetTimeOfImpact()Source: http://answers.
GetTorque()
GetTouchListeners()This action returns an Iterator containing all of the TouchListeners that have been added to this Item using the AddTouchListener action.
GetTransform()This action will return the Matrix4 containing the transformations applied to the Item3D, including its global position, rotation, and scaling.
GetTurnVelocity()
GetWidth()GetWidth will return the width of this Item3D.
GetX()GetX will return the X coordinate of this Item3D in 3D space.
GetY()GetY will return the Y coordinate of this Item3D in 3D space.
GetZ()GetZ will return the Z coordinate of this Item3D in 3D space.
HasMoved()
Hide()This action is used to indicate that an Item and all Items that were added to it should not be visible on the screen.
IntegrateVelocities(number seconds)
InternalApplyImpulse(Libraries.Compute.Vector3 linearComponent, Libraries.Compute.Vector3 angularComponent, number impulseMagnitude)
IsCollidable()
IsEmpty()This action returns whether or not any items are contained in this Item.
IsFastMoving()
IsFocusable()This action returns whether or not the Item can currently receive focus.
IsFocused()The IsFocused action determines if this Item is currently focused, returning true if it is, or false if it is not.
IsNonResponsive()
IsPhysicsEnabled()
IsResponsive()
IsRotationAllowed()
IsShowing()This action returns whether the Item is currently set to be visible on the screen.
IsSimulated()
IsSimulationRequired()
IsUnmovable()
Load(Libraries.Game.Graphics.ModelBlueprint loader, Libraries.Compute.Matrix4 matrix)This action will load this Model using the data contained in the given ModelBlueprint, and set its transform using the given Matrix4 (if it is defined).
Load(text fileName)This action will load the Model file with the given file name from the default file directory.
Load(Libraries.Game.Graphics.ModelBlueprint loader)This action will load this Model using the data contained in the given ModelBlueprint.
Load(Libraries.System.File file)This action will load a model from a given model file.
LoadBox(number width, number height, number depth, Libraries.Game.Graphics.Color color)This action will load the Model with a box with the given width, height, depth, and color.
LoadBox(number width, number height, number depth, text textureFile)This action will load the Model with a box with the given width, height, and depth.
LoadBox(number width, number height, number depth, Libraries.Game.Graphics.Drawable drawable)This action will load the Model with a box with the given width, height, and depth.
LoadBox(number width, number height, number depth, Libraries.System.File textureFile)This action will load the Model with a box with the given width, height, and depth.
LoadBox(number width, number height, number depth, Libraries.Game.Graphics.Texture texture)This action will load the Model with a box with the given width, height, depth, and texture.
LoadCylinder(number width, number height, number depth, Libraries.Game.Graphics.Drawable drawable)This action will load the Model with a cylinder with the given dimensions, using the texture contained in the given (loaded) Drawable.
LoadCylinder(number width, number height, number depth, text textureFile)This action will load the Model with a cylinder with the given dimensions and texture.
LoadCylinder(number width, number height, number depth, Libraries.Game.Graphics.Color color)This action will load the Model with a cylinder with the given width, height, depth, and color.
LoadCylinder(number width, number height, number depth, integer divisions, Libraries.Game.Graphics.Drawable drawable)This action will load the Model with a cylinder with the given dimensions and using the texture contained in the provided Drawable.
LoadCylinder(number width, number height, number depth, integer divisions, Libraries.System.File textureFile)This action will load the Model with a cylinder with the given dimensions and texture.
LoadCylinder(number width, number height, number depth, Libraries.System.File textureFile)This action will load the Model with a cylinder with the given dimensions and texture.
LoadCylinder(number width, number height, number depth, integer divisions, Libraries.Game.Graphics.Texture texture)This action will load the Model with a cylinder with the given dimensions and texture.
LoadCylinder(number width, number height, number depth, Libraries.Game.Graphics.Texture texture)This action will load the Model with a cylinder with the given dimensions and texture.
LoadCylinder(number width, number height, number depth, integer divisions, Libraries.Game.Graphics.Color color)This action will load the Model with a cylinder with the given dimensions and color.
LoadCylinder(number width, number height, number depth, integer divisions, text textureFile)This action will load the Model with a cylinder with the given dimensions and texture.
LoadSphere(number width, number height, number depth, integer horizontalDivisions, integer verticalDivisions, text textureFile)This action will load the Model with a sphere with the given dimensions and texture.
LoadSphere(number width, number height, number depth, integer horizontalDivisions, integer verticalDivisions, Libraries.System.File textureFile)This action will load the Model with a sphere with the given dimensions and texture.
LoadSphere(number width, number height, number depth, Libraries.Game.Graphics.Color color)This action will load the Model with a sphere with the given width, height, depth, and color.
LoadSphere(number width, number height, number depth, integer horizontalDivisions, integer verticalDivisions, Libraries.Game.Graphics.Color color)This action will load the Model with a sphere with the given dimensions and color.
LoadSphere(number width, number height, number depth, Libraries.System.File textureFile)This action will load the Model with a sphere with the given dimensions and texture.
LoadSphere(number width, number height, number depth, integer horizontalDivisions, integer verticalDivisions, Libraries.Game.Graphics.Texture texture)This action will load the Model with a sphere with the given dimensions and texture.
LoadSphere(number width, number height, number depth, integer horizontalDivisions, integer verticalDivisions, Libraries.Game.Graphics.Drawable drawable)This action will load the Model with a sphere with the given dimensions and using the texture contained in the provided Drawable.
LoadSphere(number width, number height, number depth, Libraries.Game.Graphics.Texture texture)This action will load the Model with a sphere with the given dimensions and texture.
LoadSphere(number width, number height, number depth, Libraries.Game.Graphics.Drawable drawable)This action will load the Model with a sphere with the given dimensions, using the texture contained in the given (loaded) Drawable.
LoadSphere(number width, number height, number depth, text textureFile)This action will load the Model with a sphere with the given dimensions and texture.
LostFocus(Libraries.Interface.Events.FocusEvent event)This action is fired if the item lost the focus.
Move(Libraries.Compute.Vector3 vector)This action will increase the x, y, and z coordinates of this Item by the values inside the given Vector3.
Move(number xAmount, number yAmount, number zAmount)This action will increase the x, y, and z coordinates of this Item by the given amounts.
MoveX(number xAmount)This action will increase the x-coordinate of this Item by the given amount.
MoveY(number yAmount)This action will increase the y-coordinate of this Item by the given amount.
MoveZ(number zAmount)This action will increase the z-coordinate of this Item by the given amount.
PredictIntegratedTransform(number seconds, Libraries.Game.Collision.PhysicsPosition3D predictedTransform)
ProceedToTransform(Libraries.Game.Collision.PhysicsPosition3D transform)
ProcessMouseEvent(Libraries.Interface.Events.MouseEvent event)This action takes a MouseEvent and distributes it to any MouseListeners, MouseMovementListeners, and MouseWheelListeners that have been added to this Item3D.
ProcessTouchEvent(Libraries.Interface.Events.TouchEvent event)This action will take a TouchEvent and distribute it to any TouchListeners that have been added to this Item3D.
Remove(integer index)This action removes an Item that was previously added to this Item by finding it at the given index in the internal array of children Items.
Remove(Libraries.Interface.Item3D removed)This action removes an Item3D that was previously added to this Item3D.
RemoveFocusListener(Libraries.Interface.Events.FocusListener listener)This action removes a FocusListener from the Item.
RemoveMouseListener(Libraries.Interface.Events.MouseListener listener)This action removes a MouseListener from the Item.
RemoveMouseMovementListener(Libraries.Interface.Events.MouseMovementListener listener)This action removes a MouseMovementListener from the Item.
RemoveMouseWheelListener(Libraries.Interface.Events.MouseWheelListener listener)This action removes a MouseWheelListener from the Item.
RemoveTouchListener(Libraries.Interface.Events.TouchListener listener)This action removes a TouchListener from the Item.
RequireSimulation(boolean flag)
ResetMass()
Rotate(Libraries.Compute.Vector3 vector, number degrees, boolean rotateChildren)This action will rotate the Item3D about an axis represented by the given Vector3.
Rotate(Libraries.Compute.Vector3 vector, number degrees)This action will rotate the Item3D about an axis represented by the given Vector3.
Rotate(number rotateX, number rotateY, number rotateZ, number degrees)This action will rotate the Item3D about an axis.
Rotate(number rotateX, number rotateY, number rotateZ, number degrees, boolean rotateChildren)This action will rotate the Item3D about an axis represented by the first 3 given number values.
RotateAround(Libraries.Compute.Vector3 point, Libraries.Compute.Vector3 axis, number degrees)This action will rotate this Item3D clockwise about an axis passing through the given point.
RotateAround(Libraries.Compute.Vector3 point, Libraries.Compute.Vector3 axis, number degrees, boolean rotateChildren)This action will rotate this Item3D clockwise about an axis passing through the given point.
RotateChildren(number rotateX, number rotateY, number rotateZ, number degrees)This action will rotate all of the children of this Item3D clockwise about an axis passing through this item.
RotateChildren(Libraries.Compute.Vector3 vector, number degrees)This action will rotate all of the children of this Item3D clockwise about an axis passing through this item.
SaveKinematicState(number time)
Scale(Libraries.Compute.Vector3 vector)This action will scale the Item3D by the values of the given Vector3.
Scale(Libraries.Compute.Vector3 vector, boolean scaleChildren)This action will scale the Item3D by values of the given Vector3.
Scale(number scaleX, number scaleY, number scaleZ, boolean scaleChildren)This action will scale the Item3D by the given values.
Scale(number scaleX, number scaleY, number scaleZ)This action will scale the Item3D by the given values.
SetAccessibilityCode(integer newAccessibilityCode)This action changes the accessibility code for this Item.
SetAngularDamping(number angularDamping)
SetAngularVelocity(Libraries.Compute.Vector3 angularVelocity)
SetCenterOfMassTransform(Libraries.Game.Collision.PhysicsPosition3D transform)
SetCollidable(boolean flag)
SetCollideWithChildren(boolean flag)
SetCollisionGroupFlag(boolean flag)
SetCollisionGroupIndex(integer index)
SetCollisionList(Libraries.Game.Collision.CollisionEdge3D list)
SetCollisionTransform(Libraries.Game.Collision.PhysicsPosition3D transform)
SetCollisionTransform0(Libraries.Game.Collision.PhysicsPosition3D transform)
SetDepth(number setDepth)This action sets the depth the Item.
SetDescription(text newDescription)This action sets the internal description of the Item.
SetDimensions(number setWidth, number setHeight, number setDepth)This action sets the width, height, and depth of the Item3D.
SetDimensions(Libraries.Compute.Vector3 vector)This action sets the width, height, and depth of the Item3D.
SetFocusable(boolean focus)The SetFocusable action sets whether or not this Item should be focusable.
SetForce(Libraries.Compute.Vector3 force)
SetFriction(number friction)
SetHasMoved(boolean flag)
SetHeight(number setHeight)This action sets the height of the Item.
SetInputGroup(text group)This action sets the input group for this Item.
SetInterpolatedAngularVelocity(Libraries.Compute.Vector3 velocity)
SetInterpolatedLinearVelocity(Libraries.Compute.Vector3 velocity)
SetInterpolationTransform(Libraries.Game.Collision.PhysicsPosition3D transform)
SetItem(integer index, Libraries.Interface.Item3D newItem)This action sets a value inside the internal item array of this Item3D.
SetJointList(Libraries.Game.Physics.Joints.JointEdge3D list)
SetLayer(Libraries.Game.Layer3D parentLayer)This action is used by the Game libraries to create a reference to the layer that this Item3D exists on.
SetLinearDamping(number linearDamping)
SetLinearVelocity(Libraries.Compute.Vector3 linearVelocity)
SetLinearVelocityX(number linearVelocityX)
SetLinearVelocityY(number linearVelocityY)
SetLinearVelocityZ(number linearVelocityZ)
SetMass(number mass)
SetName(text newName)This action sets the internal name of the Item.
SetNextFocus(Libraries.Interface.Item next)This action sets the next focus item.
SetNonResponsive()
SetOffset(Libraries.Compute.Vector3 vector)This action sets the offsets of the item.
SetOffset(number xAmount, number yAmount, number zAmount)This action sets the offsets of the item.
SetOffsetX(number xAmount)This action sets the X offset of the Item.
SetOffsetY(number yAmount)This action sets the Y offset of the item.
SetOffsetZ(number zAmount)This action sets the Z offset of the item.
SetParent(Libraries.Interface.Item3D newItem)This action sets a reference to the parent item.
SetPhysicsProperties(Libraries.Game.Physics.PhysicsProperties3D properties)
SetPosition(Libraries.Compute.Vector3 vector)This action sets the x, y, and z coordinates of the Item3D.
SetPosition(number setX, number setY, number setZ)This action sets the x, y, and z coordinates of the Item3D.
SetPreviousFocus(Libraries.Interface.Item previous)This action sets the previous focus item.
SetResponsive()
SetResponsiveness(integer type)
SetRestitution(number restitution)
SetScreenPositionFromPhysicsPosition()
SetShape(Libraries.Game.Collision.Shapes.CollisionShape3D shape)We store the offsets we'll be using before manipulating anything.
SetSleepTime(number time)
SetTimeOfImpact(number timeOfImpact)
SetTorque(Libraries.Compute.Vector3 torque)
SetUnmovable()
SetWidth(number setWidth)This action sets the width of the Item.
SetX(number setX)This action sets the X coordinate of the Item.
SetY(number setY)This action sets the Y coordinate of the Item.
SetZ(number setZ)This action sets the Z coordinate of the Item.
ShouldCollide(Libraries.Interface.Item3D otherItem)
Show()This action is used to indicate that an Item and all Items that were added to it should be visible on the screen.
Simulate(boolean flag)
SynchronizeNodes()transform:Scale(vecto
Update(number secondsSinceUpdate)This action updates the item.
UpdateAll(number secondsSinceUpdate)This action calls the Update action on this Item and all Items that have been added to this item with the Add action.
UpdateInertia()

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.

Example Code

use Libraries.Interface.Item3D

        Item3D parentItem
        Item3D child
        parentItem:Add(child)

Parameters

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.

Example Code

use Libraries.Interface.Item3D

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

Parameters

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.

Example Code

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

Parameters

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.

Example Code

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

Parameters

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.

Example Code

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

Parameters

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.

Example Code

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

Parameters

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.

Example Code

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

Parameters

ApplyAngularImpulse(Libraries.Compute.Vector3 impulse)

Parameters

ApplyDamping(number seconds)

Parameters

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

Parameters

ApplyForceToCenter(Libraries.Compute.Vector3 force)

Parameters

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

Parameters

ApplyTorque(Libraries.Compute.Vector3 torque)

Parameters

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.

Example Code

use Libraries.Interface.Item

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

Parameters

CalculateBoundingBox()

CalculateBoundingBox will create a new BoundingBox object that contains the bounds of the Model.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Color
    use Libraries.Game.BoundingBox

    class Main is Game

        Model cube
        
        action Main
            StartGame()
        end

        action CreateGame
            Color mint
            mint:SetColor(0.5, 1, 0.75, 1)

            cube:LoadBox(2, 2, 2, mint)
            Add(cube)

            BoundingBox box = cube:CalculateBoundingBox()
            output "The dimensions of the bounding box are: " + box:GetWidth() + ", " + box:GetHeight() + ", " + box:GetDepth()
        end
    end

Return

Libraries.Game.BoundingBox: A new axis-aligned BoundingBox for this Model.

CalculateBoundingBox(Libraries.Game.BoundingBox box)

CalculateBoundingBox will compute the bounds of this Model, and then store them inside the provided BoundingBox object. If any data was previously stored in this BoundingBox, it will be overwritten.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Color
    use Libraries.Game.BoundingBox

    class Main is Game

        Model cube
        BoundingBox box
        
        action Main
            StartGame()
        end

        action CreateGame
            Color mint
            mint:SetColor(0.5, 1, 0.75, 1)

            cube:LoadBox(2, 2, 2, mint)
            Add(cube)

            cube:CalculateBoundingBox(box)
            output "The dimensions of the bounding box are: " + box:GetWidth() + ", " + box:GetHeight() + ", " + box:GetDepth()
        end
    end

Parameters

Return

Libraries.Game.BoundingBox: The given axis-aligned BoundingBox, which will contain the bounds of this Model.

CanRotate(boolean flag)

Parameters

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 a CompareResult. The compare result is either larger if this hash code is larger than the object passed as a parameter, smaller, or equal.

Example Code

use Libraries.Language.Support.CompareResult
        Object o
        Object t
        CompareResult result = o:Compare(t)

Parameters

Return

Libraries.Language.Support.CompareResult: The Compare result, Smaller, Equal, or Larger.

ComputeAngularImpulseDenominator(Libraries.Compute.Vector3 axis)

Parameters

Return

number

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

Parameters

Return

number

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

transform:Translate(vector:GetX(), vector:GetY(), vector:GetZ() * -

Parameters

DestroyNodes(Libraries.Game.Collision.BroadphaseCollision3D broadphase)

transform:Translate(0, 0, -zAmoun

Parameters

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)

The Draw action is what makes a Model appear on the screen. This action will automatically be called by the Game class if the Model has been added to the Game with the Add(Item) action. Most users will never need to use this action directly.

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 Code

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)

Parameters

Equals(Libraries.Language.Object object)

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

Example Code

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

Parameters

Return

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

ExtendBoundingBox(Libraries.Game.BoundingBox box)

ExtendBoundingBox will expand the bounds of the given BoundingBox to fully encapsulate the bounds of this Model.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Color
    use Libraries.Game.BoundingBox

    class Main is Game

        Model cube
        Model cylinder
        
        action Main
            StartGame()
        end

        action CreateGame
            Color blue
            blue:SetColor(0, 0, 1, 1)

            cube:LoadBox(2, 2, 2, blue)
            Add(cube)

            cylinder:LoadCylinder(1, 4, 1, blue)
            Add(cylinder)

            BoundingBox box = cube:CalculateBoundingBox()
            cylinder:ExtendBoundingBox(box)
            output "The dimensions of the bounding box are: " + box:GetWidth() + ", " + box:GetHeight() + ", " + box:GetDepth()
        end
    end

Parameters

Return

Libraries.Game.BoundingBox: The given BoundingBox, which now includes the bounds of this Model.

FastMoving(boolean flag)

Parameters

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.

Example Code

use Libraries.Interface.Item

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

Parameters

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:

GetAccessibilityType()

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

Return

text:

GetAngularDamping()

Return

number

GetAngularFactor()

Return

number

GetAngularVelocity()

Return

Libraries.Compute.Vector3

GetAnimations()

This action returns an array containing all Animation objects used by this Model.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Color
    use Libraries.Game.Graphics.ModelData.Animation
    use Libraries.Containers.Array

    class Main is Game

        Model cube

        action Main
            StartGame()
        end

        action CreateGame
            Color cyan
            cyan:SetColor(0, 0.75, 1, 1)

            cube:LoadBox(2, 2, 2, cyan)
            Add(cube)

            Array<Animation> animations = cube:GetAnimations()
            output "This model uses " + animations:GetSize() + " animation(s)."
        end
    end

Return

Libraries.Containers.Array: The array containing the Animations used by this Model.

GetBlueprintKey()

This action will return the identifier for the ModelBlueprint that this model was loaded from.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Color

    class Main is Game

        Model cube

        action Main
            StartGame()
        end

        action CreateGame
            Color cyan
            cyan:SetColor(0, 0.75, 1, 1)

            cube:LoadBox(2, 2, 2, cyan)
            Add(cube)

            text id = cube:GetBlueprintKey()
            output "The cube's ModelBlueprint ID is " + id
        end
    end

Return

text: A text value identifying the ModelBlueprint used to load this Model.

GetBoundingBox(integer childIndex)

Item3D child = undefin

Parameters

Return

Libraries.Game.BoundingBox:

GetCenterOfMassPosition()

Return

Libraries.Compute.Vector3

GetCenterOfMassTransform()

Return

Libraries.Game.Collision.PhysicsPosition3D

GetCollisionGroupFlag()

Return

boolean

GetCollisionGroupIndex()

Return

integer

GetCollisionList()

Return

Libraries.Game.Collision.CollisionEdge3D

GetCollisionTransform()

Return

Libraries.Game.Collision.PhysicsPosition3D

GetCollisionTransform0()

Return

Libraries.Game.Collision.PhysicsPosition3D

GetDepth()

GetDepth will return the depth of this Item3D.

Example Code

use Libraries.Interface.Item3D

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

Return

number: The depth of this item.

GetDescription()

This action returns the current internal description of the Item.

Example Code

use Libraries.Interface.Item

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

Return

text:

GetDimensions()

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

Example Code

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

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

Return

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

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

Return

Libraries.Compute.Vector3

GetFriction()

Return

number

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

Example Code

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

Return

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

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

Example Code

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

Return

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

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

Example Code

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

Return

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

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

Example Code

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

Return

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

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

GetHeight()

GetHeight will return the height of this Item3D.

Example Code

use Libraries.Interface.Item3D

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

Return

number: The height of this item.

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.

Example Code

use Libraries.Interface.Item

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

Return

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

GetInputTable()

Return

Libraries.Game.InputTable:

GetInterpolatedAngularVelocity()

Return

Libraries.Compute.Vector3

GetInterpolatedLinearVelocity()

Return

Libraries.Compute.Vector3

GetInterpolationTransform()

Return

Libraries.Game.Collision.PhysicsPosition3D

GetInterpolationWorldTransform()

Return

Libraries.Game.Collision.PhysicsPosition3D

GetInverseInertiaLocal()

Return

Libraries.Compute.Vector3

GetInverseInertiaWorld()

Return

Libraries.Compute.Matrix3

GetInverseMass()

Return

number

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.

Example Code

use Libraries.Interface.Item3D

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

Parameters

Return

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

GetItemCount()

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

Example Code

use Libraries.Interface.Item3D

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

Return

integer: The number of children in this Item3D.

GetItems()

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

Example Code

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

Return

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

GetJointList()

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.

Example Code

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)

Parameters

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.

Example Code

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

Return

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

GetLinearDamping()

Return

number

GetLinearVelocity()

Return

Libraries.Compute.Vector3

GetLinearVelocityAtLocalPoint(Libraries.Compute.Vector3 relativePosition)

Parameters

Return

Libraries.Compute.Vector3

GetMass()

Return

number

GetMaterials()

This action returns an array containing all Material objects used by this Model.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Color
    use Libraries.Game.Graphics.Material
    use Libraries.Containers.Array

    class Main is Game

        Model cube

        action Main
            StartGame()
        end

        action CreateGame
            Color cyan
            cyan:SetColor(0, 0.75, 1, 1)

            cube:LoadBox(2, 2, 2, cyan)
            Add(cube)

            Array<Material> materials = cube:GetMaterials()
            output "This model uses " + materials:GetSize() + " material(s)."
        end
    end

Return

Libraries.Containers.Array: The array containing the Materials used by this Model.

GetModelBlueprint()

This action will return the ModelBlueprint that this model was loaded from.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Color
    use Libraries.Game.Graphics.ModelBlueprint

    class Main is Game

        Model cube
        ModelBlueprint schematic = undefined

        action Main
            StartGame()
        end

        action CreateGame
            Color cyan
            cyan:SetColor(0, 0.75, 1, 1)

            cube:LoadBox(2, 2, 2, cyan)
            Add(cube)

            schematic = cube:GetModelBlueprint()
        end
    end

Return

Libraries.Game.Graphics.ModelBlueprint: The ModelBlueprint that this Model was loaded from.

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.

Example Code

use Libraries.Interface.Item

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

Return

text:

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)

Parameters

Return

Libraries.Game.Collision.Item3DNode

GetNodeCount()

transform:Translate(xAmount, yAmount, -zAmoun

Return

integer:

GetNodes()

This action returns an array containing all Node objects used by this Model.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Color
    use Libraries.Game.Graphics.ModelData.Node
    use Libraries.Containers.Array

    class Main is Game

        Model cube

        action Main
            StartGame()
        end

        action CreateGame
            Color cyan
            cyan:SetColor(0, 0.75, 1, 1)

            cube:LoadBox(2, 2, 2, cyan)
            Add(cube)

            Array<Node> nodes = cube:GetNodes()
            output "This model uses " + nodes:GetSize() + " node(s)."
        end
    end

Return

Libraries.Containers.Array: The array containing the Nodes used by this Model.

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.

Example Code

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

Return

number: The current X offset.

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.

Example Code

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

Return

number: The current Y offset.

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.

Example Code

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

Return

number: The current Z offset.

GetOrientation()

Return

Libraries.Compute.Quaternion

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.

Example Code

use Libraries.Interface.Item3D

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

Return

Libraries.Interface.Item3D: The parent Item.

GetPhysicsProperties()

Return

Libraries.Game.Physics.PhysicsProperties3D

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.

Example Code

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

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

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

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.

GetPushVelocity()

Return

Libraries.Compute.Vector3

GetRenderables(Libraries.Containers.Array<Libraries.Game.Graphics.Renderable> renderables)

GetRenderables is used to retrieve all of the individual renderable components of this Model. This action is used internally by the Game engine. Most users should never need to access this action directly.

Parameters

GetResponsiveness()

Return

integer

GetRestitution()

Return

number

GetShape()

vector3:Normalize

Return

Libraries.Game.Collision.Shapes.CollisionShape3D:

GetShapeType()

Vector3 localOffset = child:GetGlobalPosition

Return

integer:

GetSleepTime()

Return

number

GetTimeOfImpact()

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

Return

number:

GetTorque()

Return

Libraries.Compute.Vector3

GetTouchListeners()

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

Return

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

GetTransform()

This action will return the Matrix4 containing the transformations applied to the Item3D, including its global position, rotation, and scaling.

Example Code

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

Return

Libraries.Compute.Matrix4: The Matrix4 used by this item to store and calculate transformations.

GetTurnVelocity()

Return

Libraries.Compute.Vector3

GetWidth()

GetWidth will return the width of this Item3D.

Example Code

use Libraries.Interface.Item3D

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

Return

number: The width of this item.

GetX()

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.

Example Code

use Libraries.Interface.Item3D

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

Return

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

GetY()

GetY will return the Y 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 Y coordinate, use the GetGlobalY() action instead.

Example Code

use Libraries.Interface.Item3D

        Item3D myItem
        myItem:SetY(50)
        number y = myItem:GetY()

Return

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

GetZ()

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.

Example Code

use Libraries.Interface.Item3D

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

Return

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

HasMoved()

Return

boolean

Hide()

This action is used to indicate that an Item and all Items that were added to it should not be visible on the screen. Note that the Item class on its own cannot be drawn on the screen, but classes that inherit from it such as Libraries.Game.Graphics.Drawable can be. By default, Items are considered visible.

Example Code

use Libraries.Interface.Item

        Item item
        item:Hide()

IntegrateVelocities(number seconds)

Parameters

InternalApplyImpulse(Libraries.Compute.Vector3 linearComponent, Libraries.Compute.Vector3 angularComponent, number impulseMagnitude)

Parameters

IsCollidable()

Return

boolean

IsEmpty()

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

Example Code

use Libraries.Interface.Item3D

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

Return

boolean: Whether or not this item contains any children.

IsFastMoving()

Return

boolean

IsFocusable()

This action returns whether or not the Item can currently receive focus. This property can be set with SetFocusable().

Return

boolean:

IsFocused()

The IsFocused action determines if this Item is currently focused, returning true if it is, or false if it is not.

Return

boolean:

IsNonResponsive()

Return

boolean

IsPhysicsEnabled()

Return

boolean

IsResponsive()

Return

boolean

IsRotationAllowed()

Return

boolean

IsShowing()

This action returns whether the Item is currently set to be visible on the screen.

Example Code

use Libraries.Interface.Item

        Item item
        item:Hide()
        boolean visible = item:IsShowing()

Return

boolean: A boolean representing whether or not the Item is currently visible.

IsSimulated()

Return

boolean

IsSimulationRequired()

Return

boolean

IsUnmovable()

Return

boolean

Load(Libraries.Game.Graphics.ModelBlueprint loader, Libraries.Compute.Matrix4 matrix)

This action will load this Model using the data contained in the given ModelBlueprint, and set its transform using the given Matrix4 (if it is defined).

Parameters

Load(text fileName)

This action will load the Model file with the given file name from the default file directory. The supported file extensions are .obj, .g3db, and .g3dj.

Example Code

use Libraries.Game.Game
    use Libraries.System.File
    use Libraries.Game.Graphics.Model

    class Main is Game

        Model cup

        action Main
            StartGame()
        end

        action CreateGame
            cup:Load("brown-mug.obj")
            Add(cup)
        end
    end

Parameters

Load(Libraries.Game.Graphics.ModelBlueprint loader)

This action will load this Model using the data contained in the given ModelBlueprint.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.ModelBlueprint
    use Libraries.Game.Graphics.Color

    class Main is Game

        Model cube
        Model cubeCopy

        action Main
            StartGame()
        end

        action CreateGame
            Color mint
            mint:SetColor(0.5, 1, 0.75, 1)

            cube:LoadBox(2, 2, 2, mint)
            Add(cube)

            ModelBlueprint schematic = cube:GetModelBlueprint()
            cubeCopy:Load(schematic)
            Add(cubeCopy)

            cube:SetX(-2)
            cubeCopy:SetX(2)
        end
    end

Parameters

Load(Libraries.System.File file)

This action will load a model from a given model file. The supported file extensions are .obj, .g3db, and .g3dj.

Example Code

use Libraries.Game.Game
    use Libraries.System.File
    use Libraries.Game.Graphics.Model

    class Main is Game

        Model hat

        action Main
            StartGame()
        end

        action CreateGame
            File file
            file:SetPath("Sombrero.obj")
            hat:Load(file)
            Add(hat)
        end
    end

Parameters

LoadBox(number width, number height, number depth, Libraries.Game.Graphics.Color color)

This action will load the Model with a box with the given width, height, depth, and color.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Color

    class Main is Game

        Model cube

        action Main
            StartGame()
        end

        action CreateGame
            Color cyan
            cyan:SetColor(0, 0.75, 1, 1)

            cube:LoadBox(2, 2, 2, cyan)
            Add(cube)
        end
    end

Parameters

LoadBox(number width, number height, number depth, text textureFile)

This action will load the Model with a box with the given width, height, and depth. The box will use the texture located at the provided file path.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model

    class Main is Game

        Model cube

        action Main
            StartGame()
        end

        action CreateGame
            cube:LoadBox(2, 2, 2, "Box.png")
            Add(cube)
        end
    end

Parameters

LoadBox(number width, number height, number depth, Libraries.Game.Graphics.Drawable drawable)

This action will load the Model with a box with the given width, height, and depth. The box will use the texture that has been loaded by the given Drawable.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Drawable

    class Main is Game

        Model cube

        action Main
            StartGame()
        end

        action CreateGame
            Drawable logo
            logo:Load("Logo.png")

            cube:LoadBox(2, 2, 2, logo)
            Add(cube)
        end
    end

Parameters

LoadBox(number width, number height, number depth, Libraries.System.File textureFile)

This action will load the Model with a box with the given width, height, and depth. The box will use the texture located in the provided file.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.System.File

    class Main is Game

        Model cube

        action Main
            StartGame()
        end

        action CreateGame
            File texture
            texture:SetPath("Crate.png")

            cube:LoadBox(2, 2, 2, texture)
            Add(cube)
        end
    end

Parameters

LoadBox(number width, number height, number depth, Libraries.Game.Graphics.Texture texture)

This action will load the Model with a box with the given width, height, depth, and texture.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Texture

    class Main is Game

        Model cube

        action Main
            StartGame()
        end

        action CreateGame
            Texture texture
            texture:LoadFilledCircle(150)

            cube:LoadBox(2, 2, 2, texture)
            Add(cube)
        end
    end

Parameters

LoadCylinder(number width, number height, number depth, Libraries.Game.Graphics.Drawable drawable)

This action will load the Model with a cylinder with the given dimensions, using the texture contained in the given (loaded) Drawable. The curve of the cylinder will be approximated using 16 straight edges.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Drawable

    class Main is Game

        Model tube

        action Main
            StartGame()
        end

        action CreateGame
            Drawable image
            image:Load("Pillar.png")

            tube:LoadCylinder(2, 2, 2, image)
            Add(tube)
        end
    end

Parameters

LoadCylinder(number width, number height, number depth, text textureFile)

This action will load the Model with a cylinder with the given dimensions and texture. The curve of the cylinder will be approximated using 16 straight edges.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model

    class Main is Game

        Model tube

        action Main
            StartGame()
        end

        action CreateGame
            tube:LoadCylinder(2, 2, 2, "Barrel.png")
            Add(tube)
        end
    end

Parameters

LoadCylinder(number width, number height, number depth, Libraries.Game.Graphics.Color color)

This action will load the Model with a cylinder with the given width, height, depth, and color. The default cylinder will be made using 16 straight sides to simulate the curve of the cylinder.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Color

    class Main is Game

        Model tube

        action Main
            StartGame()
        end

        action CreateGame
            Color orange
            orange:SetColor(1, 0.5, 0, 1)

            tube:LoadCylinder(2, 2, 2, orange)
            Add(tube)
        end
    end

Parameters

LoadCylinder(number width, number height, number depth, integer divisions, Libraries.Game.Graphics.Drawable drawable)

This action will load the Model with a cylinder with the given dimensions and using the texture contained in the provided Drawable. The Drawable must be loaded. The provided number of divisions will be used to simulate the curve of the cylinder - the more divisions used, the smoother the curve will appear.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Drawable

    class Main is Game

        Model tube

        action Main
            StartGame()
        end

        action CreateGame
            Drawable image
            image:Load("Steel.png")

            tube:LoadCylinder(2, 2, 2, 8, image)
            Add(tube)
        end
    end

Parameters

LoadCylinder(number width, number height, number depth, integer divisions, Libraries.System.File textureFile)

This action will load the Model with a cylinder with the given dimensions and texture. The provided number of divisions will be used to simulate the curve of the cylinder - the more divisions used, the smoother the curve will appear.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.System.File

    class Main is Game

        Model tube

        action Main
            StartGame()
        end

        action CreateGame
            File image
            image:SetPath("Steel.png")

            tube:LoadCylinder(2, 2, 2, 8, image)
            Add(tube)
        end
    end

Parameters

LoadCylinder(number width, number height, number depth, Libraries.System.File textureFile)

This action will load the Model with a cylinder with the given dimensions and texture. The curve of the cylinder will be approximated using 16 straight edges.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.System.File

    class Main is Game

        Model tube

        action Main
            StartGame()
        end

        action CreateGame
            File file
            file:SetPath("Trunk.png")

            tube:LoadCylinder(2, 2, 2, file)
            Add(tube)
        end
    end

Parameters

LoadCylinder(number width, number height, number depth, integer divisions, Libraries.Game.Graphics.Texture texture)

This action will load the Model with a cylinder with the given dimensions and texture. The provided number of divisions will be used to simulate the curve of the cylinder - the more divisions used, the smoother the curve will appear.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Texture

    class Main is Game

        Model tube

        action Main
            StartGame()
        end

        action CreateGame
            Texture texture
            texture:LoadFromFile("Cable.png")

            tube:LoadCylinder(2, 2, 2, 8, texture)
            Add(tube)
        end
    end

Parameters

LoadCylinder(number width, number height, number depth, Libraries.Game.Graphics.Texture texture)

This action will load the Model with a cylinder with the given dimensions and texture. The curve of the cylinder will be approximated using 16 straight edges.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Texture

    class Main is Game

        Model tube

        action Main
            StartGame()
        end

        action CreateGame
            Texture texture
            texture:LoadFromFile("Stripes.png")

            tube:LoadCylinder(2, 2, 2, texture)
            Add(tube)
        end
    end

Parameters

LoadCylinder(number width, number height, number depth, integer divisions, Libraries.Game.Graphics.Color color)

This action will load the Model with a cylinder with the given dimensions and color. The provided number of divisions will be used to simulate the curve of the cylinder - the more divisions used, the smoother the curve will appear.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Color

    class Main is Game

        Model tube

        action Main
            StartGame()
        end

        action CreateGame
            Color orange
            orange:SetColor(1, 0.5, 0, 1)

            tube:LoadCylinder(2, 2, 2, 8, orange)
            Add(tube)
        end
    end

Parameters

LoadCylinder(number width, number height, number depth, integer divisions, text textureFile)

This action will load the Model with a cylinder with the given dimensions and texture. The provided number of divisions will be used to simulate the curve of the cylinder - the more divisions used, the smoother the curve will appear.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model

    class Main is Game

        Model tube

        action Main
            StartGame()
        end

        action CreateGame
            tube:LoadCylinder(2, 2, 2, 8, "Concrete.png")
            Add(tube)
        end
    end

Parameters

LoadSphere(number width, number height, number depth, integer horizontalDivisions, integer verticalDivisions, text textureFile)

This action will load the Model with a sphere with the given dimensions and texture. The provided number of divisions will be used to simulate the curve of the sphere - the more divisions used, the smoother the curve will appear.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model

    class Main is Game

        Model ball

        action Main
            StartGame()
        end

        action CreateGame
            ball:LoadSphere(2, 2, 2, 12, 8, "Concrete.png")
            Add(ball)
        end
    end

Parameters

LoadSphere(number width, number height, number depth, integer horizontalDivisions, integer verticalDivisions, Libraries.System.File textureFile)

This action will load the Model with a sphere with the given dimensions and texture. The provided number of divisions will be used to simulate the curve of the sphere - the more divisions used, the smoother the curve will appear.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.System.File

    class Main is Game

        Model ball

        action Main
            StartGame()
        end

        action CreateGame
            File image
            image:SetPath("Steel.png")

            ball:LoadSphere(2, 2, 2, 12, 8, image)
            Add(ball)
        end
    end

Parameters

LoadSphere(number width, number height, number depth, Libraries.Game.Graphics.Color color)

This action will load the Model with a sphere with the given width, height, depth, and color. The default sphere will be made using 25 straight sides on the horizontal plane and 16 straight sides on the vertical plane to simulate the curve of a true sphere.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Color

    class Main is Game

        Model ball

        action Main
            StartGame()
        end

        action CreateGame
            Color orange
            orange:SetColor(1, 0.65, 0, 1)

            ball:LoadSphere(2, 2, 2, orange)
            Add(ball)
        end
    end

Parameters

LoadSphere(number width, number height, number depth, integer horizontalDivisions, integer verticalDivisions, Libraries.Game.Graphics.Color color)

This action will load the Model with a sphere with the given dimensions and color. The provided number of divisions will be used to simulate the curve of the sphere - the more divisions used, the smoother the curve will appear.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Color

    class Main is Game

        Model ball

        action Main
            StartGame()
        end

        action CreateGame
            Color orange
            orange:SetColor(1, 0.65, 0, 1)

            tube:LoadSphere(2, 2, 2, 12, 8, orange)
            Add(tube)
        end
    end

Parameters

LoadSphere(number width, number height, number depth, Libraries.System.File textureFile)

This action will load the Model with a sphere with the given dimensions and texture. The curve of the sphere will be approximated using 25 straight edges along the horizontal plane, and 16 straight edges along the vertical plane.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.System.File

    class Main is Game

        Model ball

        action Main
            StartGame()
        end

        action CreateGame
            File file
            file:SetPath("Rubber.png")

            ball:LoadSphere(2, 2, 2, file)
            Add(ball)
        end
    end

Parameters

LoadSphere(number width, number height, number depth, integer horizontalDivisions, integer verticalDivisions, Libraries.Game.Graphics.Texture texture)

This action will load the Model with a sphere with the given dimensions and texture. The provided number of divisions will be used to simulate the curve of the sphere - the more divisions used, the smoother the curve will appear.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Texture

    class Main is Game

        Model ball

        action Main
            StartGame()
        end

        action CreateGame
            Texture texture
            texture:LoadFromFile("Orb.png")

            ball:LoadSphere(2, 2, 2, 12, 8, texture)
            Add(ball)
        end
    end

Parameters

LoadSphere(number width, number height, number depth, integer horizontalDivisions, integer verticalDivisions, Libraries.Game.Graphics.Drawable drawable)

This action will load the Model with a sphere with the given dimensions and using the texture contained in the provided Drawable. The Drawable must be loaded. The provided number of divisions will be used to simulate the curve of the sphere - the more divisions used, the smoother the curve will appear.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Drawable

    class Main is Game

        Model ball

        action Main
            StartGame()
        end

        action CreateGame
            Drawable image
            image:Load("Steel.png")

            ball:LoadSphere(2, 2, 2, 12, 8, image)
            Add(ball)
        end
    end

Parameters

LoadSphere(number width, number height, number depth, Libraries.Game.Graphics.Texture texture)

This action will load the Model with a sphere with the given dimensions and texture. The curve of the cylinder will be approximated using 25 straight edges along the horizontal plane, and 16 straight edges along the vertical plane.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Texture

    class Main is Game

        Model ball

        action Main
            StartGame()
        end

        action CreateGame
            Texture texture
            texture:LoadFromFile("Stripes.png")

            ball:LoadBall(2, 2, 2, texture)
            Add(ball)
        end
    end

Parameters

LoadSphere(number width, number height, number depth, Libraries.Game.Graphics.Drawable drawable)

This action will load the Model with a sphere with the given dimensions, using the texture contained in the given (loaded) Drawable. The curve of the sphere will be approximated using 25 straight edges along the horizontal plane and 16 straight edges along the vertical plane.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model
    use Libraries.Game.Graphics.Drawable

    class Main is Game

        Model ball

        action Main
            StartGame()
        end

        action CreateGame
            Drawable image
            image:Load("Plaid.png")

            ball:LoadSphere(2, 2, 2, image)
            Add(ball)
        end
    end

Parameters

LoadSphere(number width, number height, number depth, text textureFile)

This action will load the Model with a sphere with the given dimensions and texture. The curve of the cylinder will be approximated using 25 straight edges along the horizontal plane, and 16 straight edges along the vertical plane.

Example Code

use Libraries.Game.Game
    use Libraries.Game.Graphics.Model

    class Main is Game

        Model ball

        action Main
            StartGame()
        end

        action CreateGame
            ball:LoadSphere(2, 2, 2, "Cannonball.png")
            Add(ball)
        end
    end

Parameters

LostFocus(Libraries.Interface.Events.FocusEvent event)

This action is fired if the item lost the focus.

Parameters

Move(Libraries.Compute.Vector3 vector)

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

Example Code

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

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

Parameters

Move(number xAmount, number yAmount, number zAmount)

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

Example Code

use Libraries.Interface.Item3D

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

Parameters

MoveX(number xAmount)

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

Example Code

use Libraries.Interface.Item3D

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

Parameters

MoveY(number yAmount)

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

Example Code

use Libraries.Interface.Item3D

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

Parameters

MoveZ(number zAmount)

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

Example Code

use Libraries.Interface.Item3D

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

Parameters

PredictIntegratedTransform(number seconds, Libraries.Game.Collision.PhysicsPosition3D predictedTransform)

Parameters

ProceedToTransform(Libraries.Game.Collision.PhysicsPosition3D transform)

Parameters

ProcessMouseEvent(Libraries.Interface.Events.MouseEvent event)

This action takes a MouseEvent and distributes it to any MouseListeners, MouseMovementListeners, and MouseWheelListeners that have been added to this Item3D. This action will also set the event to the "handled" state.

Example Code

use Libraries.Interface.Item2D
    use Libraries.Interface.Events.MouseEvent
    use Libraries.Interface.Events.MouseListener
    Item2D myItem
    MouseListener listener
    myItem:AddMouseListener(listener)
    MouseEvent event
    event:eventType = event:CLICKED_MOUSE
    myItem:ProcessMouseEvent(event)

Parameters

ProcessTouchEvent(Libraries.Interface.Events.TouchEvent event)

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.

Example Code

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)

Parameters

Remove(integer index)

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

Example Code

use Libraries.Interface.Item

        Item parentItem
        Item child1
        Item child2
        parentItem:Add(child1)
        parentItem:Add(child2)
        parentItem:Remove(0)

Parameters

Return

Libraries.Interface.Item3D: The Item that was removed.

Remove(Libraries.Interface.Item3D removed)

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

Example Code

use Libraries.Interface.Item3D

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

Parameters

Return

boolean: Whether or not the item was found and removed.

RemoveFocusListener(Libraries.Interface.Events.FocusListener listener)

This action removes a FocusListener from the Item. The listener will no longer receive notification if the Item gets a FocusEvent.

Example Code

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

Parameters

RemoveMouseListener(Libraries.Interface.Events.MouseListener listener)

This action removes a MouseListener from the Item. The listener will no longer receive notification if the Item gets a mouse click event.

Example Code

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

Parameters

RemoveMouseMovementListener(Libraries.Interface.Events.MouseMovementListener listener)

This action removes a MouseMovementListener from the Item. The listener will no longer receive notification if the Item gets a mouse movement event.

Example Code

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

Parameters

RemoveMouseWheelListener(Libraries.Interface.Events.MouseWheelListener listener)

This action removes a MouseWheelListener from the Item. The listener will no longer receive notification if the Item gets a mouse wheel event.

Example Code

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

Parameters

RemoveTouchListener(Libraries.Interface.Events.TouchListener listener)

This action removes a TouchListener from the Item. The listener will no longer receive notification if the Item gets a TouchEvent.

Example Code

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

Parameters

RequireSimulation(boolean flag)

Parameters

ResetMass()

Rotate(Libraries.Compute.Vector3 vector, number degrees, boolean rotateChildren)

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.

Example Code

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

Parameters

Rotate(Libraries.Compute.Vector3 vector, number degrees)

This action will rotate the Item3D about an axis represented by the given Vector3. The axis is essentially a ray that starts at the center of the item and points outward. The item will then rotate clockwise around that ray. The item will be rotated by an angle given in degrees. 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.

Example Code

use Libraries.Interface.Item3D
    use Libraries.Compute.Vector3
    Item3D myItem
    Vector3 vector

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

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

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

    // When setting the vector 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.
    vector:Set(3, 1, 0)
    myItem:Rotate(vector, 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).
    vector:Set(9, 3, 0)
    myItem:Rotate(vector, 45)

Parameters

Rotate(number rotateX, number rotateY, number rotateZ, number degrees)

This action will rotate the Item3D about an axis. The axis is essentially a ray that starts at the center of the item and points outward. The item will then rotate clockwise around that ray. The ray is defined using three numbers, representing which way it points on the x, y, and z planes, respectively. The item will be rotated by an angle given in degrees. 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.

Example Code

use Libraries.Interface.Item3D
    Item3D myItem

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

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

    // This will rotate the item 60 degrees counter-clockwise around a ray  
    // passing through the item's center and pointing to the right.
    myItem:Rotate(1, 0, 0, -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.
    myItem:Rotate(3, 1, 0, 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).
    myItem:Rotate(9, 3, 0, 45)

Parameters

Rotate(number rotateX, number rotateY, number rotateZ, number degrees, boolean rotateChildren)

This action will rotate the Item3D about an axis represented by the first 3 given number values. 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.

Example Code

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

Parameters

RotateAround(Libraries.Compute.Vector3 point, Libraries.Compute.Vector3 axis, number degrees)

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.

Example Code

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)

Parameters

RotateAround(Libraries.Compute.Vector3 point, Libraries.Compute.Vector3 axis, number degrees, boolean rotateChildren)

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.

Example Code

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)

Parameters

RotateChildren(number rotateX, number rotateY, number rotateZ, number degrees)

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.

Example Code

use Libraries.Interface.Item3D
    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.
    myItem:RotateChildren(1, 0, 0, 90)

    // This will rotate the item's children 45 degrees clockwise around a ray passing 
    // through the item's center and pointing straight down.
    myItem:RotateChildren(0, -1, 0, 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.
    myItem:RotateChildren(1, 0, 0, -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.
    myItem:Rotate(3, 1, 0, 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).
    myItem:RotateChildren(9, 3, 0, 45)

Parameters

RotateChildren(Libraries.Compute.Vector3 vector, number degrees)

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.

Example Code

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)

Parameters

SaveKinematicState(number time)

Parameters

Scale(Libraries.Compute.Vector3 vector)

This action will scale the Item3D by the values of the given Vector3. 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.

Example Code

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

Parameters

Scale(Libraries.Compute.Vector3 vector, boolean scaleChildren)

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.

Example Code

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

Parameters

Scale(number scaleX, number scaleY, number scaleZ, boolean scaleChildren)

This action will scale the Item3D by the given values. 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.

Example Code

use Libraries.Interface.Item3D
        Item3D myItem
        myItem:Scale(5, 2, 1, false)

Parameters

Scale(number scaleX, number scaleY, number scaleZ)

This action will scale the Item3D by the given values. 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.

Example Code

use Libraries.Interface.Item3D
    Item3D myItem
    myItem:Scale(5, 2, 1)

Parameters

SetAccessibilityCode(integer newAccessibilityCode)

This action changes the accessibility code for this Item. This should be done with care because setting the accessiblity code to the incorrect type can cause accessibility to stop functioning or, in some cases, cause the program to crash.

Parameters

SetAngularDamping(number angularDamping)

Parameters

SetAngularVelocity(Libraries.Compute.Vector3 angularVelocity)

Parameters

SetCenterOfMassTransform(Libraries.Game.Collision.PhysicsPosition3D transform)

Parameters

SetCollidable(boolean flag)

Parameters

SetCollideWithChildren(boolean flag)

Parameters

SetCollisionGroupFlag(boolean flag)

Parameters

SetCollisionGroupIndex(integer index)

Parameters

SetCollisionList(Libraries.Game.Collision.CollisionEdge3D list)

Parameters

SetCollisionTransform(Libraries.Game.Collision.PhysicsPosition3D transform)

Parameters

SetCollisionTransform0(Libraries.Game.Collision.PhysicsPosition3D transform)

Parameters

SetDepth(number setDepth)

This action sets the depth the Item.

Example Code

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

Parameters

SetDescription(text newDescription)

This action sets the internal description of the Item.

Example Code

use Libraries.Interface.Item

        Item item
        item:SetDescription("Used for demo purposes.")

Parameters

SetDimensions(number setWidth, number setHeight, number setDepth)

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

Example Code

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

Parameters

SetDimensions(Libraries.Compute.Vector3 vector)

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

Example Code

use Libraries.Interface.Item3D
        use Libraries.Compute.Vector3
        Item3D myItem
        Vector3 vector
        vector:Set(50, 200, 35)
        myItem:SetDimensions(vector)

Parameters

SetFocusable(boolean focus)

The SetFocusable action sets whether or not this Item should be focusable. If the Item is currently focused and made unfocusable, then it will lose focus, and there will be no focused element.

Parameters

SetForce(Libraries.Compute.Vector3 force)

Parameters

SetFriction(number friction)

Parameters

SetHasMoved(boolean flag)

Parameters

SetHeight(number setHeight)

This action sets the height of the Item.

Example Code

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

Parameters

SetInputGroup(text group)

This action sets 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.

Example Code

use Libraries.Interface.Item

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

Parameters

SetInterpolatedAngularVelocity(Libraries.Compute.Vector3 velocity)

Parameters

SetInterpolatedLinearVelocity(Libraries.Compute.Vector3 velocity)

Parameters

SetInterpolationTransform(Libraries.Game.Collision.PhysicsPosition3D transform)

Parameters

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

This action sets a value inside the internal item array of this Item3D.

Example Code

use Libraries.Interface.Item3D

        Item3D parentItem
        Item3D child1
        Item3D child2
        parentItem:Add(child1)
        parentItem:SetItem(0, child2)

Parameters

SetJointList(Libraries.Game.Physics.Joints.JointEdge3D list)

Parameters

SetLayer(Libraries.Game.Layer3D parentLayer)

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.

Parameters

SetLinearDamping(number linearDamping)

Parameters

SetLinearVelocity(Libraries.Compute.Vector3 linearVelocity)

Parameters

SetLinearVelocityX(number linearVelocityX)

Parameters

SetLinearVelocityY(number linearVelocityY)

Parameters

SetLinearVelocityZ(number linearVelocityZ)

Parameters

SetMass(number mass)

Parameters

SetName(text newName)

This action sets the internal name of the Item.

Example Code

use Libraries.Interface.Item

        Item item
        item:SetName("My Item")

Parameters

SetNextFocus(Libraries.Interface.Item next)

This action sets 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 focus will move to the next focus item, if it is defined.

Parameters

SetNonResponsive()

SetOffset(Libraries.Compute.Vector3 vector)

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.

Example Code

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

Parameters

SetOffset(number xAmount, number yAmount, number zAmount)

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.

Example Code

use Libraries.Interface.Item3D
        Item3D myItem
        myItem:SetOffset(75, 40, 35)

Parameters

SetOffsetX(number xAmount)

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.

Example Code

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

Parameters

SetOffsetY(number yAmount)

This action sets 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.

Example Code

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

Parameters

SetOffsetZ(number zAmount)

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.

Example Code

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

Parameters

SetParent(Libraries.Interface.Item3D newItem)

This action sets a reference to the parent item. It is called automatically when an Item3D is added as a child to another Item3D. Most users will not need to use this action directly.

Parameters

SetPhysicsProperties(Libraries.Game.Physics.PhysicsProperties3D properties)

Parameters

SetPosition(Libraries.Compute.Vector3 vector)

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

Example Code

use Libraries.Interface.Item3D
        use Libraries.Compute.Vector3
        Item3D myItem
        Vector3 vector
        vector:Set(50, 200, 35)
        myItem:SetPosition(vector)

Parameters

SetPosition(number setX, number setY, number setZ)

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

Example Code

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

Parameters

SetPreviousFocus(Libraries.Interface.Item previous)

This action sets 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 focus will move to the previous focus item, if it is defined.

Parameters

SetResponsive()

SetResponsiveness(integer type)

Parameters

SetRestitution(number restitution)

Parameters

SetScreenPositionFromPhysicsPosition()

SetShape(Libraries.Game.Collision.Shapes.CollisionShape3D shape)

We store the offsets we'll be using before manipulating anything. This ensures we use the original data, and there's no risk of using data that's been modified on the fly (e.g., updating a parent item will affect the position of the child item).

Parameters

SetSleepTime(number time)

Parameters

SetTimeOfImpact(number timeOfImpact)

Parameters

SetTorque(Libraries.Compute.Vector3 torque)

Parameters

SetUnmovable()

SetWidth(number setWidth)

This action sets the width of the Item.

Example Code

use Libraries.Interface.Item3D
        Item3D myItem
        myItem:SetWidth(35.0)

Parameters

SetX(number setX)

This action sets the X coordinate of the Item.

Example Code

use Libraries.Interface.Item3D
        Item3D myItem
        myItem:SetX(35.0)

Parameters

SetY(number setY)

This action sets the Y coordinate of the Item.

Example Code

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

Parameters

SetZ(number setZ)

This action sets the Z coordinate of the Item.

Example Code

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

Parameters

ShouldCollide(Libraries.Interface.Item3D otherItem)

Parameters

Return

boolean

Show()

This action is used to indicate that an Item and all Items that were added to it should be visible on the screen. Note that the Item class on its own cannot be drawn on the screen, but classes that inherit from it such as Libraries.Game.Graphics.Drawable can be. By default, Items are considered visible.

Example Code

use Libraries.Interface.Item

        Item item
        item:Show()

Simulate(boolean flag)

Parameters

SynchronizeNodes()

transform:Scale(vecto

Update(number secondsSinceUpdate)

This action updates the item. It takes a number parameter that should indicate how many seconds have passed since the last time this action was called. This action does nothing in the Item class, but any class that inherits from Item may override it.

Example Code

use Libraries.Interface.Item
        use Libraries.System.DateTime
        
        class Main is Item

            action Main
                // We'll use a DateTime object to count seconds.
                DateTime time
                number currentTime = time:GetEpochTime()
                number newTime = 0

                repeat while GetX() < 300
                    // Check what the time is now.
                    newTime = time:GetEpochTime()

                    // Calculate how many seconds have passed, then call Update.
                    Update( (newTime - currentTime)/1000 )

                    // Store the old time.
                    currentTime = newTime
                end
            end

            // Our update action will move our Item to the right at 200 units a second.
            action Update(number secondsSinceUpdate)
                SetX(GetX() + 200 * secondsSinceUpdate)
            end
        end

Parameters

UpdateAll(number secondsSinceUpdate)

This action calls the Update action on this Item and all Items that have been added to this item with the Add action.

Example Code

use Libraries.Interface.Item
        
        Item parentItem
        Item child1
        Item child2
        parentItem:Add(child1)
        parentItem:Add(child2)
        parentItem:UpdateAll(0)

Parameters

UpdateInertia()