Adobe ATMOSPHERE User Manual page 274

Table of Contents

Advertisement

262
APPENDIX E
if (a.subtract(b).length < minDistance) { ... }
negated
The negative (opposite direction) of the vector.
b = a.negated;
normalized
The normalized (length == 1) version of the vector.
b = a.normalized;
Methods
add(B)
Returns the sum of this Vector with Vector B
position = position.add(moveVec);
subtract(Vector)
Returns this Vector minus Vector B
hereToThere = there.subtract(here);
change(index, value)
Returns a new vector with the specifi ed element (0 < index <= 2) changed. It is not possible to modify a
component directly except using this method.
// Set y = fl oorHeight.
shadowPlace = position.change(1, fl oorHeight);
scale(s)
Returns a scaled vector, such that a.scale(s).length() == a.length()*s
moveVec = velocity.scale(deltaTime);
same(B)
Returns true if this Vector is equal to Vector B
if (!newPosition.same(oldPosition)) { ... }
dot(B)
Returns the dot product of this Vector with Vector B. (The dot product of vectors A and B is by defi nition the
cosine of the angle between A and B, times the lengths of both A and B.)
aimQuality =
aimVec.dot(targetPosition.subtract(myPosition).normalize())
cross(B)
Returns the cross product of this Vector with Vector B. (The cross product of vectors A and B is by defi nition a
new vector, C, perpendicular to both A and B, who's length is the sine of the angle between A and B, times the

Advertisement

Table of Contents
loading

Table of Contents