Vec2_i.kl

Types

Vec2_i (struct)

The Vec2_i type represents a vector with 2 components. The Vec2_i is also used as the row type for the Mat22.

参考

Vec3, Vec4

/*
** Example: Vec2_i
*/

Vec2_i v(0.0, 0.0);

Members

SInt32 x  
SInt32 y  

Methods

  Vec2_i ( in SInt32 value )
  Vec2_i ( in SInt32 x, in SInt32 y )
  Vec2_i ( in Vec2_i other )
  Vec2_i ()
Vec2_i add ? ( in Vec2_i other )
Boolean almostEqual ? ( in Vec2_i other )
Boolean almostEqual ? ( in Vec2_i other, in SInt32 precision )
SInt32 angleTo ? ( in Vec2_i other )
Vec2_i clamp ? ( in Vec2_i min, in Vec2_i max )
Vec2_i clone ? ()
SInt32 component ? ( in Size i )
SInt32 cross ? ( in Vec2_i other )
SInt32 distanceTo ? ( in Vec2_i other )
SInt32 distanceToLine ? ( in Vec2_i lineP0, in Vec2_i lineP1 )
SInt32 distanceToSegment ? ( in Vec2_i segmentP0, in Vec2_i segmentP1 )
Vec2_i divide ? ( in Vec2_i other )
Vec2_i divideSInt32 ? ( in SInt32 other )
SInt32 dot ? ( in Vec2_i other )
Boolean equal ? ( in Vec2_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 )
Vec2_i getBarycentricCoords ? ( in Vec2_i a, in Vec2_i b, in Vec2_i c )
UInt32 hash ? ()
Vec2_i inverse ? ()
Boolean isInsideTriangle ? ( in Vec2_i a, in Vec2_i b, in Vec2_i c )
Boolean isInsideTriangle ? ( in Vec2_i a, in Vec2_i b, in Vec2_i c, in SInt32 tolerance )
SInt32 length ? ()
SInt32 lengthSquared ? ()
Vec2_i linearInterpolate ? ( in Vec2_i other, in SInt32 t )
Vec2_i multiply ? ( in Vec2_i other )
Vec2_i multiplySInt32 ? ( in SInt32 other )
Vec2_i negate ? ()
  normalize ! ()
Vec2_i rotate ? ( in SInt32 radians )
  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 )
  setComponent ! ( in Size i, in SInt32 v )
  setNull ! ()
SInt32 setUnit ! ()
Vec2_i subtract ? ( in Vec2_i other )
Vec2_i unit ? ()
Vec2_i unit_safe ? ()
SInt32 unitsAngleTo ? ( in Vec2_i other )

Operators

  - Vec2_i
Vec2_i = ( Param other )

Functions

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

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

mathRandomVec2_i

Vec2_i mathRandomVec2_i ( in Size seed, in Size index, in Float32 min, in Float32 max )

checkLineIntersection

Vec2_d checkLineIntersection ( in Vec2_d p0, in Vec2_d p1, in Vec2_d p2, in Vec2_d p3 )

Returns the intersection point of two lines formed by p0 and p1 as well as p2 and p3. Returns :ref:`Vec2_d <vec2_d>`(SCALAR_INFINITE) if there is no intersection.

checkSegmentIntersection

Vec2_d checkSegmentIntersection ( in Vec2_d p0, in Vec2_d p1, in Vec2_d p2, in Vec2_d p3 )

Returns the intersection point of two segments formed by p0 and p1 as well as p2 and p3. Returns :ref:`Vec2_d <vec2_d>`(SCALAR_INFINITE) if there is no intersection.