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