< Previous | Contents | Manuals Home | Boris FX | Next >

Vectors

A vector offers .x, .y, and .z attributes, or an offered vector can be taken whole with .vec. Vectors can be created outright with Vector(x,y,z).

.length is the length of the vector (square root of the sum of x, y, and z, each squared). (read-only).

.norm is the vector with the length normalized to one. (attribute form, read-

only)


.Norm() is the normalized vector (function form).

.Dot(vector2) returns the dot product of this vector with vector2.

.Cross(vector2) returns the cross product of this vector with vector2.

.Conform(vector2) makes the "this" vector of rotation angles conform with

the (old) vector vector2 of rotation angles, watching for +/- angle flips and mod- 360 issues. The resulting vector can have angles that exceed a +/-180 degree range, becoming infinitely large if the object continues to rotate.

When an object offers multiple vectors, each vector’s attribute names have a different prefix, resulting in .wx, .wy, .wz or .ox, .oy, or .oz, for example.

Operators: +, -, *(scalar), *(transform), /(scalar), %(element-by-element multiplication). The vector should be the left argument in operations with a scalar.

©2023 Boris FX, Inc. — UNOFFICIAL — Converted from original PDF.