Table of Contents

Advertisement

approach:
box.transform = Transform(newTransform.toString())
newTransform = currentTransform.toString()

Vector

Vectors specify geometric x, y, z offsets. Most objects use Vectors to specify their location (relative to the origin
<0, 0, 0>). Many methods are provided for combining and manipulating Vectors without the need to refer to the
x, y, z components directly.
Global Methods
Vector(various...)
Creates a new Vector (direction or position object). The following parameter styles are understood:
• Vector() - The zero vector <0.0, 0.0, 0.0>
• Vector(x, y, z) - The vector <x,y,z>
• Vector([x, y, z]) - The vector <x, y, z>
• Vector(v.toString()) - decoding from a string-encoded Vector
Also note that anywhere a Vector is accepted as a parameter, an Array of three numbers, [x, y, z] or [r, g, b],
will generally also be understood. (The exception is that you cannot dispatch Vector methods this way, so "v =
Vector(1, 2, 3).add([4, 5, 6]);" is valid, but "v = [1, 2, 3].add([4, 5, 6]);" is not.)
critter.position = Vector(5.0, fl oorHeight, 17.0);
Properties
[n]
[0..2] return the x, y, z or r, g, b components (read only)
verticalSpeed = velocity[1];
fogBlue = fog.color[2];
x, y, z
Returns the x, y, or z component (read only)
verticalSpeed = velocity.y;
r, g, b
Returns the r, g, or b component (read only)
fogRed = fog.color.r;
length
The length of the vector.
261
ADOBE ATMOSPHERE
User Guide

Advertisement

Table of Contents
loading

Table of Contents