diff options
Diffstat (limited to 'src/shared/lua_api/phys/bcharactercontroller.cpp')
| -rw-r--r-- | src/shared/lua_api/phys/bcharactercontroller.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/shared/lua_api/phys/bcharactercontroller.cpp b/src/shared/lua_api/phys/bcharactercontroller.cpp index 4dfe791..f61aca5 100644 --- a/src/shared/lua_api/phys/bcharactercontroller.cpp +++ b/src/shared/lua_api/phys/bcharactercontroller.cpp @@ -101,7 +101,7 @@ void makenewbcharactercontroller(lua_State* L){ World->addCollisionObject(ghost,btBroadphaseProxy::CharacterFilter, btBroadphaseProxy::StaticFilter|btBroadphaseProxy::DefaultFilter); //ghost->setCollisionFlags(btCollisionObject::CF_CHARACTER_OBJECT); printf("Character controller created\n"); - btKinematicCharacterController *cc = new btKinematicCharacterController(ghost, cshape, 8, btVector3(0,1,0)); + btKinematicCharacterController *cc = new btKinematicCharacterController(ghost, cshape, 1, btVector3(0,1,0)); //cc->setMaxSlope(3.14 / 4.0); //cinfo.m_friction = 0; @@ -177,9 +177,10 @@ int bcharactersetpos(lua_State *L){ double x,y,z; popvector3d(L,&x,&y,&z); btKinematicCharacterController *c = popCharacter(L); - btTransform t = c->getGhostObject()->getWorldTransform(); - t.setOrigin(btVector3(x,y,z)); - c->getGhostObject()->setWorldTransform(t); + c->warp(btVector3(x,y,z)); + //btTransform t = c->getGhostObject()->getWorldTransform(); + //t.setOrigin(btVector3(x,y,z)); + //c->getGhostObject()->setWorldTransform(t); return 0; } @@ -192,13 +193,13 @@ int bcharacteronground(lua_State *L){ // char:jump(v3 jump) int bcharacterjump(lua_State *L){ - printf("Jump called\n"); + //printf("Jump called\n"); double x,y,z; popvector3d(L,&x,&y,&z); btKinematicCharacterController *c = popCharacter(L); - printf("About to jump\n"); + //printf("About to jump\n"); c->jump(btVector3(x,y,z)); - printf("Done jumping\n"); + //printf("Done jumping\n"); return 0; } |
