Vec3_i (struct)

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

注釈

Vec3_i utilizes the KL ベクタ関数

参考

Vec2, Vec4, Xfo

/*
** Example: Vec3_i
*/

Vec3_i v(0.0, 0.0, 0.0);

Vec3_i Vec3_i Vec3_i

Members

SInt32 x  
SInt32 y  
SInt32 z  

Methods

  Vec3_i ( in SInt32 value )
  Vec3_i ( in SInt32 x, in SInt32 y, in SInt32 z )
  Vec3_i ( in Vec3_i other )
  Vec3_i ()
Vec3_i add ? ( in Vec3_i other )
Boolean almostEqual ? ( in Vec3_i other )
Boolean almostEqual ? ( in Vec3_i other, in SInt32 precision )
SInt32 angleTo ? ( in Vec3_i other )
Vec3_i clamp ? ( in Vec3_i min, in Vec3_i max )
Vec3_i clone ? ()
SInt32 component ? ( in Size i )
Vec3_i cross ? ( in Vec3_i other )
SInt32 distanceTo ? ( in Vec3_i other )
Vec3_i divide ? ( in Vec3_i other )
Vec3_i divideSInt32 ? ( in SInt32 other )
SInt32 dot ? ( in Vec3_i other )
Boolean equal ? ( in Vec3_i other )
  get ? ( io Float32 v<> )
  get ? ( io Float32 v<>, in UInt32 o )
  get ? ( io Float32 v[] )
  get ? ( io Float32 v[], in UInt32 o )
  get ? ( io Float64 v<> )
  get ? ( io Float64 v<>, in UInt32 o )
  get ? ( io Float64 v[] )
  get ? ( io Float64 v[], in UInt32 o )
UInt32 hash ? ()
Vec3_i inverse ? ()
SInt32 length ? ()
SInt32 lengthSquared ? ()
Vec3_i linearInterpolate ? ( in Vec3_i other, in SInt32 t )
Vec3_i multiply ? ( in Vec3_i other )
Vec3_i multiplySInt32 ? ( in SInt32 other )
Vec3_i negate ? ()
  normalize ! ()
Vec3_i safeInverse ? ()
  set ! ( in Float32 v<> )
  set ! ( in Float32 v<>, in UInt32 o )
  set ! ( in Float64 v<> )
  set ! ( in Float64 v<>, in UInt32 o )
  set ! ( in SInt32 value )
  set ! ( in SInt32 x, in SInt32 y, in SInt32 z )
  set ! ( in Vec3 v )
  set ! ( in Vec3_d v )
  set ! ( in Vec3_i v )
  setComponent ! ( in Size i, in SInt32 v )
  setNull ! ()
SInt32 setUnit ! ()
Vec3_i subtract ? ( in Vec3_i other )
Vec3 toVec3 ? ()
Vec3_i unit ? ()
Vec3_i unit_safe ? ()
SInt32 unitsAngleTo ? ( in Vec3_i other )

Operators

  - Vec3_i
Vec3_i = ( Param other )

Methods in detail

Vec3_i ( in SInt32 value )

Constructor with same scalar for all components


Vec3_i ( in SInt32 x, in SInt32 y, in SInt32 z )

Constructor from scalar components


Vec3_i ( in Vec3_i other )

copy constructor


Vec3_i ()

Default constructor


Vec3_i Vec3_i.add? ( in Vec3_i other )

Overload method for the add operator


Boolean Vec3_i.almostEqual? ( in Vec3_i other )

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


Boolean Vec3_i.almostEqual? ( in Vec3_i other, in SInt32 precision )

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


SInt32 Vec3_i.angleTo? ( in Vec3_i other )

Returns the angle (in radians) of this vector to another one


Vec3_i Vec3_i.clamp? ( in Vec3_i min, in Vec3_i max )

clamps this vector per component by a min and max vector


Vec3_i Vec3_i.clone? ()

clone method


SInt32 Vec3_i.component? ( in Size i )

Returns the component of this vector by index


Vec3_i Vec3_i.cross? ( in Vec3_i other )

Returns the cross product of this vector and another one


SInt32 Vec3_i.distanceTo? ( in Vec3_i other )

Returns the distance of this vector to another one


Vec3_i Vec3_i.divide? ( in Vec3_i other )

Overload method for the divide operator


Vec3_i Vec3_i.divideSInt32? ( in SInt32 other )

Returns the division of this vector and a scalar


SInt32 Vec3_i.dot? ( in Vec3_i other )

Returns the dot product of this vector and another one


Boolean Vec3_i.equal? ( in Vec3_i other )

Returns true if this vector is the same as another one


Vec3_i.get? ( io Float32 v<> )

Getter to (standard/external) float32 array


Vec3_i.get? ( io Float32 v<>, in UInt32 o )

Getter as external float32 array and an offset


Vec3_i.get? ( io Float32 v[] )

Getter as float32 array


Vec3_i.get? ( io Float32 v[], in UInt32 o )

Getter as float32 array and an offset


Vec3_i.get? ( io Float64 v<> )

Getter to (standard/external) float64 array


Vec3_i.get? ( io Float64 v<>, in UInt32 o )

Getter as external float64 array and an offset


Vec3_i.get? ( io Float64 v[] )

Getter as float64 array


Vec3_i.get? ( io Float64 v[], in UInt32 o )

Getter as float64 array and an offset


UInt32 Vec3_i.hash? ()

Hash for this value


Vec3_i Vec3_i.inverse? ()

Returns the inversed version of this vector


SInt32 Vec3_i.length? ()

Returns the length of this vector


SInt32 Vec3_i.lengthSquared? ()

Returns the squared length of this vector


Vec3_i Vec3_i.linearInterpolate? ( in Vec3_i other, in SInt32 t )

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


Vec3_i Vec3_i.multiply? ( in Vec3_i other )

Overload method for the multiply operator


Vec3_i Vec3_i.multiplySInt32? ( in SInt32 other )

Returns the product of this vector and a scalar


Vec3_i Vec3_i.negate? ()

Returns the negated version of this vector


Vec3_i.normalize! ()


Vec3_i Vec3_i.safeInverse? ()

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


Vec3_i.set! ( in Float32 v<> )

Setter from (standard/external) float32 array


Vec3_i.set! ( in Float32 v<>, in UInt32 o )

Setter from (standard/external) float32 array and an offset


Vec3_i.set! ( in Float64 v<> )

Setter from (standard/external) float64 array


Vec3_i.set! ( in Float64 v<>, in UInt32 o )

Setter from (standard/external) float64 array and an offset


Vec3_i.set! ( in SInt32 value )

Setter from same scalar for all components


Vec3_i.set! ( in SInt32 x, in SInt32 y, in SInt32 z )

Setter from scalar components


Vec3_i.set! ( in Vec3 v )

Setter from another vector


Vec3_i.set! ( in Vec3_d v )

Setter from another vector


Vec3_i.set! ( in Vec3_i v )

Setter from another vector


Vec3_i.setComponent! ( in Size i, in SInt32 v )

Sets the component of this vector by index


Vec3_i.setNull! ()

Sets all components of this vec to 0.0


SInt32 Vec3_i.setUnit! ()

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


Vec3_i Vec3_i.subtract? ( in Vec3_i other )

Overload method for the subtract operator


Vec3 Vec3_i.toVec3? ()


Vec3_i Vec3_i.unit? ()

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


Vec3_i Vec3_i.unit_safe? ()

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


SInt32 Vec3_i.unitsAngleTo? ( in Vec3_i other )

Returns the angle (in radians) of this vector to another one

注釈

expects both vectors to be units (else use angleTo)

Operators in detail

unary -


Vec3_i = ( Param other )

Adds a vector to this one