Need help creating basketball net with physics joints?

Hey everyone,

I am creating a basketball net using physics joints. My problem is that, the ball ends up sitting on top of the joints, and does not go through naturally. How do I make the ball go naturally through the net, while keeping the graphical effect of the net moving? (If I make isSensor = true on the net, then there is no graphical effect). Any solutions? Thanks. [import]uid: 175550 topic_id: 34097 reply_id: 334097[/import]

Hello,
Do you want to assemble the net like a complex arrangement of “strings/threads”, each one attached by physics joints? This should be possible, but it’s going to be complex and it might not behave exactly as you imagine a real basketball net would… however, worth a try I think. I guess the approach would be, you build the net out of many thin rectangles, and then bind them to each other at certain points.

Brent
[import]uid: 200026 topic_id: 34097 reply_id: 135640[/import]

Yeah thats what I want to do. Sorry for the bother, but could you provide an example of the thin rectangle method? [import]uid: 175550 topic_id: 34097 reply_id: 135691[/import]

Hello,
There should be a “chains” sample app in the Corona application SampleCode directory… look under the Physics folder to find it. This sample attaches lots of little pieces to each other using joints, and you could mimic that to bind your net’s “strings” together.

The main difference would be, if it’s a side view net, you probably want only the left and right sides of the net to interact with the ball (so the ball can travel through from the top). The middle joining segments would need to have their collision filters adjusted to skip interaction with the ball, but maintain collision with themselves and the edge segments.

Overall, this is a fairly complicated physics scenario, and if you make good progress with it, I’d like to see the result!

Brent [import]uid: 200026 topic_id: 34097 reply_id: 135717[/import]

Thank you so much for guidance! One last question…to add a filter on the middle chains in the net, do I have two separate physics joints? One for the outside chains, and the other for the middle chains with a filter? [import]uid: 175550 topic_id: 34097 reply_id: 135828[/import]

Hi there,
Yep, you basically just need to configure three different filter values, one for the outside parts, another for the inside parts, another for the basketball. You can figure this out using the collision filter chart that I wrote awhile back (but it’s still totally relevant, nothing has changed in the system).

http://developer.coronalabs.com/forum/2010/10/25/collision-filters-helper-chart

Brent
[import]uid: 200026 topic_id: 34097 reply_id: 135850[/import]

Hello,
Do you want to assemble the net like a complex arrangement of “strings/threads”, each one attached by physics joints? This should be possible, but it’s going to be complex and it might not behave exactly as you imagine a real basketball net would… however, worth a try I think. I guess the approach would be, you build the net out of many thin rectangles, and then bind them to each other at certain points.

Brent
[import]uid: 200026 topic_id: 34097 reply_id: 135640[/import]

Yeah thats what I want to do. Sorry for the bother, but could you provide an example of the thin rectangle method? [import]uid: 175550 topic_id: 34097 reply_id: 135691[/import]

Hello,
There should be a “chains” sample app in the Corona application SampleCode directory… look under the Physics folder to find it. This sample attaches lots of little pieces to each other using joints, and you could mimic that to bind your net’s “strings” together.

The main difference would be, if it’s a side view net, you probably want only the left and right sides of the net to interact with the ball (so the ball can travel through from the top). The middle joining segments would need to have their collision filters adjusted to skip interaction with the ball, but maintain collision with themselves and the edge segments.

Overall, this is a fairly complicated physics scenario, and if you make good progress with it, I’d like to see the result!

Brent [import]uid: 200026 topic_id: 34097 reply_id: 135717[/import]

Thank you so much for guidance! One last question…to add a filter on the middle chains in the net, do I have two separate physics joints? One for the outside chains, and the other for the middle chains with a filter? [import]uid: 175550 topic_id: 34097 reply_id: 135828[/import]

Hi there,
Yep, you basically just need to configure three different filter values, one for the outside parts, another for the inside parts, another for the basketball. You can figure this out using the collision filter chart that I wrote awhile back (but it’s still totally relevant, nothing has changed in the system).

http://developer.coronalabs.com/forum/2010/10/25/collision-filters-helper-chart

Brent
[import]uid: 200026 topic_id: 34097 reply_id: 135850[/import]