Collision detection on function call?

Hello All,

Question:

Can I call a function to do collision detection, and have it disabled otherwise? I have a problem where I only need to check for collision at certain poses. I think it’s best for me to change the position/pose of an item, then run collision, instead of giving velocities. Is this possible, or can anyone suggest how I might best approach this problem?

I have a more detailed description of what I’m doing below.
I’m new to Panda3D. Thank you for your help and patience! :slight_smile:

Detail of the problem:

My goal is to create a program that can simulate a pick and place machine operation. The machine places components one by one. I need to check if any of these components will collide with each other, or if the part of the machine holding the component (the gripper) will collide with any components already placed.

Since the number of components is large (around 100,000) I think it would be best for me to check certain poses of the machine, instead of simulating actual travel, since all movements of the machine are along straight lines. Each time a component is placed, I need to check about 4 poses.

Regards,
Doug

You can run your collision traverser when you need to or set a zero collision mask on all your solids and only change that when you need things to collide.

If you’d use bullet, then you could use sweep test, ray test and suchlike. These are function calls performing collision detection. There’s more on that in the manual:
www.panda3d.org/manual/index.php/Bullet_Queries

Hi wezu,

Thank you so much for your help! The Bullet contact test might work for my case.

Regards to CollisionTraverser, the manual says it runs automatically.

However, if I read this post correctly, only the CollisionTraveler stored in property “cTrav” runs automatically. Something like myCTrav would not run automatically, and I call traverse() on it manually. Does that sound right?
(See third message by “ninth”) [url]Few questions... - #3 by ninth]

Thanks!
Doug

Then don’t put it in base.cTrav, and instead call .traverse(render) whenever you want.