diff --git a/panda/src/bullet/bulletRigidBodyNode.cxx b/panda/src/bullet/bulletRigidBodyNode.cxx index 49e815831f..6f46478f09 100644 --- a/panda/src/bullet/bulletRigidBodyNode.cxx +++ b/panda/src/bullet/bulletRigidBodyNode.cxx @@ -416,3 +416,25 @@ get_gravity() const { return btVector3_to_LVector3f(_body->getGravity()); } +//////////////////////////////////////////////////////////////////// +// Function: BulletRigidBodyNode::set_linear_factor +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +void BulletRigidBodyNode:: +set_linear_factor(const LVector3f &factor) { + + _body->setLinearFactor(LVecBase3f_to_btVector3(factor)); +} + +//////////////////////////////////////////////////////////////////// +// Function: BulletRigidBodyNode::set_angular_factor +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +void BulletRigidBodyNode:: +set_angular_factor(const LVector3f &factor) { + + _body->setAngularFactor(LVecBase3f_to_btVector3(factor)); +} + diff --git a/panda/src/bullet/bulletRigidBodyNode.h b/panda/src/bullet/bulletRigidBodyNode.h index 91ea7d0106..4375035eeb 100644 --- a/panda/src/bullet/bulletRigidBodyNode.h +++ b/panda/src/bullet/bulletRigidBodyNode.h @@ -73,6 +73,10 @@ PUBLISHED: void set_gravity(const LVector3f &gravity); LVector3f get_gravity() const; + // Restrict movement + void set_linear_factor(const LVector3f &factor); + void set_angular_factor(const LVector3f &factor); + public: virtual btCollisionObject *get_object() const;