Need Collison Help

I was reading the Manual in order to find out how to keep an object above the terrain, even if the terrain is unleveled. The Manual doesn’t give a full working simple example. Can someone provide a small example of how to set it up?

self.car=Actor…
self.carmask=self.car.attachNewNode(CollisionNode(‘colNode’));
self.carmask.node().addSolid(CollisionRay(0, 0, 0, 0, 0, -1));
self.carmaskColH=CollisionHandlerFloor();
self.carmaskColH.addCollider(self.carmask, self.car);

self.carmaskTrav=CollisionTraverser(“Car Trav”);
base.cTrav=self.carmaskTrav;
base.cTrav.setRespectPrevTransform(True);
self.carmaskTrav.addCollider(self.carmask, self.carmaskColH);

Check if Roaming Ralph example helps you.

Wow…didn’t know all those examples where in the installation path. :laughing:

Let me check it out.

Nope… The Roaming Ralph didn’t help. I used the code from the tutorial and modified it to fit mine and the character became stuck in place.

The whole collision ordeal seems very confusing.

:frowning:

:cry:

you’r correct, collisions are not an easy subject.
still, things are like this:
-the roaming ralph examples works
-your modifications dont.

the only logical conclusion is: you did something wrong and therefore it broke.
i suggest you try to do less modification at a time so you can see which line you changed broke it.

Also, take a look here:
[Panda3d Collisions made simple)

Many examples on collision you can use.

Once again…I had an extra hard time with getting the Character to move along unleveled terrain, because the manual itself is just throwing data at you all over the place. I had to take pieces from one page and then move 3 or 4 pages ahead to get another piece of data, when that latter should of been in-line on page 1. What I’ve also learned in programming is, every programmer will have their own style. I got my Character to move along terrain with less code than that shown in the “Wondering Ralph” Tutorial. I figured the same thing could be achieved in less code. There’s only one issue left, but I believe that issue is there because I modeled a bad terrain for a Test terrian. 8) Killing me. :laughing:

bsemail, you could watch videotutorials, ones from disney. There is one for collision system in panda. Click on Documetation tab in panda3d site to see link…

Thanks but I solved it! I actually have my character walking over unlevel ground with less code. 8)

The way I work is…if I get a clean understanding of the Functions involved and or maybe a good simple working example…I could pretty much write my own code to solve things.

The “Wondering Ralph” code to me was a little over done, I realized that when I first saw it. What “killed” me was, I didn’t know start Pos matter so much with the ColRay; and that was the final fix.

8)

Can someone answer this question now? Which I’ve heard it does…but,

Does the size of your models effect performance as much as it is denoted? or at least with the Panda Engine?

I’m thinking about going with some really tiny models and have the camera zoom in because larger terrains will stretchout textures.

Size, as in the amount of space a model consumes, means nothing. But size, as in the number of polygons within a model, can mean a lot with collisions.

David

Nice… I guess I don’t have to worry about scale much then.

My issue now is getting Character Movement to look Smooth. I’m sure there’s some APIs that help with this, but I can’t seem to dig them out.

Objects tend to look like they’re snapping when going from Pos to Pos, which creates a blurr effect. Has to be a way to “kill” that.

===============Hours Later--------------
OMG!!! I think I’m about to solve the issue of blurr!!! Pray for me community! Lol :laughing: