Krig Game Engine
Functions
api_vector.cpp File Reference

Krig Game Engine Lua Scripting API - Vector Library. More...

Functions

float scalar (Vector3, Vector3)
 
Vector3 normalize (Vector3)
 
float dot_product (Vector3, Vector3)
 
Vector3 cross_product (Vector3, Vector3)
 
Vector3 average (Vector3, Vector3)
 
Vector3 add (Vector3, Vector3)
 
Vector3 subtract (Vector3, Vector3)
 
Vector3 scale (Vector3, float)
 
Vector3 copy (Vector3)
 
float distance (Vector3, Vector3)
 
float sum (Vector3)
 
int luaopen_krigVector (lua_State *L)
 

Detailed Description

Krig Game Engine Lua Scripting API - Vector Library.

3-D Vector math API functionality.

Function Documentation

◆ add()

Vector3 add ( Vector3  ,
Vector3   
)

Add two vectors.

Parameters
Vector3
Vector3
Returns
Vector3

◆ average()

Vector3 average ( Vector3  ,
Vector3   
)

Calculate average of two vectors.

Parameters
Vector3
Vector3
Returns
Vector3

◆ copy()

Vector3 copy ( Vector3  )

Copy a vector.

Parameters
Vector3
Returns
Vector3

◆ cross_product()

Vector3 cross_product ( Vector3  ,
Vector3   
)

Calculate cross product between two vectors.

Parameters
Vector3
Vector3
Returns
Vector3

◆ distance()

float distance ( Vector3  ,
Vector3   
)

Calculate distance between two vectors.

Parameters
Vector3
Vector3
Returns
float

◆ dot_product()

float dot_product ( Vector3  ,
Vector3   
)

Calculate dot product between two vectors.

Parameters
Vector3
Vector3
Returns
float

◆ normalize()

Vector3 normalize ( Vector3  )

Normalize the vector.

Parameters
Vector3
Returns
Vector3

◆ scalar()

float scalar ( Vector3  ,
Vector3   
)

Calculate scalar value between two vectors.

Parameters
Vector3
Vector3
Returns
float

◆ scale()

Vector3 scale ( Vector3  ,
float   
)

Scale a vector.

Parameters
Vector3
float
Returns
Vector3

◆ subtract()

Vector3 subtract ( Vector3  ,
Vector3   
)

Subtract two vectors.

Parameters
Vector3
Vector3
Returns
Vector3

◆ sum()

float sum ( Vector3  )

Add vector components.

Parameters
Vector3
Returns
float