I want to apply physics. Do you have any recommendations?
I want to Use Physics with your Shapes Plugin.
Will Unity Collider 2D work?
I want to Use Physics with your Shapes Plugin.
Will Unity Collider 2D work?
sure! you can use whatever physics you want, Shapes is just a rendering library, and can be applied on top of whatever you're using
One more Question.
How can I get vertices of shapes?
rex)Regularpolygon can change shapes by sides and I want to get it.
there's no built-in function for it, but it's relatively straightforward to mathematically calculate:
public Vector2 GetVertex( int i ) { float ang = i * ShapesMath.TAU / sides + angle; return ShapesMath.AngToDir( ang ) * radius; }
Does this mean I need to implement a GetVertex() function for every type of Shape?
Is there a smarter approach, or has there been a recent update that helps with this?
I was considering using a vertex-related function from the parent class ShapeRenderer, but I couldn’t find anything that fits this use case.
I also considered using a Polygon Collider 2D for the Disc, but it seems to be more complex than expected.
sure! you can use whatever physics you want, Shapes is just a rendering library, and can be applied on top of whatever you're using