User Tools

Site Tools


DzVec3

A three dimensional floating-point-based vector.

More...

Inherits :

Properties

DAZ Script
Numberx
Numbery
Numberz

Constructors

DAZ Script
DzVec3 ()
DzVec3 ( String vec )
DzVec3 ( DzVec3 vec )
DzVec3 ( Array vals )
DzVec3 ( Number x, Number y, Number z )

Methods

DAZ Script
voidabs ()
DzVec3add ( DzVec3 vec )
Numberaverage ()
voidclamp ( Number min, Number max )
DzVec3clamped ( Number min, Number max )
DzVec3clampedMax ( Number max )
DzVec3clampedMin ( Number min )
voidclampMax ( Number max )
voidclampMin ( Number min )
DzVec3cross ( DzVec3 vec )
DzVec3divide ( DzVec3 vec )
Numberdot ( DzVec3 vec )
Booleanequals ( DzVec3 vec, Number tolerance=1e-6 )
NumbergetAngleTo ( DzVec3 vec )
DzQuatgetRotationTo ( DzVec3 vec )
DzVec3identity ()
Numberlength ()
NumberlengthSquared ()
DzVec3linearInterp ( Number t, DzVec3 v1, DzVec3 v2 )
voidmakeIdentity ()
voidmakeZero ()
DzVec3modulate ( Number min, Number max )
voidmodulo ( Number min, Number max )
DzVec3multiply ( DzVec3 vec )
voidnegate ()
voidnormalize ()
DzVec3normalized ()
voidsetLength ( Number length )
voidsquare ()
DzVec3subtract ( DzVec3 vec )
StringtoString ()
DzVec3zero ()

Detailed Description

See Also:

Properties


Number : x

Holds the x component of this vector.


Number : y

Holds the y component of this vector.


Number : z

Holds the z component of this vector.

Constructors


DzVec3()

Default Constructor. Creates an uninitialized vector.


DzVec3( String vec )

Creates a vector by parsing a string.

Parameter(s):

  • vec - A string representation of the vector in the form "[ x, y, z ]"

DzVec3( DzVec3 vec )

Copy Constructor.


DzVec3( Array vals )

Creates and initializes this vector with an array of 3 float values.

Since:

  • 4.6.4.88

DzVec3( Number x, Number y, Number z )

Creates and initializes this vector with 3 float values.

Methods


void : abs()

Sets the value of each component to its respective absolute value.


DzVec3 : add( DzVec3 vec )

Parameter(s):

  • vec - The vector to add to this vector.

Return Value:

  • A vector that is the result of adding vec to this vector.

Number : average()

Return Value:

  • The average of each component of this vector.

Since:

  • 4.9.3.118

void : clamp( Number min, Number max )

Clamps each component of this vector.

Parameter(s):

  • min - The minimum value.
  • max - The maximum value.

Since:

  • 4.9.3.118

DzVec3 : clamped( Number min, Number max )

Parameter(s):

  • min - The minimum value.
  • max - The maximum value.

Return Value:

  • A copy of this vector where each component has been clamped to min and max.

Since:

  • 4.9.3.118

DzVec3 : clampedMax( Number max )

Parameter(s):

  • max - The maximum value.

Return Value:

  • A copy of this vector where each component has been clamped to max.

Since:

  • 4.9.3.118

DzVec3 : clampedMin( Number min )

Parameter(s):

  • min - The minimum value.

Return Value:

  • A copy of this vector where each component has been clamped to min.

Since:

  • 4.9.3.118

void : clampMax( Number max )

Clamps the maximum value for each component of this vector.

Parameter(s):

  • max - The maximum value.

Since:

  • 4.9.3.118

void : clampMin( Number min )

Clamps the minimum value for each component of this vector.

Parameter(s):

  • min - The minimum value.

Since:

  • 4.9.3.118

DzVec3 : cross( DzVec3 vec )

Parameter(s):

  • vec - The target vector.

Return Value:

  • The cross product of this vector and another vector.

DzVec3 : divide( DzVec3 vec )

Parameter(s):

  • vec - The vector to divide by this vector.

Return Value:

  • A vector that is the result of dividing vec by this vector.

Number : dot( DzVec3 vec )

Parameter(s):

  • vec - The target vector.

Return Value:

  • The dot product of this vector and another vector.

Boolean : equals( DzVec3 vec, Number tolerance=1e-6 )

Tests if this vector and another vector are considered equal, within a tolerance.

Parameter(s):

  • vec - The vector to compare this vector against.
  • tolerance - The amount of deviation allowed.

Return Value:

  • true if all components are within tolerance of the components of the given vector.

Since:

  • 4.9.3.118

Number : getAngleTo( DzVec3 vec )

Parameter(s):

  • vec - The target vector.

Return Value:

  • The angle between this vector and a target vector. The sign of the angle is such that, when applied, it will swing this vector to the target vector.

DzQuat : getRotationTo( DzVec3 vec )

Parameter(s):

  • vec - The target vector.

Return Value:

  • The rotation that will swing this vector to the target vector.

DzVec3 : identity()

Return Value:

  • A vector with components set to (1.0, 1.0, 1.0).

Since:

  • 4.14.1.27

Number : length()

Return Value:

  • The length of this vector.

Number : lengthSquared()

Return Value:

  • The length of this vector, squared.

DzVec3 : linearInterp( Number t, DzVec3 v1, DzVec3 v2 )

Performs a linear interpolation between v1 and v2 based on the value of t.

Parameter(s):

  • t - The value to evaluate.
  • vec1 - The first vector.
  • vec2 - The second vector.

Return Value:

  • v1 if t = 0.0. v2 if t = 1.0. Values outside the 0.0 ⇐ t ⇐ 1.0 range may also be used to return an extrapolated vector.

Since:

  • 4.9.3.118

void : makeIdentity()

Sets the components of this vector to (1.0, 1.0, 1.0).


void : makeZero()

Sets the components of this vector to (0.0, 0.0, 0.0).


DzVec3 : modulate( Number min, Number max )

Parameter(s):

  • min - The minimum value.
  • max - The maximum value.

Return Value:

  • A copy of this vector where each component has been modulated by min and max.

Since:

  • 4.9.3.118

void : modulo( Number min, Number max )

Modulates each component of this vector.

Parameter(s):

  • min - The minimum value.
  • max - The maximum value.

Since:

  • 4.9.3.118

DzVec3 : multiply( DzVec3 vec )

Parameter(s):

  • vec - The vector to multiply by this vector.

Return Value:

  • A vector that is the result of multiplying vec by this vector.

void : negate()

Negates each component of this vector.


void : normalize()

Modifies this vector to be its unit length.


DzVec3 : normalized()

Return Value:

  • A copy of this vector that has been normalized.

void : setLength( Number length )

Sets this vector to have a specific length in the current direction.

Parameter(s):

  • newLength - The length to set.

See Also:


void : square()

Sets the value of each component to its respective squared value.


DzVec3 : subtract( DzVec3 vec )

Parameter(s):

  • vec - The vector to subtract from this vector.

Return Value:

  • A vector that is the result of subtracting vec from this vector.

String : toString()

Return Value:

  • A string representation of this vector in the form "[ x, y, z ]".

DzVec3 : zero()

Return Value:

  • A vector with components set to (0.0, 0.0, 0.0).

Since:

  • 4.14.1.27