Glossary

Coordinate Systems

A coordinate system is a method of representing positions in a space. All coordinate systems in TGB are two-dimensional.

Canvas Space

Canvas space matches the pixel size of the entire TGB window. (0, 0) is the upper left hand corner of the window and (resX, resY) is the lower right hand corner, where resX and resY are the horizontal and vertical resolution. Coordinates in this space are integer values.

Conversions





Local Space



Object Space

Each object has its own local coordinate system in object space. Valid coordinates in this system are in the range [-1.0, 1.0] where the point (-1.0, -1.0) is the upper left corner of the object's bounding box and (1.0, 1.0) is the lower right corner of the bounding box. The center of the object is the origin. This space is used to define various t2dSceneObject properties such as the collision polygon and mount points.

Conversions





Window Space

Window space is simply a translation of canvas space offset by the position of the t2dSceneWindow on the GuiCanvas.

Conversions





Scene Space



World Space

World space is a virtual coordinate system that defines positions in the game world. By default, the origin is in the center of the screen, however this can be changed through the t2dSceneWindow camera methods. The coordinate system is independent of screen resolution.

Conversions







Data Types

TorqueScript is a typeless language, which means variables can be of any type, however several functions provided by TGB require parameters to be of a certain form. Also, the return value of many functions often takes the form of one of these data types.

Integer

A whole number, positive or negative.



Float

A real number, positive or negative.



Bool

Either true or false. Any non-zero number evaluates to true. Zero evaluates to false. The empty string also evaluates to false.



String

A sequence of any number of characters.



Vector

Two float values separated by a space with the first being the x value and the second being the y value. This could represent a position, vector, or size. To access a single component of the vector, use getWord().



3D Vector

This is the same as vector, but includes a z value as a third component.



Rectangle

Four float values separated by a space with the first two being the x and y position of the upper left corner, and the last two being the x and y position of the lower right corner of a rectangle.



Angle

A float value that represents an angle in degrees. If the number is an angular velocity, it is in degrees per second.



ColorF

A float value between 0.0 and 1.0 with 0.0 representing no color and 1.0 representing full color.



ColorI

An integer value between 0 and 255 with 0 representing no color and 255 representing full color.



Filename

Filenames in Torque are specified relative to the folder that the engine executable is in.



List

Multiple values of various data types separated by spaces. To access a single component of the list, use getWord()



Object

An object can be specified either by name or ID. A reference to this data type will also include the class of the object. The actual object that is used can be either of this class or any class derived from it.



Mask

Masks are integers that are treated as a series of bits instead of a single number. Each bit usually has the purpose of setting something to either on or off. Bit manipulation can be done with the '&' and '|' operator as well as the BIT() and BITS() functions.



Ranges

A range is not a data type in itself, it just specifies the values that are valid for a particular data type. For example, the range (0, 31] means that the value can be anywhere between 0 and 31 including 31 but not including 0.







Enumerated Types

An enumerated type is a type whose possible values consist of a fixed set of constants. The following lists all of the enumerated types in TGB, their possible values, and a description of what each value means.

Image Mode





Collision Detection Mode





Collision Response Mode





World Limit Mode





Limit Type





Path Type





Follow Method





Life Mode



Source Blend Factor

The source blend factor determines how the color values of the incoming pixels are scaled in a blending operation. The final pixel color is computed by multiplying the source color by the source scale factor and adding it to the destination color multiplied by the destination scale factor. The following is a list of the source scale factors that can be used. Rs, Gs, Bs, and As are the red, green, blue, and alpha components of the source color and Rd, Gd, Bd, and Ad are the red, green, blue, and alpha of the destination color.





Destination Blend Factor

The destination blend factor determines how the color values of the pixels already in the frame buffer are scaled in a blending operation. The final pixel color is computed by multiplying the source color by the source scale factor and adding it to the destination color multiplied by the destination scale factor. The following is a list of the destination scale factors that can be used. Rs, Gs, Bs, and As are the red, green, blue, and alpha components of the source color and Rd, Gd, Bd, and Ad are the red, green, blue, and alpha of the destination color.





Camera Interpolation Mode





Emitter Type





Layer Order Command





Draw Order Command





Particle Orientation Mode





Math Extensions





Input Device

The mouse and joystick are appended with a number specifying the index of the device to use. This is used for situations where more than one mouse or joystick is attached to the computer. In cases where only one is attached, use '0' for '#'.





Input Action

The following input actions names correspond to keys on the keyboard, buttons on a joystick or mouse, or a mouse axis. Any of these actions can optionally be pre-pended with a modifier followed by a space. This will cause the action to only be triggered when the modifier key or keys are held down. Available modifiers are 'ctrl', 'shift', 'alt', 'cmd', or 'opt'. A key name pre-pended with 'l' or 'r' indicate the left key or right key either based on the direction they face (brackets for example) or the side of the keyboard they are on ('ctrl' for example).



Keyboard Keys



Joystick and Mouse Buttons




Mouse and Joystick Axes




Joystick POV




Miscellaneous Events








Terms

Callback

A callback is a function defined in script that is called by the engine when some event occurs.



Field

A field is a variable that belongs to a specific object. These fields can be either static (sometimes called persistent) or dynamic.



Dynamic Field

A field that is created dynamically in script to store various information.



Persistent Field



Static Field

A field that is specified in the engine on a per class basis and used to store specific information about the state of the object.



Layer Rendering

TGB has 32 layers numbered 0 - 31. Layer 0 is the top most layer, so objects on it will be drawn in front of objects on layer 3, for example. Objects can also be sorted within their layer with calls to t2dSceneGraph::setLayerDrawOrder. By default, objects added to a t2dSceneGraph are placed at the front of their layer.



Graph Group

The graph group is a property mostly used for tagging objects. The most common use is as a collision group to separate objects that have the same collision properties.



Bounding Box

An object's bounding box is the smallest axis-aligned rectangle that completely encloses the object.



Convex

A convex polygon is a polygon whose edges come together at internal angles less than 180 degrees.



Gravitic Force

A gravitic force acts on objects independent of their mass.



Constant Force

A constant force is a force that acts continuously on an object, like gravity, for instance.

Documents Involving the Same Genre Documents Involving the Same Functionality