Example #1
0
static int Vector_LengthSqr (lua_State *L) {
  lua_pushnumber(L, luaL_checkvector(L, 1)->LengthSqr());
  return 1;
}
static int vmatrix_SetupMatrixTranslation (lua_State *L) {
  lua_pushvmatrix(L, SetupMatrixTranslation(luaL_checkvector(L, 1)));
  return 1;
}
static int vmatrix_SetupMatrixOrgAngles (lua_State *L) {
  lua_pushvmatrix(L, SetupMatrixOrgAngles(luaL_checkvector(L, 1), luaL_checkangle(L, 2)));
  return 1;
}
static int VMatrix_SetupMatrixOrgAngles (lua_State *L) {
  luaL_checkvmatrix(L, 1).SetupMatrixOrgAngles(luaL_checkvector(L, 2), luaL_checkangle(L, 3));
  return 0;
}
static int VMatrix_VMul4x3Transpose (lua_State *L) {
  lua_pushvector(L, luaL_checkvmatrix(L, 1).VMul4x3Transpose(luaL_checkvector(L, 2)));
  return 1;
}
static int VMatrix_PreTranslate (lua_State *L) {
  luaL_checkvmatrix(L, 1).PreTranslate(luaL_checkvector(L, 2));
  return 0;
}
static int VMatrix_SetBasisVectors (lua_State *L) {
  luaL_checkvmatrix(L, 1).SetBasisVectors(luaL_checkvector(L, 2), luaL_checkvector(L, 3), luaL_checkvector(L, 4));
  return 0;
}
Example #8
0
static int Vector_Zero (lua_State *L) {
  luaL_checkvector(L, 1)->Zero();
  return 0;
}
Example #9
0
static int Vector___tostring (lua_State *L) {
  Vector *v = luaL_checkvector(L, 1);
  lua_pushfstring(L, "Vector: %s", static_cast<const char *>(CFmtStr("(%f, %f, %f)", v->x, v->y, v->z)));
  return 1;
}
Example #10
0
static int Vector_Random (lua_State *L) {
  luaL_checkvector(L, 1)->Random(luaL_checknumber(L, 2), luaL_checknumber(L, 3));
  return 0;
}
Example #11
0
static int Vector_WithinAABox (lua_State *L) {
  lua_pushboolean(L, luaL_checkvector(L, 1)->WithinAABox(*(Vector *)luaL_checkvector(L, 2), *(Vector *)luaL_checkvector(L, 3)));
  return 1;
}
Example #12
0
static int Vector_NormalizeInPlace (lua_State *L) {
  luaL_checkvector(L, 1)->NormalizeInPlace();
  return 0;
}
Example #13
0
static int Vector_Negate (lua_State *L) {
  luaL_checkvector(L, 1)->Negate();
  return 0;
}
Example #14
0
static int Vector_MulAdd (lua_State *L) {
  luaL_checkvector(L, 1)->MulAdd(*(Vector *)luaL_checkvector(L, 2), *(Vector *)luaL_checkvector(L, 3), luaL_checknumber(L, 4));
  return 0;
}
Example #15
0
static int Vector_Dot (lua_State *L) {
  lua_pushnumber(L, luaL_checkvector(L, 1)->Dot(*(Vector *)luaL_checkvector(L, 2)));
  return 1;
}
Example #16
0
static int Vector___eq (lua_State *L) {
  lua_pushboolean(L, luaL_checkvector(L, 1) == luaL_checkvector(L, 2));
  return 1;
}
Example #17
0
static int Vector_Invalidate (lua_State *L) {
  luaL_checkvector(L, 1)->Invalidate();
  return 0;
}
Example #18
0
static int Vector___add (lua_State *L) {
  Vector c;
  VectorAdd(*(Vector *)luaL_checkvector(L, 1), *(Vector *)luaL_checkvector(L, 2), c);
  lua_pushvector(L, &c);
  return 1;
}
static int VMatrix_Scale (lua_State *L) {
  lua_pushvmatrix(L, luaL_checkvmatrix(L, 1).Scale(luaL_checkvector(L, 2)));
  return 1;
}
Example #20
0
static int Vector___sub (lua_State *L) {
  Vector c;
  VectorSubtract(*(Vector *)luaL_checkvector(L, 1), *(Vector *)luaL_checkvector(L, 2), c);
  lua_pushvector(L, &c);
  return 1;
}
static int VMatrix_SetUp (lua_State *L) {
  luaL_checkvmatrix(L, 1).SetUp(luaL_checkvector(L, 2));
  return 0;
}
Example #22
0
static int Vector___mul (lua_State *L) {
  Vector result;
  VectorScale(*(Vector *)luaL_checkvector(L, 1), luaL_checknumber(L, 2), result);
  lua_pushvector(L, &result);
  return 1;
}
static int VMatrix_V3Mul (lua_State *L) {
  luaL_checkvmatrix(L, 1).V3Mul(luaL_checkvector(L, 2), luaL_checkvector(L, 3));
  return 0;
}
Example #24
0
static int Vector___div (lua_State *L) {
  Vector c;
  VectorDivide(*(Vector *)luaL_checkvector(L, 1), luaL_checknumber(L, 2), c);
  lua_pushvector(L, &c);
  return 1;
}
static int vmatrix_SetupMatrixScale (lua_State *L) {
  lua_pushvmatrix(L, SetupMatrixScale(luaL_checkvector(L, 1)));
  return 1;
}
Example #26
0
static int Vector___unm (lua_State *L) {
  Vector a = *(Vector *)luaL_checkvector(L, 1);
  VectorNegate(a);
  lua_pushvector(L, &a);
  return 1;
}
static int vmatrix_SetupMatrixAxisRot (lua_State *L) {
  lua_pushvmatrix(L, SetupMatrixAxisRot(luaL_checkvector(L, 1), luaL_checknumber(L, 2)));
  return 1;
}
Example #28
0
static int Vector_Cross (lua_State *L) {
  Vector v = luaL_checkvector(L, 1)->Cross(*(Vector *)luaL_checkvector(L, 2));
  lua_pushvector(L, &v);
  return 1;
}
static int vmatrix_MatrixGetColumn (lua_State *L) {
  MatrixGetColumn(luaL_checkvmatrix(L, 1), luaL_checkint(L, 2), &luaL_checkvector(L, 3));
  return 0;
}
Example #30
0
static int Vector_IsValid (lua_State *L) {
  lua_pushboolean(L, luaL_checkvector(L, 1)->IsValid());
  return 1;
}