Added restiction of lin/ang movement for rigid bodies.

This commit is contained in:
enn0x 2011-07-10 20:10:13 +00:00
parent 99c71cef31
commit 8841b1d80a
2 changed files with 26 additions and 0 deletions

View File

@ -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));
}

View File

@ -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;