Contact problem with thin object

Hi everybody,



I have a little problem with collision detection on a thin object…



Let me explain : In my tennis game, I have a net and it is a trimesh,

when the ball hits it, sometimes I don’t have any contact so what I did is create a transparent box object that englobes the net and is 5 units in thickness, the problem is that sometimes when the ball hits the top of the net, it stays there without moving… In real life, it is impossible…



So what should I do? Is there a simple solution to this?



thanks and by the way here is a printscreen of my game right now…

As you can see I still don’t have player models but It is still young so…

what do you think?





hehe … you have to put links to your image on a web server otherwise we can’t see them.





I’m not sure a good solution to your problem would be. Maybe make the top of the net slanted?

Soory fot the image … It seems that i need an http page to store it… I thought I could insert it directly from my disk…

Neat! That’s looking real promising. Keep up the good work.

By the way shochu…



Thanks for the tip and the quick answer… I will try to make a shape with a slanted net top…



Ken

If you can make it pointy (so slanted on both sides) that would probably work best.

Per has introduced something that can fix this…But it currently only works with DynamicPhysicsObjects. What you can do now is specify the type of shape ode will have on that object.



So in essence, you can make a box behave like a sphere!



Anyway, this will help you by making the thickness of the net greater so that things do collide with it…



I’l add the static physics object stuff soon (or per will do it, whichever)



DP

So Dark Prophet, If I understand what yo are saying…



You mean that if I declared my net a dynamic object, the ball hitting it would behave like it would be hitting another sphere?



is it with jme physics 0.4? or 0.3 also…

this will be for 0.5.



Let me explain it better:



public DynamicPhysicsObject(Spatial spat, PhysicsType type)...



PhysicsType can be a PhysicsSphere, a PhysicsBox, a PhysicsCylinder and a PhysicsCone. Each of those Types has specific variables, e.g. sphere has a radius, while a cylinder has a radius and a height. So you declare the PhysicsType manually and tell teh object to create itself....and the rest is history.

What this means is tha you can pass onto the dynamic object a box, and it can behave like a sphere. Its not something you want to do, but its there.

This is relevant for you in that you can make the "depth" of the net greater, so that ode can calculate depth intersection.

The thing is, in your game, you dont want to have the net as being dynamic, you want it static. So im going to add the same funtionality to the StaticPhysicsObject class.

Hope its clearer now.

DP

Thanks,





For now i’ ll try shochu idea but i think it is thinkable that this could be a way to help the collision detection because I notice that if the ball is hit with enough energy it can pass through the net without having collision detection…



By the way, I’ ve notcied something else… Is it possible that sometimes I receive a OnContact event but the ball is still passing through the object without any physics being applied to it from the contact?

yes, it is very possible your still getting onContact info…I could try to explain it to you if you want?



DP

Hey DP,

Can you let me know when the setting an object type stuff is reasonably working?



In my top down "2d" space fighter I wanted to make the bullets textured quads but set the behavior to be that of a sphere.



Thanks a bunch!

Grab the latest from CVS, its currently only working for DynamicPhysicsObjects which should work fine for your bullet. Im going to add the same functionality for Static objects too.



DP

Awesome …



I’ll give it a shot tonight. Thanks DP. You rock as usual.