How to permanently position a BulletRigidBodyNode

Hi all:

I am familiar with using the built in collision offered by Panda3d… using CollisionTraverser(), CollisionHandlerPusher(), and CollisionHandlerQueue() etc.

I did read that this technique should not be mixed with Bullet physics.

Basically in my main environment model there are some meshes that are intended to be static, and preferably unable to be moved.

For example there is a coffee table included in my model that is not imported separately (it’s included in my room model). Normally I would set the collision boundaries on it using a CollisionBox and CollisionNode.

How can I achieve this using BulletBoxShape and BulletRigidBodyNode?

I really just want to place a box around the coffee table so that the player can’t walk through it.

I am trying something like this:

coffee_table = BulletBoxShape(Vec3(1.5, 0.5, 0.5))
node = BulletRigidBodyNode('Box')
node.set_mass(100.1)
node.add_shape(coffee_table)
node_path = self.render.attach_new_node(node)
node_path.set_pos(2.5, 2.5, 0.01)
self.world.attach_rigid_body(node)

This does create a collision box, but it seems to drop into the scene (along with my player and a test box both of which are using bullet physics).

How can I create a BulletBoxShape that is basically stationary, and just sits in the desired position? Also I am guessing it’s mass must be set fairly high so that it can’t be moved?

Thanks for taking the time to look…

try node.set_mass(0)

1 Like

haha yes that worked thanks. I definitely wouldn’t have guessed that one.

Pay attention to this page.

https://docs.panda3d.org/1.10/python/programming/physics/bullet/hello-world#bullet-hello-world

From the information provided, we can conclude that if you do want the body not be dynamic, do not set the mass.