Vec4_c (struct)

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

注釈

Vec4_c utilizes the KL ベクタ関数

参考

Vec2, Vec3_c

/*
** Example: Vec4_c
*/

Vec4_c v(0.0, 0.0, 0.0, 0.0);

Vec4_c Vec4_c Vec4_c

Members

Complex x  
Complex y  
Complex z  
Complex t  

Methods

  Vec4_c ( in Complex value )
  Vec4_c ( in Complex x, in Complex y, in Complex z, in Complex t )
  Vec4_c ( in Vec4_c other )
  Vec4_c ()
Vec4_c add ? ( in Vec4_c other )
Boolean almostEqual ? ( in Vec4_c other )
Boolean almostEqual ? ( in Vec4_c other, in Float32 precision )
Vec4_c clone ? ()
Complex component ? ( in Size i )
Complex distanceTo ? ( in Vec4_c other )
Vec4_c divide ? ( in Vec4_c other )
Vec4_c divideComplex ? ( in Complex other )
Complex dot ? ( in Vec4_c other )
Boolean equal ? ( in Vec4_c other )
UInt32 hash ? ()
Vec4_c inverse ? ()
Complex length ? ()
Complex lengthSquared ? ()
Vec4_c linearInterpolate ? ( in Vec4_c other, in Complex t )
Vec3_c makeHomogeneousVec3_c ? ()
Vec4_c multiply ? ( in Vec4_c other )
Vec4_c multiplyComplex ? ( in Complex other )
Vec4_c negate ? ()
  normalize ! ()
  set ! ( in Complex value )
  set ! ( in Complex x, in Complex y, in Complex z, in Complex t )
  set ! ( in Vec3_c v )
  setComponent ! ( in Size i, in Complex v )
  setNull ! ()
Complex setUnit ! ()
Vec4_c subtract ? ( in Vec4_c other )
Vec3_c toVec3_c ? ()
Vec4_c unit ? ()
Vec3_c xyz ? ()

Operators

Vec4_c = ( Param other )

Methods in detail

Vec4_c ( in Complex value )

Constructor with same scalar for all components


Vec4_c ( in Complex x, in Complex y, in Complex z, in Complex t )

Constructor from scalar components


Vec4_c ( in Vec4_c other )

copy constructor


Vec4_c ()

Default constructor


Vec4_c Vec4_c.add? ( in Vec4_c other )

Overload method for the add operator


Boolean Vec4_c.almostEqual? ( in Vec4_c other )

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


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

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


Vec4_c Vec4_c.clone? ()

clone method


Complex Vec4_c.component? ( in Size i )

Returns the component of this vector by index


Complex Vec4_c.distanceTo? ( in Vec4_c other )

Returns the distance of this vector to the given vector


Vec4_c Vec4_c.divide? ( in Vec4_c other )

Overload method for the divide operator


Vec4_c Vec4_c.divideComplex? ( in Complex other )

Returns the division of this vector and a scalar


Complex Vec4_c.dot? ( in Vec4_c other )

Returns the dot product of this vector and another one


Boolean Vec4_c.equal? ( in Vec4_c other )

Returns true if this vector is the same as another one


UInt32 Vec4_c.hash? ()

Hash for this value


Vec4_c Vec4_c.inverse? ()

Returns the inversed version of this vector


Complex Vec4_c.length? ()

Returns the length of this vector


Complex Vec4_c.lengthSquared? ()

Returns the squared length of this vector


Vec4_c Vec4_c.linearInterpolate? ( in Vec4_c other, in Complex t )

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


Vec3_c Vec4_c.makeHomogeneousVec3_c? ()

Returns a homogeneous Vec3_c


Vec4_c Vec4_c.multiply? ( in Vec4_c other )

Overload method for the multiply operator


Vec4_c Vec4_c.multiplyComplex? ( in Complex other )

Returns the product of this vector and a scalar


Vec4_c Vec4_c.negate? ()

Returns the negated version of this vector


Vec4_c.normalize! ()


Vec4_c.set! ( in Complex value )

Setter from same scalar for all components


Vec4_c.set! ( in Complex x, in Complex y, in Complex z, in Complex t )

Setter from scalar components


Vec4_c.set! ( in Vec3_c v )

Setter from a Vec3_c (t = 1.0)


Vec4_c.setComponent! ( in Size i, in Complex v )

Sets the component of this vector by index


Vec4_c.setNull! ()

Sets all components of this vec to 0.0


Complex Vec4_c.setUnit! ()

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


Vec4_c Vec4_c.subtract? ( in Vec4_c other )

Overload method for the subtract operator


Vec3_c Vec4_c.toVec3_c? ()

Returns the X, Y and Z components as Vec3_c


Vec4_c Vec4_c.unit? ()

Returns the unit vector of this one


Vec3_c Vec4_c.xyz? ()

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

Operators in detail

Vec4_c = ( Param other )

Adds a vector to this one