Vec3_d.kl

Types

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 ベクタ関数

参考

Vec2, Vec4, Xfo

/*
** Example: Vec3_d
*/

Vec3_d v(0.0, 0.0, 0.0);

Members

Float64 x  
Float64 y  
Float64 z  

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 )

Operators

  - Vec3_d
Vec3_d = ( Param other )

Functions

closestPointToLineRatio

Scalar closestPointToLineRatio ( in Vec3 P, in Vec3 lineP0, in Vec3 lineP1 )

Returns the line ratio for the closest line location from point P

distFromPointToLine

Scalar distFromPointToLine ( in Vec3 P, in Vec3 lineP0, in Vec3 lineP1 )

Returns the distance of this vector to a line defined by two points on the line

closestSegmentPoint

Vec3 closestSegmentPoint ( in Vec3 P, in Vec3 segmentP0, in Vec3 segmentP1, out Scalar ratio )

Returns the closest point this position to a line segment defined by the start and end points

distFromPointToSegment

Scalar distFromPointToSegment ( in Vec3 P, in Vec3 segmentP0, in Vec3 segmentP1 )

Returns the distance of this position to a line segment defined by the start and end points

distanceFromLineToLine

Float64 distanceFromLineToLine ( in Vec2_d l1_p0, in Vec2_d l1_p1, in Vec2_d l2_p0, in Vec2_d l2_p1, out Float64 l1_t, out Float64 l2_t )

dist3D_Line_to_Line(): Input: two 3D lines L1 and L2 Return: the shortest distance between L1 and L2

testCoplanarity

Boolean testCoplanarity ( in Vec3 x1, in Vec3 x2, in Vec3 x3, in Vec3 x4, in Vec3 v1, in Vec3 v2, in Vec3 v3, in Vec3 v4, out Scalar outFraction )

Coplanarity test for 4 moving points. These moving points could either be a point and a triangle, or 2 edges. The returned fraction tells us if they will be coplanar within the next time step. This algorithm is used to compute continuous collision between points and triangle, or between moving lines. Algorithm based on the following paper. http://wscg.zcu.cz/wscg2007/Papers_2007/journal/D11-full.pdf

x1 The first points position
x2 The second points position
x3 The third points position
x4 The fourth points position
v1 The first points displacement over a the given time step
v2 The second points displacement over a the given time step
v3 The third points displacement over a the given time step
v4 The fourth points displacement over a the given time step
outFraction The return value containing the fraction of the timestep where all 4 points became coplanar.

Math_min

RGBA Math_min ( in RGBA val1, in RGBA val2 )

Returns the minimum of two RGBA values

Math_max

RGBA Math_max ( in RGBA val1, in RGBA val2 )

Returns the minimum of two RGBA values

Math_clamp

Vec3_i Math_clamp ( in Vec3_i val, in Scalar minval, in Scalar maxval )

Clamps a Vec3_i value by min and max

mathRandomVec3_d

Vec3_d mathRandomVec3_d ( in Size seed, in Size index, in Float32 min, in Float32 max )