Glossary
A coordinate system is a method of representing positions in a space. All coordinate systems in TGB are two-dimensional.
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
Window space can be converted to canvas space with the t2dSceneWindow::getCanvasPoint() function.
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
Object space can be converted to world space with the t2dSceneObject::getWorldPoint() function.
World space can be converted to object space with the t2dSceneObject::getLocalPoint() function.
Window space is simply a translation of canvas space offset by the position of the t2dSceneWindow on the GuiCanvas.
Conversions
Window space can be converted to canvas space with the t2dSceneWindow::getCanvasPoint() function.
World space can be converted to window space with the t2dSceneWindow::getWindowPoint() function.
Window space can be converted to world space with the t2dSceneWindow::getWorldPoint() function.
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
World space can be converted to window space with the t2dSceneWindow::getWindowPoint() function.
Window space can be converted to world space with the t2dSceneWindow::getWorldPoint() function.
Object space can be converted to world space with the t2dSceneObject::getWorldPoint() function.
World space can be converted to object space with the t2dSceneObject::getLocalPoint() function.
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.
A whole number, positive or negative.
A real number, positive or negative.
Either true or false. Any non-zero number evaluates to true. Zero evaluates to false. The empty string also evaluates to false.
A sequence of any number of characters.
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().
This is the same as vector, but includes a z value as a third component.
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.
A float value that represents an angle in degrees. If the number is an angular velocity, it is in degrees per second.
A float value between 0.0 and 1.0 with 0.0 representing no color and 1.0 representing full color.
An integer value between 0 and 255 with 0 representing no color and 255 representing full color.
Filenames in Torque are specified relative to the folder that the engine executable is in.
Multiple values of various data types separated by spaces. To access a single component of the list, use getWord()
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.
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.
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.
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.
FULL
- The entire image is used as a single frame.
CELL
- The image is split into several cells of the same size with each one used as
a frame.
KEY
- A 1 pixel border of a specific color is used to surround each of the frames
in the image.
LINK
- Several image maps are combined into a single image map.
FULL
- A superscribed circle is used first to filter objects that are obviously not
colliding. If the bounding circles of objects are colliding, a further polygon
check is done to see if a collision actually occurred.
CIRCLE
- Only the collision circle is used in determining collisions.
POLYGON
- Only the collision polygon is used in determining collisions.
CUSTOM
- A custom function is called to detect whether or not collision has occurred
between two objects. This function is defined by the user in the engine.
BOUNCE
- The object bounces off the object it collided with.
CLAMP
- The object is kept from penetrating the object it collided with.
CUSTOM
- A custom function is called to resolve collisions between two objects. This
function is defined by the user in the engine.
NULL
- Nothing is done, but the callback is still called.
CLAMP
- The object is clamped to the edge of the limit bounds.
STICKY
- The object sticks to the spot it hit the limit bounds.
KILL
- The object is deleted when it reaches the limit bounds.
LINEAR
- Pathed objects move in a straight line between path nodes.
BEZIER
- The path uses cubic bezier spline interpolation between nodes.
CATMULL
- The path uses catmull-rom spline interpolation between nodes.
WRAP
- Pathed objects continue in the same direction around the path upon reaching
the end node.
REVERSE
- Pathed objects reverse direction upon reaching the end node.
RESTART
- Pathed objects warp to the start node upon reaching the end node.
INFINITE
- The effect will last forever regardless of the lifetime.
CYCLE
- All time graphs will be reset after the lifetime has expired.
KILL
- The effect will be deleted after the lifetime has expired.
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.
ZERO
- (0, 0, 0, 0)
ONE
- (1, 1, 1, 1)
DST_COLOR
- (Rd, Gd, Bd,
Ad)
ONE_MINUS_DST_COLOR
-
(1, 1, 1, 1) - (Rd, Gd, Bd, Ad)
SRC_ALPHA
- (As, As, As,
As)
ONE_MINUS_SRC_ALPHA
- (1, 1, 1, 1) - (As, As, As, As)
DST_ALPHA
- (Ad, Ad, Ad,
Ad)
ONE_MINUS_DST_ALPHA
-
(1, 1, 1, 1) - (Ad, Ad, Ad, Ad)
SRC_ALPHA_SATURATE
- (min(As, 1 - Ad), min(As, 1 -
Ad), min(As, 1 - Ad), 1)
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.
ZERO
- (0, 0, 0, 0)
ONE
- (1, 1, 1, 1)
SRC_COLOR
- (Rs, Gs, Bs,
As)
ONE_MINUS_SRC_COLOR
-
(1, 1, 1, 1) - (Rs, Gs, Bs, As)
SRC_ALPHA
- (As, As, As,
As)
ONE_MINUS_SRC_ALPHA
-
(1, 1, 1, 1) - (As, As, As, As)
DST_ALPHA
- (Ad, Ad, Ad,
Ad)
ONE_MINUS_DST_ALPHA -
(1, 1, 1, 1) -(Ad, Ad, Ad,
Ad)
LINEAR
- The camera
moves at a constant speed.
SIGMOID
- The camera starts and stops slowly for
smooth movement.
POINT
- All particles
are produced at the center point of the effect.
LINEX
- Particles are
produced randomly along a horizontal line the width of the effect.
LINEY
- Particles are
produced randomly along a vertical line the height of the effect.
AREA
- Particles are produced randomly anywhere in
the effect bounds.
C
– Enable C
routines.
FPU
– Enable FPU
routines.
MMX
– Enable MMX
routines.
SSE
– Enable SSE
routines.
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 '#'.
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).
xaxis
– Horizontal mouse, joystick, or left analog stick movement.
yaxis
– Vertical mouse, joystick, or left analog stick movement.
Joystick POV
A callback is a function defined in script that is called by the engine when some event occurs.
A field is a variable that belongs to a specific object. These fields can be either static (sometimes called persistent) or dynamic.
A field that is created dynamically in script to store various information.
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.
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.
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.
An object's bounding box is the smallest axis-aligned rectangle that completely encloses the object.
A convex polygon is a polygon whose edges come together at internal angles less than 180 degrees.
A gravitic force acts on objects independent of their mass.
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 |