aboutsummaryrefslogtreecommitdiff
path: root/src/shared/lua_api/phys/bphysgeneric.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/lua_api/phys/bphysgeneric.cpp')
-rw-r--r--src/shared/lua_api/phys/bphysgeneric.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/shared/lua_api/phys/bphysgeneric.cpp b/src/shared/lua_api/phys/bphysgeneric.cpp
index e8ef2b5..44c789d 100644
--- a/src/shared/lua_api/phys/bphysgeneric.cpp
+++ b/src/shared/lua_api/phys/bphysgeneric.cpp
@@ -106,6 +106,22 @@ int getlineardamping(lua_State *L){
}
/***
+Sets the angular factor of the rigidbody
+TODO:What does this actually do?
+@function rigidbody:setangfactor(vec3 dir)
+@tparam vector3 dir The direction to set the angular factor
+*/
+int setangfactor(lua_State *L){
+ double x,y,z;
+ popvector3d(L,&x,&y,&z);
+ lua_getfield(L,-1,"rigidbody");
+ btRigidBody *r = (btRigidBody*)lua_touserdata(L,-1);
+ lua_pop(L,2);
+ r->setAngularFactor(btVector3(x,y,z));
+ return 0;
+}
+
+/***
Gets the angular damping applied to this rigidbody
@function rigidbody:getadamping()
@treturn number damping The ammount of damping applied to angular momentum
@@ -208,5 +224,6 @@ extern const luaL_reg brigidbody_m[] = {
{"activate", activate},
{"getvelocity", getvelocity},
{"setvelocity", setvelocity},
+ {"setangfactor", setangfactor},
{NULL, NULL}
};