Hide collisions

Hello. Good afternoon.
I wonder if someone knows how to hide the collision debug. For example:

I am usin bitmask, ActorNode and PhysicsCollisionHandler.

Thank you.

That’s odd: Generally collision meshes are hidden by default. Are you perhaps calling “show” on your collision nodes?

I basically have 2: the ground and a sphere. I started most of the code from here:

I do note that the code given there does indeed call “show” on one of the collision objects–albeit not the one that seems to be showing up in your case. So if you are indeed calling “show” on your collision nodes, then that might be the problem.

If I hide both objects, this happens:
I hid both the terrain and the floor(the one used for collisions.

Oh wait, I think that I may have spotted the problem: in the code that you linked to, they call the following:


Do you have that line in your code, too? If so, that might be what’s doing it.

If I’m not much mistaken, “showCollisions” does just that: it causes collisions to be visualised–hence your collisions now showing up.

That was the problem! I totally missed it, thank you.

Btw, do you know why this might be happening?basically the sphere going all the way through half of itself before colliding:

Thank you

1 Like

It’s my pleasure. :slight_smile:

That I don’t know offhand, I’m afraid: I haven’t really used Panda’s physics system overmuch (just its collision system). My best guess, both intuitively and looking at your screenshots above, is that your visual sphere-model is offset, either in the model itself or simply relative to the physics-model that it’s attached to.

Otherwise, perhaps someone else will have an idea!

with a boxCollider it dosnt happen. It collides with the bottom of the sphere.

Call show() on the sphere collider. I’m willing to bet it’s not perfectly centered on your model.

Hello. I tried hidind the actor and showing the sphere, but the sphere was still intersecting with the floor. It donst happen with a boxCollider.

I`am not at home to get a screenshot but I tried it already. Maybe there is a problem in how I created the sphere: in the arguments I used (0,0,1), 1. I think those are the values.

As a side note, I tried using a box instead of a sphere and the box dosnt intersect.

Thank you.

Well, you have specified an offset centre, by the looks of it, so that might be the source of the problem. (The “1” in (0,0,1) indicates that the sphere should have its centre at 0 on the X- and Y- axes, and 1 on the Z-axis, I believe.)

That said, if you showed the collision-shapes and found that the collision-shape itself intersected, then that is odd; even offset I wouldn’t expect that.

Still, try setting that first parameter to your CollisionSphere to be (0, 0, 0) instead of (0, 0, 1), and see whether that helps.

I will try tonight. I think I tried yesterday but I cant remember, I spend like 9 or 10 hours straight reading the docu and trying to familiarize myself with the engine, so I`m not sure now :smile:

I think that it might be related to:
-the bitmask: when I added a boxCollider as a floor, the sphere worked as it should, but I didnt add the boxCollider to the bitmask.
-Or the collisions with a mesh(as it is right now) are not that good.
-Or the offset.


thats with the avatar hidden and the avatar on.

Thank you

Odd. And indeed, looking again more closely at the post linked-to below, I do note that the sphere-collider does seem to be intersecting the floor-collider…

super odd. This is with a boxCollider as a floor:

and this is using a collision box for the player, but using the mesh from maya as the floor:

Could you share your code?

I wonder whether you have a non-uniform scale applied, or something similar that confuses the collision system.

Sure. These are the files


There. I attached the files on my last comment but forgot to reply to you.

Thank you for checking this