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.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/shared/lua_api/phys/bphysgeneric.cpp b/src/shared/lua_api/phys/bphysgeneric.cpp
index 4500ce0..eed9112 100644
--- a/src/shared/lua_api/phys/bphysgeneric.cpp
+++ b/src/shared/lua_api/phys/bphysgeneric.cpp
@@ -8,11 +8,6 @@ extern "C" {
#include <shared/lua_api/common.hpp>
#include <shared/phys/physcommon.hpp>
-/***
-@module phys
-*/
-
-
/*Physics things from lua have the form of:
{
type = "rigidbody"
@@ -243,6 +238,7 @@ int applyimpulse(lua_State *L){
popvector3d(L,&x,&y,&z);
btRigidBody *r = popRigidBody(L);
r->applyImpulse(btVector3(x,y,z),btVector3(ox,oy,oz));
+ r->activate();
return 0;
}
@@ -265,6 +261,14 @@ int setrotation(lua_State *L){
return 0;
}
+//rigidbody:getmass() :: number
+int getmass(lua_State *L){
+ btRigidBody *r = popRigidBody(L);
+ double m = r->getMass();
+ lua_pushnumber(L,m);
+ return 1;
+}
+
/*
@@ -310,6 +314,7 @@ extern const luaL_reg brigidbody_m[] = {
{"setangfactor", setangfactor},
{"setflags", setflags},
{"setrotation", setrotation},
+ {"getmass", getmass},
//{"testcontact", testcontact},
{NULL, NULL}
};