From 2009501214f3c2e3f8d8b1a06432afdf39276bd5 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Wed, 7 Nov 2018 14:49:35 -0500 Subject: Added Kinematic Character Controllers --- src/shared/lua_api/phys/bphysgeneric.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/shared/lua_api/phys/bphysgeneric.cpp') 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 @@ -105,6 +105,22 @@ int getlineardamping(lua_State *L){ return 1; } +/*** +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() @@ -208,5 +224,6 @@ extern const luaL_reg brigidbody_m[] = { {"activate", activate}, {"getvelocity", getvelocity}, {"setvelocity", setvelocity}, + {"setangfactor", setangfactor}, {NULL, NULL} }; -- cgit v1.2.3-70-g09d2