Harmony
Scripting Interface Documentation
Vector3d Class Reference

The Vector3d JavaScript class. Defines a three dimensional vector. More...

Public Slots

void setXYZ (double x, double y, double z)
 Set the x, y, z coordinate to the given. More...
 
bool isZero ()
 Test if Vector3d is zero. More...
 
bool isEqual (Vector3d v2)
 Test if the two vectors are equals. More...
 
bool isNotEqual (Vector3d v2)
 Test if the two vectors are not equals. More...
 
double length ()
 Retrieve length of Vector3d. More...
 
double lengthSq ()
 Retrieve square length of Vector3d. More...
 
double getCos (Vector3d v2)
 Calculate cosine angle between current Vector3d and specified Vector3d. More...
 
double getSin (Vector3d v2)
 Calculate sine angle between current Vector3d and specified Vector3d. More...
 
double dot (Vector3d v2)
 Calculate dot product between current Vector3d and specified Vector3d. More...
 
Vector3d cross (Vector3d v2)
 Calculate cross product between current Vector3d and specified Vector3d. More...
 
Vector3dproject (Vector3d v2)
 Project current Vector3d onto specified Vector3d. More...
 
Vector3d getProjection (Vector3d *v2)
 Project current Vector3d onto specified Vector3d. More...
 
double getProjectionRatio (Vector3d v2)
 Get ratio from projection of current Vector3d onto specified Vector3d. More...
 
Vector3dnormalize ()
 Normalize current Vector3d. More...
 
Vector3d getNormalized ()
 Normalize current Vector3d. More...
 
Vector3dnegate ()
 Negate current Vector3d. More...
 

Public Member Functions

 Vector3d ()
 Create a new empty Vector3d. More...
 
 Vector3d (double x, double y, double z)
 Create a new Vector3d. More...
 

Properties

double x
 x value More...
 
double y
 y value More...
 
double z
 z value More...
 

Detailed Description

The Vector3d JavaScript class. Defines a three dimensional vector.

@ The Vector3d class defines a three-dimensional vector container. Vector3d objects can be instantiated in the scripting environment.

Constructor & Destructor Documentation

◆ Vector3d() [1/2]

Vector3d::Vector3d ( )

Create a new empty Vector3d.

◆ Vector3d() [2/2]

Vector3d::Vector3d ( double  x,
double  y,
double  z 
)

Create a new Vector3d.

Parameters
xX value
yY value
zZ value

Member Function Documentation

◆ cross

Vector3d Vector3d::cross ( Vector3d  v2)
slot

Calculate cross product between current Vector3d and specified Vector3d.

Parameters
v2Second Vector3d
Returns
Cross product Vector3d value

◆ dot

double Vector3d::dot ( Vector3d  v2)
slot

Calculate dot product between current Vector3d and specified Vector3d.

Parameters
v2Second Vector3d
Returns
Dot product value

◆ getCos

double Vector3d::getCos ( Vector3d  v2)
slot

Calculate cosine angle between current Vector3d and specified Vector3d.

Parameters
v2Second Vector3d
Returns
Cosine angle

◆ getNormalized

Vector3d Vector3d::getNormalized ( )
slot

Normalize current Vector3d.

Returns
new normalized Vector3d

◆ getProjection

Vector3d Vector3d::getProjection ( Vector3d v2)
slot

Project current Vector3d onto specified Vector3d.

Parameters
v2Vector3d to project onto
Returns
new projected Vector3d

◆ getProjectionRatio

double Vector3d::getProjectionRatio ( Vector3d  v2)
slot

Get ratio from projection of current Vector3d onto specified Vector3d.

Parameters
v2Vector3d to project onto
Returns
ratio value

◆ getSin

double Vector3d::getSin ( Vector3d  v2)
slot

Calculate sine angle between current Vector3d and specified Vector3d.

Parameters
v2Second Vector3d
Returns
Sine angle

◆ isEqual

bool Vector3d::isEqual ( Vector3d  v2)
slot

Test if the two vectors are equals.

Parameters
v2Second Vector3d
Returns
Result of test

◆ isNotEqual

bool Vector3d::isNotEqual ( Vector3d  v2)
slot

Test if the two vectors are not equals.

Parameters
v2Second Vector3d
Returns
Result of test

◆ isZero

bool Vector3d::isZero ( )
slot

Test if Vector3d is zero.

Returns
Result of test

◆ length

double Vector3d::length ( )
slot

Retrieve length of Vector3d.

Returns
Length

◆ lengthSq

double Vector3d::lengthSq ( )
slot

Retrieve square length of Vector3d.

Returns
Square length

◆ negate

Vector3d& Vector3d::negate ( )
slot

Negate current Vector3d.

Returns
Vector3d reference

◆ normalize

Vector3d& Vector3d::normalize ( )
slot

Normalize current Vector3d.

Returns
Vector3d reference

◆ project

Vector3d& Vector3d::project ( Vector3d  v2)
slot

Project current Vector3d onto specified Vector3d.

Parameters
v2Vector3d to project onto
Returns
Vector3d reference

◆ setXYZ

void Vector3d::setXYZ ( double  x,
double  y,
double  z 
)
slot

Set the x, y, z coordinate to the given.

Property Documentation

◆ x

double Vector3d::x
readwrite

x value

◆ y

double Vector3d::y
readwrite

y value

◆ z

double Vector3d::z
readwrite

z value