Class Index | File Index

Classes


Class VENISON.UTILITIES.Vector2

A 2D Vector utility class.
Defined in: venison_engine.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
 
x
The horizontal component of the vector.
 
y
The vertical component of the vector.
Method Summary
Method Attributes Method Name and Description
 
fnAdd(iVector)
Add a vector to this one.
 
Copy the vector.
 
fnCross(iVector)
Calculate the cross product between this vector and another.
 
fnDot(iVector)
Calculate the dot product between this vector and another.
 
fnIncrementBy(iVector)
Increment the values of the vector.
 
Get the length of the vector.
 
Get the square length of the vector.
 
Multiply the vector with a scalar.
 
Negate the vector.
 
Normalize the vector.
 
fnRotate(iAngle)
Get a rotated version of this Vector2.
 
fnSubtract(iVector)
Subtract a vector from this one.
Class Detail
VENISON.UTILITIES.Vector2(iX, iY)
Parameters:
{Number} iX
The horizontal component of the vector.
{Number} iY
The vertical component of the vector.
Field Detail
{Number} x
The horizontal component of the vector.

{Number} y
The vertical component of the vector.
Method Detail
{VENISON.UTILITIES.Vector2} fnAdd(iVector)
Add a vector to this one.
Parameters:
{VENISON.UTILITIES.Vector2} iVector
The vector to add to this one.
Returns:
{VENISON.UTILITIES.Vector2} A new Vector2.

{VENISON.UTILITIES.Vector2} fnCopy()
Copy the vector.
Returns:
{VENISON.UTILITIES.Vector2} A new Vector2 that is identical to the original one.

{Number} fnCross(iVector)
Calculate the cross product between this vector and another. NOTE: The cross product is not actually defined in 2D, but no one can stop us from pretending!
Parameters:
{VENISON.UTILITIES.Vector2} iVector
The vector to cross this vector with.
Returns:
{Number} This function returns the scalar value of the z-component of the vector derived from the cross product of this vector and iVector, when pretending they are 3D vectors with 0 as their z-values.

{Number} fnDot(iVector)
Calculate the dot product between this vector and another.
Parameters:
{VENISON.UTILITIES.Vector2} iVector
The vector to scalarly multiply this vector with.
Returns:
{Number} The dot product.

fnIncrementBy(iVector)
Increment the values of the vector.
Parameters:
{VENISON.UTILITIES.Vector2} iVector
The vector containing the values to increment this vector by.

{Number} fnLength()
Get the length of the vector.
Returns:
{Number} The length of this vector.

{Number} fnLengthSquared()
Get the square length of the vector.
Returns:
{Number} The square length of this vector.

{VENISON.UTILITIES.Vector2} fnMultiplyScalar(iScalar)
Multiply the vector with a scalar. Returns the result, leaving this Vector2 unaffected.
Parameters:
{Number} iScalar
The scalar value to multiply this vector with.
Returns:
{VENISON.UTILITIES.Vector2} The result of the scalar multiplication.

{VENISON.UTILITIES.Vector2} fnNegated()
Negate the vector.
Returns:
{VENISON.UTILITIES.Vector2} A new Vector2.

fnNormalize()
Normalize the vector.

{VENISON.UTILITIES.Vector2} fnRotate(iAngle)
Get a rotated version of this Vector2. This Vector2 is not affected.
Parameters:
{Number} iAngle
The angle in radians.
Returns:
{VENISON.UTILITIES.Vector2} The rotated Vector2.

{VENISON.UTILITIES.Vector2} fnSubtract(iVector)
Subtract a vector from this one.
Parameters:
{VENISON.UTILITIES.Vector2} iVector
The vector to subtract from this one.
Returns:
{VENISON.UTILITIES.Vector2} A new Vector2.

Documentation generated by JsDoc Toolkit 2.4.0 on Thu May 05 2011 18:47:29 GMT+0200 (CEST)