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