Vec3_cd (struct)

The Vec3_cd type represents a vector with 3 components. The Vec3_cd is also used as the row type for the Mat33.

注釈

Vec3_cd utilizes the KL ベクタ関数

参考

Vec2, Vec4, Xfo

/*
** Example: Vec3_cd
*/

Vec3_cd v(0.0, 0.0, 0.0);

Vec3_cd Vec3_cd Vec3_cd

Members

Complex_d x  
Complex_d y  
Complex_d z  

Methods

  Vec3_cd ( in Complex_d value )
  Vec3_cd ( in Complex_d x, in Complex_d y, in Complex_d z )
  Vec3_cd ( in Vec3_cd other )
  Vec3_cd ()
Vec3_cd add ? ( in Vec3_cd other )
Boolean almostEqual ? ( in Vec3_cd other )
Boolean almostEqual ? ( in Vec3_cd other, in Float32 precision )
Vec3_cd clone ? ()
Complex_d component ? ( in Size i )
Vec3_cd cross ? ( in Vec3_cd other )
Complex_d distanceTo ? ( in Vec3_cd other )
Vec3_cd divide ? ( in Vec3_cd other )
Vec3_cd divideComplex_d ? ( in Complex_d other )
Complex_d dot ? ( in Vec3_cd other )
Boolean equal ? ( in Vec3_cd other )
UInt32 hash ? ()
Vec3_cd inverse ? ()
Complex_d length ? ()
Complex_d lengthSquared ? ()
Vec3_cd linearInterpolate ? ( in Vec3_cd other, in Complex_d t )
Vec3_cd multiply ? ( in Vec3_cd other )
Vec3_cd multiplyComplex_d ? ( in Complex_d other )
Vec3_cd negate ? ()
  normalize ! ()
Vec3_cd safeInverse ? ()
  set ! ( in Complex_d value )
  set ! ( in Complex_d x, in Complex_d y, in Complex_d z )
  setComponent ! ( in Size i, in Complex_d v )
  setNull ! ()
Complex_d setUnit ! ()
Vec3_cd subtract ? ( in Vec3_cd other )
Vec3_cd unit ? ()
Vec3_cd unit_safe ? ()

Operators

  - Vec3_cd
Vec3_cd = ( Param other )

Methods in detail

Vec3_cd ( in Complex_d value )

Constructor with same scalar for all components


Vec3_cd ( in Complex_d x, in Complex_d y, in Complex_d z )

Constructor from scalar components


Vec3_cd ( in Vec3_cd other )

copy constructor


Vec3_cd ()

Default constructor


Vec3_cd Vec3_cd.add? ( in Vec3_cd other )

Overload method for the add operator


Boolean Vec3_cd.almostEqual? ( in Vec3_cd other )

Returns true if this vector is the same as another one (using a default precision)


Boolean Vec3_cd.almostEqual? ( in Vec3_cd other, in Float32 precision )


Vec3_cd Vec3_cd.clone? ()

clone method


Complex_d Vec3_cd.component? ( in Size i )

Returns the component of this vector by index


Vec3_cd Vec3_cd.cross? ( in Vec3_cd other )

Returns the cross product of this vector and another one


Complex_d Vec3_cd.distanceTo? ( in Vec3_cd other )

Returns the distance of this vector to another one


Vec3_cd Vec3_cd.divide? ( in Vec3_cd other )

Overload method for the divide operator


Vec3_cd Vec3_cd.divideComplex_d? ( in Complex_d other )

Returns the division of this vector and a scalar


Complex_d Vec3_cd.dot? ( in Vec3_cd other )

Returns the dot product of this vector and another one


Boolean Vec3_cd.equal? ( in Vec3_cd other )

Returns true if this vector is the same as another one


UInt32 Vec3_cd.hash? ()

Hash for this value


Vec3_cd Vec3_cd.inverse? ()

Returns the inversed version of this vector


Complex_d Vec3_cd.length? ()

Returns the length of this vector


Complex_d Vec3_cd.lengthSquared? ()

Returns the squared length of this vector


Vec3_cd Vec3_cd.linearInterpolate? ( in Vec3_cd other, in Complex_d t )

Linearly interpolates this vector with another one based on a scalar blend value (0.0 to 1.0)


Vec3_cd Vec3_cd.multiply? ( in Vec3_cd other )

Overload method for the multiply operator


Vec3_cd Vec3_cd.multiplyComplex_d? ( in Complex_d other )

Returns the product of this vector and a scalar


Vec3_cd Vec3_cd.negate? ()

Returns the negated version of this vector


Vec3_cd.normalize! ()


Vec3_cd Vec3_cd.safeInverse? ()

Returns the inversed version of this vector by correcting bad components.


Vec3_cd.set! ( in Complex_d value )

Setter from same scalar for all components


Vec3_cd.set! ( in Complex_d x, in Complex_d y, in Complex_d z )

Setter from scalar components


Vec3_cd.setComponent! ( in Size i, in Complex_d v )

Sets the component of this vector by index


Vec3_cd.setNull! ()

Sets all components of this vec to 0.0


Complex_d Vec3_cd.setUnit! ()

Sets this vector to its unit vector and returns its previous length


Vec3_cd Vec3_cd.subtract? ( in Vec3_cd other )

Overload method for the subtract operator


Vec3_cd Vec3_cd.unit? ()

Returns the unit vector of this one, throws and exception if almost zero length


Vec3_cd Vec3_cd.unit_safe? ()

Returns the unit vector of this one, with an arbitrary value if almost zero length

Operators in detail

unary -


Vec3_cd = ( Param other )

Adds a vector to this one