Lua API  0.4.0
Game Engine
 All Files Functions
General.lua File Reference

Functions

 vec3 (float x, float y, float z)
 Creates a 3D vector. More...
 
 length (vec3)
 Calculates the length of a 3D vector. More...
 
 normalize (vec3)
 Normalizes a vector. More...
 
 dot (vecA, vecB)
 This function calculates the dot product of two vectors. More...
 
 cross (vecA, vecB)
 This function calculates the cross product of two vectors. More...
 
 getBehaviorVariable (object, behaviorId,"variableName")
 
 setBehaviorVariable (object, behaviorId,"variableName", value)
 

Function Documentation

cross ( vecA  ,
vecB   
)

This function calculates the cross product of two vectors.

Parameters
vecAThe first vector.
vecBThe second vector.
Returns
The calculated vector.
dot ( vecA  ,
vecB   
)

This function calculates the dot product of two vectors.

Parameters
vecAThe first vector.
vecBThe second vector.
Returns
The one dimensional scalar product.
getBehaviorVariable ( object  ,
behaviorId  ,
"variableName"   
)
length ( vec3  )

Calculates the length of a 3D vector.

Parameters
vec3The 3D vector to use.
Returns
The length of the vector.
normalize ( vec3  )

Normalizes a vector.

This function takes the input vector and transforms it to a new vector with the length 1.0f.

Parameters
vec3The vector to normalize.
Returns
The normalized vec3.
setBehaviorVariable ( object  ,
behaviorId  ,
"variableName"  ,
value   
)
vec3 ( float  x,
float  y,
float  z 
)

Creates a 3D vector.

Parameters
xThe X value
yThe Y value
zThe Z value
Returns
The newly created 3D vector