Vec4_i (struct)¶
The Vec4_i type represents a vector with 4 components. The Vec4_i is also used as the row type for the Mat44.
注釈
Vec4_i utilizes the KL ベクタ関数
/*
** Example: Vec4_i
*/
Vec4_i v(0.0, 0.0, 0.0, 0.0);
Methods¶
Vec4_i ( in SInt32 value ) | |
Vec4_i ( in SInt32 x, in SInt32 y, in SInt32 z, in SInt32 t ) | |
Vec4_i ( in Vec4_i other ) | |
Vec4_i () | |
Vec4_i | add ? ( in Vec4_i other ) |
Boolean | almostEqual ? ( in Vec4_i other ) |
Boolean | almostEqual ? ( in Vec4_i other, in SInt32 precision ) |
SInt32 | angleTo ? ( in Vec4_i other ) |
Vec4_i | clamp ? ( in Vec4_i min, in Vec4_i max ) |
Vec4_i | clone ? () |
SInt32 | component ? ( in Size i ) |
SInt32 | distanceTo ? ( in Vec4_i other ) |
Vec4_i | divide ? ( in Vec4_i other ) |
Vec4_i | divideSInt32 ? ( in SInt32 other ) |
SInt32 | dot ? ( in Vec4_i other ) |
Boolean | equal ? ( in Vec4_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 ? () |
Vec4_i | inverse ? () |
SInt32 | length ? () |
SInt32 | lengthSquared ? () |
Vec4_i | linearInterpolate ? ( in Vec4_i other, in SInt32 t ) |
Vec3_i | makeHomogeneousVec3_i ? () |
Vec4_i | multiply ? ( in Vec4_i other ) |
Vec4_i | multiplySInt32 ? ( in SInt32 other ) |
Vec4_i | negate ? () |
normalize ! () | |
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, in SInt32 t ) | |
set ! ( in Vec3_i v ) | |
setComponent ! ( in Size i, in SInt32 v ) | |
setNull ! () | |
SInt32 | setUnit ! () |
Vec4_i | subtract ? ( in Vec4_i other ) |
Vec3_i | toVec3_i ? () |
Vec4_i | unit ? () |
SInt32 | unitsAngleTo ? ( in Vec4_i other ) |
Vec3_i | xyz ? () |
Methods in detail¶
Constructor with same scalar for all components
Vec4_i ( in SInt32 x, in SInt32 y, in SInt32 z, in SInt32 t )
Constructor from scalar components
copy constructor
Vec4_i ()
Default constructor
Vec4_i Vec4_i.add? ( in Vec4_i other )
Overload method for the add operator
Boolean Vec4_i.almostEqual? ( in Vec4_i other )
Returns true if this vector is the same as another one (using a default precision)
Boolean Vec4_i.almostEqual? ( in Vec4_i other, in SInt32 precision )
Returns true if this vector is the same as another one (given a precision)
SInt32 Vec4_i.angleTo? ( in Vec4_i other )
Returns the angle (in radians) of this vector to the given vector
Vec4_i Vec4_i.clamp? ( in Vec4_i min, in Vec4_i max )
clamps this vector per component by a min and max vector
clone method
SInt32 Vec4_i.component? ( in Size i )
Returns the component of this vector by index
SInt32 Vec4_i.distanceTo? ( in Vec4_i other )
Returns the distance of this vector to the given vector
Vec4_i Vec4_i.divide? ( in Vec4_i other )
Overload method for the divide operator
Vec4_i Vec4_i.divideSInt32? ( in SInt32 other )
Returns the division of this vector and a scalar
SInt32 Vec4_i.dot? ( in Vec4_i other )
Returns the dot product of this vector and another one
Boolean Vec4_i.equal? ( in Vec4_i other )
Returns true if this vector is the same as another one
Vec4_i.get? ( io Float32 v<> )
Getter as external float32 array
Vec4_i.get? ( io Float32 v<>, in UInt32 o )
Getter as external float32 array and an offset
Vec4_i.get? ( io Float32 v[] )
Getter as float32 array
Vec4_i.get? ( io Float32 v[], in UInt32 o )
Getter as float32 array and an offset
Vec4_i.get? ( io Float64 v<> )
Getter as external float64 array
Vec4_i.get? ( io Float64 v<>, in UInt32 o )
Getter as external float64 array and an offset
Vec4_i.get? ( io Float64 v[] )
Getter as float64 array
Vec4_i.get? ( io Float64 v[], in UInt32 o )
Getter as float64 array and an offset
Hash for this value
Returns the inversed version of this vector
Returns the length of this vector
SInt32 Vec4_i.lengthSquared? ()
Returns the squared length of this vector
Vec4_i Vec4_i.linearInterpolate? ( in Vec4_i other, in SInt32 t )
Linearly interpolates this vector with the given vector based on a scalar blend value (0.0 to 1.0)
Vec3_i Vec4_i.makeHomogeneousVec3_i? ()
Returns a homogeneous Vec3_i
Vec4_i Vec4_i.multiply? ( in Vec4_i other )
Overload method for the multiply operator
Vec4_i Vec4_i.multiplySInt32? ( in SInt32 other )
Returns the product of this vector and a scalar
Returns the negated version of this vector
Vec4_i.normalize! ()
Vec4_i.set! ( in Float32 v<> )
Setter from (standard/external) float32 array
Vec4_i.set! ( in Float32 v<>, in UInt32 o )
Setter from (standard/external) float32 array and an offset
Vec4_i.set! ( in Float64 v<> )
Setter from (standard/external) float64 array
Vec4_i.set! ( in Float64 v<>, in UInt32 o )
Setter from (standard/external) float64 array and an offset
Vec4_i.set! ( in SInt32 value )
Setter from same scalar for all components
Vec4_i.set! ( in SInt32 x, in SInt32 y, in SInt32 z, in SInt32 t )
Setter from scalar components
Setter from a Vec3_i (t = 1.0)
Vec4_i.setComponent! ( in Size i, in SInt32 v )
Sets the component of this vector by index
Vec4_i.setNull! ()
Sets all components of this vec to 0.0
Sets this vector to its unit vector and returns its previous length
Vec4_i Vec4_i.subtract? ( in Vec4_i other )
Overload method for the subtract operator
Returns the X, Y and Z components as Vec3_i
Returns the unit vector of this one
SInt32 Vec4_i.unitsAngleTo? ( in Vec4_i other )
Returns the angle (in radians) of this vector to the given vector
注釈
expects both vectors to be units (else use angleTo)
Returns a Vec3_i containing the X, Y and Z components.