Packageflare.utils
Classpublic class Vector3DUtils
InheritanceVector3DUtils Inheritance Object

The Vector3DUtils class contains help tools to work with Vector3D-type objects.



Public Methods
 MethodDefined By
  
abs(a:Vector3D):void
[static]
Vector3DUtils
  
add(a:Vector3D, b:Vector3D, out:Vector3D = null):Vector3D
[static] Calculates the sum of two vectors.
Vector3DUtils
  
cross(a:Vector3D, b:Vector3D, out:Vector3D = null):Vector3D
[static] Calculates the crossed product of two vectors.
Vector3DUtils
  
interpolate(a:Vector3D, b:Vector3D, value:Number, out:Vector3D = null):Vector3D
[static] Calculates the interpolation between two vectors.
Vector3DUtils
  
length(a:Vector3D, b:Vector3D):Number
[static] Calculates the length between two vectors.
Vector3DUtils
  
lengthSquared(a:Vector3D, b:Vector3D):Number
[static] Calculates the squared length between two vectors.
Vector3DUtils
  
max(a:Vector3D, b:Vector3D, out:Vector3D = null):Vector3D
[static]
Vector3DUtils
  
min(a:Vector3D, b:Vector3D, out:Vector3D = null):Vector3D
[static]
Vector3DUtils
  
mirror(vector:Vector3D, normal:Vector3D, out:Vector3D = null):Vector3D
[static] Returns the vector mirrored with respect to another.
Vector3DUtils
  
negate(a:Vector3D, out:Vector3D = null):Vector3D
[static] Calculates the inverse vector of another vector.
Vector3DUtils
  
random(min:Number, max:Number, out:Vector3D = null):Vector3D
[static] Fills a vector with random numbers in a defined range.
Vector3DUtils
  
set(a:Vector3D, x:Number = 0, y:Number = 0, z:Number = 0, w:Number = 0):void
[static] Sets the values for a vector.
Vector3DUtils
  
setLength(a:Vector3D, length:Number):void
[static] Sets a scale for a vector.
Vector3DUtils
  
sub(a:Vector3D, b:Vector3D, out:Vector3D = null):Vector3D
[static] Calculates the subtraction of two vectors.
Vector3DUtils
Public Constants
 ConstantDefined By
  BACK : Vector3D
[static] Vector that defines the (0,0,-1) constant.
Vector3DUtils
  DOWN : Vector3D
[static] Vector that defines the (0,-1,0) constant.
Vector3DUtils
  FORWARD : Vector3D
[static] Vector that defines the (0,0,1) constant.
Vector3DUtils
  LEFT : Vector3D
[static] Vector that defines the (-1,0,0) constant.
Vector3DUtils
  ONE : Vector3D
[static] Vector that defines the (1,1,1) constant.
Vector3DUtils
  RIGHT : Vector3D
[static] Vector that defines the (1,0,0) constant.
Vector3DUtils
  UP : Vector3D
[static] Vector that defines the (0,1,0) constant.
Vector3DUtils
  ZERO : Vector3D
[static] Vector that defines the (0,0,0) constant.
Vector3DUtils
Method Detail
abs()method
public static function abs(a:Vector3D):void

Parameters

a:Vector3D

add()method 
public static function add(a:Vector3D, b:Vector3D, out:Vector3D = null):Vector3D

Calculates the sum of two vectors.

Parameters

a:Vector3D — First vector.
 
b:Vector3D — Second vector.
 
out:Vector3D (default = null) — Vector3D-type object where the result is to be returned.

Returns
Vector3D — If the 'out' parameter is 'null', a new Vector3D with the result will be returned. Otherwise, the same vector passed to the 'out' parameter will be returned.
cross()method 
public static function cross(a:Vector3D, b:Vector3D, out:Vector3D = null):Vector3D

Calculates the crossed product of two vectors.

Parameters

a:Vector3D — First vector to be tested.
 
b:Vector3D — Second vector to be tested.
 
out:Vector3D (default = null) — Vector3D-type object where the result is to be returned.

Returns
Vector3D — If the 'out' parameter is 'null', a new Vector3D with the result will be returned. Otherwise, the same vector passed to the 'out' parameter will be returned.
interpolate()method 
public static function interpolate(a:Vector3D, b:Vector3D, value:Number, out:Vector3D = null):Vector3D

Calculates the interpolation between two vectors.

Parameters

a:Vector3D — Source vector.
 
b:Vector3D — Destination vector.
 
value:Number — Interpolation value (0-1).
 
out:Vector3D (default = null) — Vector where the result is to be returned.

Returns
Vector3D — If the 'out' parameter is 'null', a new Vector3D with the result will be returned. Otherwise, the same vector passed to the 'out' parameter will be returned.
length()method 
public static function length(a:Vector3D, b:Vector3D):Number

Calculates the length between two vectors.

Parameters

a:Vector3D — First vector to be tested.
 
b:Vector3D — Second vector to be tested.

Returns
Number — Distance between vectors 'a' and 'b'.
lengthSquared()method 
public static function lengthSquared(a:Vector3D, b:Vector3D):Number

Calculates the squared length between two vectors.

Parameters

a:Vector3D — First vector to be tested.
 
b:Vector3D — Second vector to be tested.

Returns
Number — Distance aquared between vectors 'a' and 'b'.
max()method 
public static function max(a:Vector3D, b:Vector3D, out:Vector3D = null):Vector3D

Parameters

a:Vector3D
 
b:Vector3D
 
out:Vector3D (default = null)

Returns
Vector3D
min()method 
public static function min(a:Vector3D, b:Vector3D, out:Vector3D = null):Vector3D

Parameters

a:Vector3D
 
b:Vector3D
 
out:Vector3D (default = null)

Returns
Vector3D
mirror()method 
public static function mirror(vector:Vector3D, normal:Vector3D, out:Vector3D = null):Vector3D

Returns the vector mirrored with respect to another.

Parameters

vector:Vector3D — Source vector that is to be mirrored.
 
normal:Vector3D — Plane normal on which the source vector is to be mirrored.
 
out:Vector3D (default = null) — Vector where the result is to be returned.

Returns
Vector3D — If the 'out' parameter is 'null', a new Vector3D with the result will be returned. Otherwise, the same vector passed to the 'out' parameter will be returned.
negate()method 
public static function negate(a:Vector3D, out:Vector3D = null):Vector3D

Calculates the inverse vector of another vector.

Parameters

a:Vector3D — Vector to be tested.
 
out:Vector3D (default = null) — Vector where the result is to be returned.

Returns
Vector3D — If the 'out' parameter is 'null', a new Vector3D with the result will be returned. Otherwise, the same vector passed to the 'out' parameter will be returned.
random()method 
public static function random(min:Number, max:Number, out:Vector3D = null):Vector3D

Fills a vector with random numbers in a defined range.

Parameters

min:Number — Minimum number that values can hold.
 
max:Number — Maximum number that values can hold.
 
out:Vector3D (default = null) — Vector where the result is to be returned.

Returns
Vector3D — If the 'out' parameter is 'null', a new Vector3D with the result will be returned. Otherwise, the same vector passed to the 'out' parameter will be returned.
set()method 
public static function set(a:Vector3D, x:Number = 0, y:Number = 0, z:Number = 0, w:Number = 0):void

Sets the values for a vector.

Parameters

a:Vector3D — Vector to be set.
 
x:Number (default = 0) — X component of the vector.
 
y:Number (default = 0) — Y component of the vector.
 
z:Number (default = 0) — Z component fo the vector.
 
w:Number (default = 0)

setLength()method 
public static function setLength(a:Vector3D, length:Number):void

Sets a scale for a vector.

Parameters

a:Vector3D — Vector whose scale is to be set.
 
length:Number — Scale to be set.

sub()method 
public static function sub(a:Vector3D, b:Vector3D, out:Vector3D = null):Vector3D

Calculates the subtraction of two vectors.

Parameters

a:Vector3D — First vector.
 
b:Vector3D — Second vector.
 
out:Vector3D (default = null) — Vector3D-type object where the result is to be returned.

Returns
Vector3D — If the 'out' parameter is 'null', a new Vector3D with the result will be returned. Otherwise, the same vector passed to the 'out' parameter will be returned.
Constant Detail
BACKConstant
public static const BACK:Vector3D

Vector that defines the (0,0,-1) constant.

DOWNConstant 
public static const DOWN:Vector3D

Vector that defines the (0,-1,0) constant.

FORWARDConstant 
public static const FORWARD:Vector3D

Vector that defines the (0,0,1) constant.

LEFTConstant 
public static const LEFT:Vector3D

Vector that defines the (-1,0,0) constant.

ONEConstant 
public static const ONE:Vector3D

Vector that defines the (1,1,1) constant.

RIGHTConstant 
public static const RIGHT:Vector3D

Vector that defines the (1,0,0) constant.

UPConstant 
public static const UP:Vector3D

Vector that defines the (0,1,0) constant.

ZEROConstant 
public static const ZERO:Vector3D

Vector that defines the (0,0,0) constant.