This might be tough to do

With game Engines I’ve used in the past, there was a function that calculated rather or not a moving object would collide with something based on a fixed distance from the object.

For instance, you might have a car and a need to see if that car will collide with something if it moved 30 pixels on the positive x axis of the world. Your basically checking if the place/area the car will move to is clear of collision.

Since I’m not big on Panda’s APIs, I don’t know if there’s anything built into Panda or not that could handle such a mean calculation. This obviously would call for a ‘Panda Elder’…someone with a lot of P3D knowledge.

Nah, this is no magic at all.
Panda has two builtin physics engines which can handle this with ease.

First is Panda’s own internal physics, which is described in the manual here: … _Detection

The second way is using the integrated ODE third party physics, described here: … n_with_ODE

Beside these manual chapters, you might want to search the forums for the “ODE middleware”, a very nice and easy to use physics implementation, which spares you most of the hooks of manually setting up ODE.

@Nemesis: that’s completely unrelated to what the poster asked.

In this situation, what you could do is create a collision volume that extends out the vehicle in the front, like a ray or a sphere with an offset.

Hmm, the way I understand his question is that he is looking for a sweep API, which is often similar to the raycast API.

But I have to admit that I am just making a guess. We should make him list these engines he has worked with so far, together with what objects/methods he used, and what the parameters have been. It would be more easy to answer his question then.

Yeah, I think rbd’s solution will work best for what you want. I think technically you’re looking for a CollisionTube pointed forwards from the car. The collions with the CollisionTube will then tell you if that space in front of the car has been violated. You could manipulate the size (length) of the CollisionTube based on car speed to further match what it sounds like you’re trying to do. … ion_Solids

I actually thought of the extra collision thing, but I thought of using multiple line segments coming from the sides of an object going away from it.

That would be the easiest way I guess. I was just wondering if Panda had a built in function or method written in C++ (called with python) to achieve this, because that function or method would have probably been the fastest way.

Of well…using the multiple collision checkers will work just fine though. At the moment I have no need to do this, since I’ve been solving so many things using my own programming knowledge.

If I was in the process of trying to understand Python and work with Panda3D both…I’ll be honest, I wouldn’t make it.

So glad I already had a few years of Python under my belt before I ran into this Engine. It’s a lot easier trying to talk to the CPU with a language you’re already “comfy” with. With past engines, I was using a low level C language. :slight_smile: