Vec3_c (struct)

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

注釈

Vec3_c utilizes the KL ベクタ関数

参考

Vec2, Vec4, Xfo

/*
** Example: Vec3_c
*/

Vec3_c v(0.0, 0.0, 0.0);

Vec3_c Vec3_c Vec3_c

Members

Complex x  
Complex y  
Complex z  

Methods

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

Operators

  - Vec3_c
Vec3_c = ( Param other )

Methods in detail

Vec3_c ( in Complex value )

Constructor with same scalar for all components


Vec3_c ( in Complex x, in Complex y, in Complex z )

Constructor from scalar components


Vec3_c ( in Vec3_c other )

copy constructor


Vec3_c ()

Default constructor


Vec3_c Vec3_c.add? ( in Vec3_c other )

Overload method for the add operator


Boolean Vec3_c.almostEqual? ( in Vec3_c other )

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


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


Vec3_c Vec3_c.clone? ()

clone method


Complex Vec3_c.component? ( in Size i )

Returns the component of this vector by index


Vec3_c Vec3_c.cross? ( in Vec3_c other )

Returns the cross product of this vector and another one


Complex Vec3_c.distanceTo? ( in Vec3_c other )

Returns the distance of this vector to another one


Vec3_c Vec3_c.divide? ( in Vec3_c other )

Overload method for the divide operator


Vec3_c Vec3_c.divideComplex? ( in Complex other )

Returns the division of this vector and a scalar


Complex Vec3_c.dot? ( in Vec3_c other )

Returns the dot product of this vector and another one


Boolean Vec3_c.equal? ( in Vec3_c other )

Returns true if this vector is the same as another one


UInt32 Vec3_c.hash? ()

Hash for this value


Vec3_c Vec3_c.inverse? ()

Returns the inversed version of this vector


Complex Vec3_c.length? ()

Returns the length of this vector


Complex Vec3_c.lengthSquared? ()

Returns the squared length of this vector


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

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


Vec3_c Vec3_c.multiply? ( in Vec3_c other )

Overload method for the multiply operator


Vec3_c Vec3_c.multiplyComplex? ( in Complex other )

Returns the product of this vector and a scalar


Vec3_c Vec3_c.negate? ()

Returns the negated version of this vector


Vec3_c.normalize! ()


Vec3_c Vec3_c.safeInverse? ()

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


Vec3_c.set! ( in Complex value )

Setter from same scalar for all components


Vec3_c.set! ( in Complex x, in Complex y, in Complex z )

Setter from scalar components


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

Sets the component of this vector by index


Vec3_c.setNull! ()

Sets all components of this vec to 0.0


Complex Vec3_c.setUnit! ()

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


Vec3_c Vec3_c.subtract? ( in Vec3_c other )

Overload method for the subtract operator


Vec3_c Vec3_c.unit? ()

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


Vec3_c Vec3_c.unit_safe? ()

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

Operators in detail

unary -


Vec3_c = ( Param other )

Adds a vector to this one