Vec4_cd (struct)

The Vec4_cd type represents a vector with 4 components. The Vec4_cd is also used as the row type for the Mat44.

注釈

Vec4_cd utilizes the KL ベクタ関数

参考

Vec2, Vec3_cd

/*
** Example: Vec4_cd
*/

Vec4_cd v(0.0, 0.0, 0.0, 0.0);

Vec4_cd Vec4_cd Vec4_cd

Members

Complex_d x  
Complex_d y  
Complex_d z  
Complex_d t  

Methods

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

Operators

Vec4_cd = ( Param other )

Methods in detail

Vec4_cd ( in Complex_d value )

Constructor with same scalar for all components


Vec4_cd ( in Complex_d x, in Complex_d y, in Complex_d z, in Complex_d t )

Constructor from scalar components


Vec4_cd ( in Vec4_cd other )

copy constructor


Vec4_cd ()

Default constructor


Vec4_cd Vec4_cd.add? ( in Vec4_cd other )

Overload method for the add operator


Boolean Vec4_cd.almostEqual? ( in Vec4_cd other )

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


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

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


Vec4_cd Vec4_cd.clone? ()

clone method


Complex_d Vec4_cd.component? ( in Size i )

Returns the component of this vector by index


Complex_d Vec4_cd.distanceTo? ( in Vec4_cd other )

Returns the distance of this vector to the given vector


Vec4_cd Vec4_cd.divide? ( in Vec4_cd other )

Overload method for the divide operator


Vec4_cd Vec4_cd.divideComplex_d? ( in Complex_d other )

Returns the division of this vector and a scalar


Complex_d Vec4_cd.dot? ( in Vec4_cd other )

Returns the dot product of this vector and another one


Boolean Vec4_cd.equal? ( in Vec4_cd other )

Returns true if this vector is the same as another one


UInt32 Vec4_cd.hash? ()

Hash for this value


Vec4_cd Vec4_cd.inverse? ()

Returns the inversed version of this vector


Complex_d Vec4_cd.length? ()

Returns the length of this vector


Complex_d Vec4_cd.lengthSquared? ()

Returns the squared length of this vector


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

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


Vec3_cd Vec4_cd.makeHomogeneousVec3_cd? ()

Returns a homogeneous Vec3_cd


Vec4_cd Vec4_cd.multiply? ( in Vec4_cd other )

Overload method for the multiply operator


Vec4_cd Vec4_cd.multiplyComplex_d? ( in Complex_d other )

Returns the product of this vector and a scalar


Vec4_cd Vec4_cd.negate? ()

Returns the negated version of this vector


Vec4_cd.normalize! ()


Vec4_cd.set! ( in Complex_d value )

Setter from same scalar for all components


Vec4_cd.set! ( in Complex_d x, in Complex_d y, in Complex_d z, in Complex_d t )

Setter from scalar components


Vec4_cd.set! ( in Vec3_cd v )

Setter from a Vec3_cd (t = 1.0)


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

Sets the component of this vector by index


Vec4_cd.setNull! ()

Sets all components of this vec to 0.0


Complex_d Vec4_cd.setUnit! ()

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


Vec4_cd Vec4_cd.subtract? ( in Vec4_cd other )

Overload method for the subtract operator


Vec3_cd Vec4_cd.toVec3_cd? ()

Returns the X, Y and Z components as Vec3_cd


Vec4_cd Vec4_cd.unit? ()

Returns the unit vector of this one


Vec3_cd Vec4_cd.xyz? ()

Returns a Vec3_cd containing the X, Y and Z components.

Operators in detail

Vec4_cd = ( Param other )

Adds a vector to this one