Turok
 
Loading...
Searching...
No Matches
kVec3 Class Reference

Representation of 3D vectors and points. More...

Public Member Functions

 kVec3 ()
 
 kVec3 (float x, float y, float z)
 
 kVec3 (const kVec3 &in v)
 
kVec3Normalize ()
 Makes this vector have a magnitude of 1.
 
kVec3 Cross (const kVec3 &in v) const
 Cross Product of two vectors.
 
float Dot (const kVec3 &in v) const
 Dot Product of two vectors.
 
float Length () const
 Returns the length of this vector. Exactly the same as Unit()
 
float LengthSq () const
 Returns the squared length of this vector. Exactly the same as UnitSq()
 
float DistanceSq (const kVec3 &in other) const
 Returns the squared distance between this instance and other.
 
float ToYaw ()
 Returns the Yaw direction in Rads.
 
float ToPitch ()
 Returns the Pitch direction in Rads.
 
void Clear ()
 Sets x, y and z components to 0.
 
void Set (const float x, const float y, const float z)
 Set x, y and z components of this kVec3.
 
kVec3 Lerp (const kVec3 &in other, const float t) const
 Linearly interpolates between two vectors.
 
kVec3Lerp (const kVec3 &in other, const float t)
 Linearly interpolates between two vectors.
 
kVec3Project (const kVec3 &in normal, const float value)
 Projects a vector onto another vector.
 
kVec3Reflect (const kVec3 &in normal, const float energyFactor)
 Reflects a vector off the plane defined by a normal.
 
kVec3Randomize (const float value)
 Randomizes x, y, z, components by value.
 
kVec3CubicCurve (const kVec3 &in pt1, const float value, const kVec3 &in pt2)
 
kVec3QuadraticCurve (const kVec3 &in pt1, const float value, const kVec3 &in pt2, const kVec3 &in pt3)
 
kVec3 opAdd (const kVec3 &in v) const
 
kVec3 opAdd (const float f) const
 
kVec3opAddAssign (const kVec3 &in v)
 
kVec3opAddAssign (const float f)
 
kVec3 opNeg ()
 
kVec3 opSub (const kVec3 &in v) const
 
kVec3 opSub (const float f) const
 
kVec3opSubAssign (const kVec3 &in v)
 
kVec3opSubAssign (const float f)
 
kVec3 opMul (const kVec3 &in v)
 
kVec3 opMul (const float val)
 
kVec3opMulAssign (const kVec3 &in v)
 
kVec3opMulAssign (const float f)
 
kVec3 opDiv (const kVec3 &in v)
 
kVec3 opDiv (const float val)
 
kVec3opDivAssign (const kVec3 &in v)
 
kVec3opDivAssign (const float f)
 
kVec3opAssign (const kVec3 &in v)
 
float opIndex (int i) const
 
float & opIndex (int i)
 
float Distance (const kVec3 &in other) const
 Returns the distance between this instance and other vector.
 
kStr ToString ()
 
kVec3 opMul (const kQuat &in rot) const
 
kVec3opMulAssign (const kQuat &in rot)
 
kQuat ToQuaternion () const
 
kQuat ToQuat () const
 
float Unit () const
 Returns the length of this vector. Exactly the same as Length()
 
float UnitSq () const
 Returns the squared length of this vector. Exactly the same as LengthSq()
 

Public Attributes

float x
 
float y
 
float z
 

Detailed Description

Representation of 3D vectors and points.

Definition at line 658 of file t1_scriptAPI.cpp.

Constructor & Destructor Documentation

◆ kVec3() [1/3]

kVec3::kVec3 ( )

◆ kVec3() [2/3]

kVec3::kVec3 ( float x,
float y,
float z )

◆ kVec3() [3/3]

kVec3::kVec3 ( const kVec3 &in v)

Member Function Documentation

◆ Clear()

void kVec3::Clear ( )

Sets x, y and z components to 0.

◆ Cross()

kVec3 kVec3::Cross ( const kVec3 &in v) const

Cross Product of two vectors.

◆ CubicCurve()

kVec3 & kVec3::CubicCurve ( const kVec3 &in pt1,
const float value,
const kVec3 &in pt2 )

◆ Distance()

float kVec3::Distance ( const kVec3 &in other) const

Returns the distance between this instance and other vector.

◆ DistanceSq()

float kVec3::DistanceSq ( const kVec3 &in other) const

Returns the squared distance between this instance and other.

◆ Dot()

float kVec3::Dot ( const kVec3 &in v) const

Dot Product of two vectors.

◆ Length()

float kVec3::Length ( ) const

Returns the length of this vector. Exactly the same as Unit()

◆ LengthSq()

float kVec3::LengthSq ( ) const

Returns the squared length of this vector. Exactly the same as UnitSq()

◆ Lerp() [1/2]

kVec3 & kVec3::Lerp ( const kVec3 &in other,
const float t )

Linearly interpolates between two vectors.

◆ Lerp() [2/2]

kVec3 kVec3::Lerp ( const kVec3 &in other,
const float t ) const

Linearly interpolates between two vectors.

◆ Normalize()

kVec3 & kVec3::Normalize ( )

Makes this vector have a magnitude of 1.

◆ opAdd() [1/2]

kVec3 kVec3::opAdd ( const float f) const

◆ opAdd() [2/2]

kVec3 kVec3::opAdd ( const kVec3 &in v) const

◆ opAddAssign() [1/2]

kVec3 & kVec3::opAddAssign ( const float f)

◆ opAddAssign() [2/2]

kVec3 & kVec3::opAddAssign ( const kVec3 &in v)

◆ opAssign()

kVec3 & kVec3::opAssign ( const kVec3 &in v)

◆ opDiv() [1/2]

kVec3 kVec3::opDiv ( const float val)

◆ opDiv() [2/2]

kVec3 kVec3::opDiv ( const kVec3 &in v)

◆ opDivAssign() [1/2]

kVec3 & kVec3::opDivAssign ( const float f)

◆ opDivAssign() [2/2]

kVec3 & kVec3::opDivAssign ( const kVec3 &in v)

◆ opIndex() [1/2]

float & kVec3::opIndex ( int i)

◆ opIndex() [2/2]

float kVec3::opIndex ( int i) const

◆ opMul() [1/3]

kVec3 kVec3::opMul ( const float val)

◆ opMul() [2/3]

kVec3 kVec3::opMul ( const kQuat &in rot) const

◆ opMul() [3/3]

kVec3 kVec3::opMul ( const kVec3 &in v)

◆ opMulAssign() [1/3]

kVec3 & kVec3::opMulAssign ( const float f)

◆ opMulAssign() [2/3]

kVec3 & kVec3::opMulAssign ( const kQuat &in rot)

◆ opMulAssign() [3/3]

kVec3 & kVec3::opMulAssign ( const kVec3 &in v)

◆ opNeg()

kVec3 kVec3::opNeg ( )

◆ opSub() [1/2]

kVec3 kVec3::opSub ( const float f) const

◆ opSub() [2/2]

kVec3 kVec3::opSub ( const kVec3 &in v) const

◆ opSubAssign() [1/2]

kVec3 & kVec3::opSubAssign ( const float f)

◆ opSubAssign() [2/2]

kVec3 & kVec3::opSubAssign ( const kVec3 &in v)

◆ Project()

kVec3 & kVec3::Project ( const kVec3 &in normal,
const float value )

Projects a vector onto another vector.

◆ QuadraticCurve()

kVec3 & kVec3::QuadraticCurve ( const kVec3 &in pt1,
const float value,
const kVec3 &in pt2,
const kVec3 &in pt3 )

◆ Randomize()

kVec3 & kVec3::Randomize ( const float value)

Randomizes x, y, z, components by value.

◆ Reflect()

kVec3 & kVec3::Reflect ( const kVec3 &in normal,
const float energyFactor )

Reflects a vector off the plane defined by a normal.

◆ Set()

void kVec3::Set ( const float x,
const float y,
const float z )

Set x, y and z components of this kVec3.

◆ ToPitch()

float kVec3::ToPitch ( )

Returns the Pitch direction in Rads.

◆ ToQuat()

kQuat kVec3::ToQuat ( ) const

◆ ToQuaternion()

kQuat kVec3::ToQuaternion ( ) const

◆ ToString()

kStr kVec3::ToString ( )

◆ ToYaw()

float kVec3::ToYaw ( )

Returns the Yaw direction in Rads.

◆ Unit()

float kVec3::Unit ( ) const

Returns the length of this vector. Exactly the same as Length()

◆ UnitSq()

float kVec3::UnitSq ( ) const

Returns the squared length of this vector. Exactly the same as LengthSq()

Member Data Documentation

◆ x

float kVec3::x

Definition at line 709 of file t1_scriptAPI.cpp.

◆ y

float kVec3::y

Definition at line 710 of file t1_scriptAPI.cpp.

◆ z

float kVec3::z

Definition at line 711 of file t1_scriptAPI.cpp.