Vec3_i.kl

Types

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);

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 )

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_i

Vec3_i mathRandomVec3_i ( in Size seed, in Size index, in Float32 min, in Float32 max )