Intersection (Collision?) Detection

Hi, in my project I am using PyODE for the physics sim. Throughout the game if a player hits certain objects certain things will happen.

My question is does the Collision detection method in Panda handle this kind of operation?

In Flash, which I am familiar with, to detect intersections, they have what is called a hitTest which evaluates an object to see if it overlaps or intersects with the hit area (or object) that the target or x and y coordinate parameters identify and returns true if they overlap or intersect at any point.

…and a fairly simple function would go like this
NOTE THIS IS ACTIONSCRIPT NOT PYTHON

square_mc.onPress = function() {
    this.startDrag();
};
square_mc.onRelease = function() {
    this.stopDrag();
    if (this.hitTest(circle_mc)) {
    trace("you hit the circle");
    }
};

So in Panda, similar to the Collision Detection sample (I am unsure how the triggers’ size/area is set in that example…it looks like a small dot what if it needed to be 10x bigger?)
can invisible geometry act like a “hitTest” method…because each generated character in my list will have a “hitTest” or trigger type method attached to it, that would cause an event to happen.

In essesence does I need when an object hits something…it causes a function to run…I am using PyODE physics does the collison detection of Panda interfere with the collisions there.
Thanks in advance for any help! , and sorry if this question seems convoluted :slight_smile:

To generate event upon collision, you can use CollisionHandlerEvent, just like in the tutorial, or –[THIS]–

Thanks for the link…thats what I needed! Now it helps that I know what it is called since Flash calls it something else.
Thanks again

Hi,

In looking at the Collision tutorial in the samples section it mentions:

My question is how do you automatically create the poly groups that will become seperate collision areas? I assume this is done in the Modelling package? If so, say using maya, how do you seperate the vertice lists in the EGG file to become poly groups to become different collision sections?:
IE: the maze has the WALLS, HOLES & GROUND.
Are these all seperate models that get saved as a scene (ie walls ground and holes all different sections to create the model maze) that make up poly groups or is each group seperated by hand, then the tags typed in seperately (which could be hundreds if the model is high poly)? Such as adding to every .verts VertexRef? Ex:

Thanks?

For Maya, there is eggObjectFlags.mel which does all that for you. Search the forum and you’ll find some explanation.

Ahh, thanks thats exactly what I was looking for. Appreciate the pointer.