User Tools

Site Tools


DzInt2

A two dimensional integer-based vector.

More...

Inherits :

Properties

Constructors

DAZ Script
DzInt2 ()
DzInt2 ( DzVec2 vec )
DzInt2 ( DzInt2 vec )
DzInt2 ( Array vals )
DzInt2 ( Number x, Number y )

Methods

DAZ Script
voidabs ()
DzInt2add ( DzInt2 vec )
Numberaverage ()
voidclamp ( Number min, Number max )
DzInt2clamped ( Number min, Number max )
DzInt2clampedMax ( Number max )
DzInt2clampedMin ( Number min )
voidclampMax ( Number max )
voidclampMin ( Number min )
DzInt2divide ( DzInt2 vec )
BooleanisNull ()
Numberlength ()
NumberlengthSquared ()
DzInt2linearInterp ( Number t, DzInt2 v1, DzInt2 v2 )
voidmakeIdentity ()
voidmakeZero ()
NumbermanhattanLength ()
DzInt2modulate ( Number min, Number max )
voidmodulo ( Number min, Number max )
DzInt2multiply ( DzInt2 vec )
voidnegate ()
voidsetLength ( Number length )
voidsquare ()
DzInt2subtract ( DzInt2 vec )
voidtranspose ()

Detailed Description

See Also:

Since:

  • 4.6.4.88

Properties


Number : height

Holds the height of this vector; an alias to the y value.


Number : width

Holds the width of this vector; an alias for the x value.


Number : x

Holds the x value of this vector.


Number : y

Holds the y value of this vector.

Constructors


DzInt2()

Default Constructor. Creates an uninitialized vector.


DzInt2( DzVec2 vec )

Copy Constructor.


DzInt2( DzInt2 vec )

Copy Constructor.


DzInt2( Array vals )

Creates and inititializes this vector with an array of 2 integer values.


DzInt2( Number x, Number y )

Creates and inititializes this vector with 2 integers.

Methods


void : abs()

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


DzInt2 : add( DzInt2 vec )

Return Value:

  • The result of adding another vector 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

DzInt2 : 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

DzInt2 : 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

DzInt2 : 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):

  • max - The minimum value.

Since:

  • 4.9.3.118

DzInt2 : divide( DzInt2 vec )

Return Value:

  • The result of dividing this vector by another vector.

Boolean : isNull()

Return Value:

  • true if both values are zero (0, 0), otherwise false.

Number : length()

Return Value:

  • The length of this vector.

Number : lengthSquared()

Return Value:

  • The length of this vector, squared.

DzInt2 : linearInterp( Number t, DzInt2 v1, DzInt2 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. v2 if t = 1. Values outside the 0 ⇐ t ⇐ 1 range may also be used to return an extrapolated vector.

Since:

  • 4.9.3.118

void : makeIdentity()

Sets this vector to (1, 1).


void : makeZero()

Sets this vector to (0, 0).


Number : manhattanLength()

Return Value:

  • The rectilinear distance of this vector.

DzInt2 : 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

DzInt2 : multiply( DzInt2 vec )

Return Value:

  • The result of multiplying this vector by another vector.

void : negate()

Negates each component of this vector.


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.


DzInt2 : subtract( DzInt2 vec )

Return Value:

  • The result of subtracting another vector from this vector.

void : transpose()

Swaps the values of x and y.