Class R.math.Vector3D
Extends
R.math.Point3D.
A 3D vector class with helpful manipulation methods.
Defined in: vector3d.js.
Constructor Attributes | Constructor Name and Description |
---|---|
R.math.Vector3D(x, y, z)
Create a new 3D Vector
|
Field Attributes | Field Name and Description |
---|---|
<static> |
R.math.Vector3D.ZERO
The "zero" vector.
|
Method Attributes | Method Name and Description |
---|---|
angleBetween(vector)
Returns the angle (in degrees) between two vectors.
|
|
cross(vector)
A mutator method that gets the cross product of this vector and another.
|
|
dot(vector)
Get the dot product of this vector and another.
|
|
Return the classname of the this object
|
|
len()
Get the magnitude/length of this vector.
|
|
A mutator method that normalizes this vector, returning a unit length vector.
|
- Methods borrowed from class R.math.Point3D:
- add, addScalar, convolve, convolveInverse, dist, div, equals, isZero, mul, neg, release, set, setX, setY, setZ, simplify, sub, toString
- Methods borrowed from class R.math.PooledMathObject:
- destroy
- Methods borrowed from class R.engine.PooledObject:
- clearObjectDataModel, getId, getName, getObjectDataModel, getProperties, isDestroyed, setName, setObjectDataModel, toXML
Class Detail
R.math.Vector3D(x, y, z)
Create a new 3D Vector
- Parameters:
- x
- {R.math.Point3D|Number} If this arg is a R.math.Vector3D, its values will be copied into the new vector. If a number, the X length of the vector.
- y
- {Number} The Y length of the vector. Only required if X was a number.
- z
- {Number} The Z length of the vector. Only required if X was a number.
Field Detail
<static>
R.math.Vector3D.ZERO
The "zero" vector. This vector should not be modified.
Method Detail
{Number}
angleBetween(vector)
Returns the angle (in degrees) between two vectors. This assumes that the
point is being used to represent a vector, and that the supplied point
is also a vector.
- Parameters:
- vector
- {R.math.Vector3D} The vector to perform the angular determination against
- Returns:
- {Number} The angle between two vectors, in degrees
{R.math.Vector3D}
cross(vector)
A mutator method that gets the cross product of this vector and another.
- Parameters:
- vector
- {R.math.Vector3D} The vector to perform the operation against.
- Returns:
- {R.math.Vector3D} This vector
{Number}
dot(vector)
Get the dot product of this vector and another.
- Parameters:
- vector
- {R.math.Vector3D} The Point to perform the operation against.
- Returns:
- {Number} The dot product
{String}
getClassName()
Return the classname of the this object
- Returns:
- {String} "R.math.Vector3D"
{Number}
len()
Get the magnitude/length of this vector.
- Returns:
- {Number} A value representing the length (magnitude) of the vector.
{R.math.Vector3D}
normalize()
A mutator method that normalizes this vector, returning a unit length vector.
- Returns:
- {R.math.Vector3D} This vector, normalized
- See:
- #len