Open avardy opened 5 years ago
Polygonal bodies completely change the entire physics system to be really complex and slow , which is why we wrote cwaggle in the first place! Arbitrary polygon intersections are very expensive computations. This will be a very very long term implementation and I don't expect I'll get to it any time soon
You can 'get around' this by hacking together a system that just changes the position of some of your entities with LineBody(s) to follow their position as they move
On polygonal bodies: okay, fair point. On the LineBody idea: not 100% sure what you mean. Something like creating a temporary LineBody (s) at the robot's current position, then immediately removing them? Other idea: multiple CircleBody components per robot, allowing you to approximate other shapes. Is that a bit more doable?
The problem is the 'linking' of the multiple bodies together, which completely changes how the physics engine works. Can you give a concrete example of something you need to do?
I want to simulate a non-circular robot with a wedge-shaped plow at the front.
That's going to take more work to implement than writing the entire simulator has so far. You can simulate a wedge right now with two linebody entities, if you manually update the position of the lines. However they can currently only interact with things that have circlebodies
Okay, I'll give the linebody wedge a go. It means I will get more realistic collisions between robots and pucks. Collisions between robots will be slightly less realistic (both just circles), but that's okay.
I have a version of the linebody wedge working.. Currently however I get pucks trapped between the two linebodys and the circlebody of the robot. But I have an idea to fix this.
Nice!
Actually, any ability to incorporate more complex body geometry would be helpful. This could be adding a triangle component or extending the current CLineBody component so that it could be attached to a robot.