Hey,
I'm new here and to Box2D. Thanks a lot to Erin, your work is great. I'm using the Java port version, so also thanks to those who did that.
The thread title is somewhat stupid, I couldn't think of one that fits into the maximum title length... 🙂
Currently, I'm looking for a way to compare shapes. I've got a contact listener and I want to find out which particular shapes are part of a collision (more concrete: there's a ball and two goals and I want to find out which goal the ball collided with). Trying to do it with shape1 == myShape doesn't work, they're two different objects (although describing the same shape), and shape1.equals(myShape) doesn't work as well. So obviously, the contact listener works with copies.
So, are there any simple means of doing shape comparisons that I've not found so far, or should I use set up different categories (and masks) and compare those?
Thanks, Sascha
Edit: I found a workaround that uses userdata objects as a means of identification. It's enough for this project, but it's surely not the perfect way to do it.
I'm new here and to Box2D. Thanks a lot to Erin, your work is great. I'm using the Java port version, so also thanks to those who did that.
The thread title is somewhat stupid, I couldn't think of one that fits into the maximum title length... 🙂
Currently, I'm looking for a way to compare shapes. I've got a contact listener and I want to find out which particular shapes are part of a collision (more concrete: there's a ball and two goals and I want to find out which goal the ball collided with). Trying to do it with shape1 == myShape doesn't work, they're two different objects (although describing the same shape), and shape1.equals(myShape) doesn't work as well. So obviously, the contact listener works with copies.
So, are there any simple means of doing shape comparisons that I've not found so far, or should I use set up different categories (and masks) and compare those?
Thanks, Sascha
Edit: I found a workaround that uses userdata objects as a means of identification. It's enough for this project, but it's surely not the perfect way to do it.