LODNode collision

I made a LODNode, attached a tree-model and a billboard of it for bigger distances.
When checking for collisions i collide with both no matter which is switched on.
Propably the switched-of node is just hidden.

How can i only collide with the switched-on node and still get (almost) the performance of LODNode?
Or is there even a better way to do it?

Maybe I’m wrong but I remember reading that for collisions only the lowest LOD node is used… But maybe that was only for visible geometry?

Sorta right, but no theres no way of getting just one or the other to work. One way of doing it tho is to use the lowest LOD node as the collision.

Remember, LOD is used to lower the gpu work, collision it self should not have any gpu cost.

Collision-with-geometry is disabled for anything other than the lowest LOD. But collision with ordinary CollisionNodes will work with all children of an LOD, unless you set the collision bits yourself to disable this (which you should, if you really have multiple CollisionNodes at the different LOD levels).

david

Is there any way for it change the bit autoly? Last time I ask it seem I had to reprogram the LOD code to get something like that to work.

What do you mean? You can use NodePath.setCollideMask() to set the bits at a given node and below to whatever value you like.

But do you really have multiple CollisionNodes under different LOD levels? Why would you do that?

David

I imagine that from far away a tree not much bigger then a point could have a simple sphere collision solid, closer it could be a tube for the trunk and 2-3 sphers for the branches, at point blank maybe more precision is needed and a low polly collision mesh is needed? I can imagine somethin like that say for a game of picking apples (farmer games are so popular this year).

But you never collide with a tree when it is far away. Only when you’re close enough to touch it. So what would be the point of having multiple LOD’s in collisions?

Anyway, collisions are very expensive for highly detailed models, but relatively inexpensive for coarse models; that’s why Panda selects the lowest level of (visible) geometry for the default collision level. But for CollisionNodes, Panda assumes you have constructed suitable geometry specifically, and does the collision calculation with whatever you give it.

David

Thanks alot. I think I got it now…