diff --git a/programming/physics/bullet/collision-filtering.rst b/programming/physics/bullet/collision-filtering.rst index 10552481..e548e95b 100644 --- a/programming/physics/bullet/collision-filtering.rst +++ b/programming/physics/bullet/collision-filtering.rst @@ -137,14 +137,14 @@ collision groups the object belongs to. .. code-block:: python - shape = shape = BulletBoxShape(Vec3(0.5, 0.5, 0.5)) + shape = BulletBoxShape(Vec3(0.5, 0.5, 0.5)) body = BulletRigidBodyNode('Body') body.addShape(shape) world.attachRigidBody(body) - bodyNP = self.worldNP.attachNewNode(body) + bodyNP = render.attachNewNode(body) bodyNP.setPos(0, 0, -1) # Set it to be a part of group 0 @@ -174,7 +174,7 @@ following line is an alternate way to set the collide mask: .. code-block:: python - bodyNP.node().setIntoCollideMask(mask) + bodyNP.setIntoCollideMask(mask) .. only:: cpp diff --git a/programming/physics/bullet/queries.rst b/programming/physics/bullet/queries.rst index c86b48c1..a5fa2366 100644 --- a/programming/physics/bullet/queries.rst +++ b/programming/physics/bullet/queries.rst @@ -129,7 +129,7 @@ instead of a BulletTriangleMeshShape.) shape = BulletSphereShape(0.5) penetration = 0.0 - result = world.sweepTestClosest(shape, tsFrom, tsTo, penetration) + result = world.sweepTestClosest(shape, tsFrom, tsTo, BitMask32.allOn(), penetration) print(result.hasHit()) print(result.getHitPos())