Chicken Blender and Exporting a collision Mesh

Can any one explain how to do the collision mesh in blender? I have A plain I’m exporting as an egg and I added Property type string “Name:Collide” and “attribute :stuck_out_tongue:olyset keep descend” like it says in the roaming Ralph Demo. How ever this doesn’t seem to do the trick can anyone tell me what I’m doing wrong?

I looked at the chicken docs and this thread [url]Blender and collision geometry] and the left me kinda lost. Any help would be awesome.

Thanks Guys.

instead of “Collide” name it “ObjectType”. that should do the trick. if not just tell me, and i will have a closer look at it again.

Huh? No, “Collide” should be correct.

What exactly is not working? Could you be a bit more specific about what’s happening? Do you see the tag correctly exported in the .egg file? Does an ls() on the model show any CollisionNodes? Does the geometry light up if you enable collision visualisation?

yup here’s the tag we added to the mesh.

{ Polyset keep descend }

If you want the egg to dig around and see where the tag is showing up let me know and I’ll post it somewhere.

Let me give what ThomasEgi recommended and I’ll let you know how that goes.

ok so we tried Property type string “Name:ObjectType” and “attribute :stuck_out_tongue:olyset keep descend” like ThomasEgi said and now it refuses to load the egg we made citing

“Error in /c/Users/My.username/Desktop/2011capstone04/ShepherdsTailSrc/src/…/levels/alpha_06.egg at line 77, column 29:
{ Polyset keep descend }”
parse error

so I feel like where doing something very simple very wrong. Let me know if you guys have any suggestions.

The syntax " { Polyset keep descend }" is the correct syntax within an egg file. This should appear in the egg file within a tag that also includes tags (possibly within nested groups). Does it? If it does, then you should have collision polygons in your egg file.

You can prove this by pviewing the egg file and pressing shift-C, which will make the collision polygons visible. Do you see them? If not, then press shift-L, which lists the entire model hierarchy. There should be one or more nodes of type CollisionNode. Are there?

If there are, then the conversion appears to be working. In what sense is it not working for you?


Figured it out looks like when I was searching collisions it was looking for a mesh called terrain when it was actually called Plane. so by fixing that in my code(or I could of changed the objects name in blender) it worked. However I have a new issue I’ve discovered.

In roaming Ralph he can’t walk through trees rocks or the sides of the level. For some reason when I load in the same world.egg file roaming Ralph uses mine moves the correct Z to not hit the terrain but he can walk though the levels walls and trees. What am I forgetting to do I looked thought the roaming Ralph and couldn’t find much else? Here’s the code from my collision check.

Thanks for the help everyone ^_^.

Are you sure that (a) there are collision objects around your rocks and trees and that (b) these objects are being detected?

You can test (a) by using shift-C in pview. You can test (b) by calling self.cTrav.showCollisions(render) when you start up the game. This will light up all of the collision objects that are detected.

Also, is it possible that your rocks and trees are also named “Plane”?


This is for the Roaming Ralph world.egg and when I ran it in pview it showed collisions on the trees and rocks, so not sure why in mine it Doesn’t do it on the trees and rocks still.

ok just tried the self.cTrav.showCollisions(render) and its showing that the trees/rocks have collision and are detecting my guy walking into it but he still goes through it. Like I said in the roaming Ralph it looks like it isn’t doing anything extra to detect the collisions on those things so I’m not sure whats wrong.

Here’s some screen caps!

So I figured out whats happening. In the code in roaming Ralph it says if your not the terrain and you hit me move me back to before you Hit me and since all the code to handle all the events in the game is in one giant function it works. Since in my code input reading is in a separate class and handled as an event when I set my characters start position it ends always being his current position thus never a deviation. So my questions now is there a way to set the characters position to that of the collision site?

I think what I want to use is getContactPos can some one point me to a code sample that uses this?

Could you explain in detail for the rest of us how you did this in chicken?

hmmmm… this is a very informative. 8)