Allow applying modifications to a Fixture onto an existing Body without any interruptions to the physics simulation during runtime.
Since I have an entity component system within the Faraway.Engine project that has a Transform component that takes in parameters such as Position and Rotation, Scale is omitted as there is no clean solution on implementing a resize method on game objects with the BoxCollider2D component.
Example Physics2D Code
Body body = new Body();
Vertices vertices = PolygonTools.CreateRectangle(5, 5, new Vector2(5, 5), 0);
Fixture fixture = new Fixture(new PolygonShape(vertices, 1.0f));
body.Add(fixture);
// `FixtureList` is a read-only attribute as of now. It won't be exactly like this as
// `FixtureList` is actually a `FixtureCollection`, but it'll be something similar.
body.FixtureList = new List<Fixture>();
Allow applying modifications to a
Fixture
onto an existingBody
without any interruptions to the physics simulation during runtime.Since I have an entity component system within the
Faraway.Engine
project that has aTransform
component that takes in parameters such asPosition
andRotation
,Scale
is omitted as there is no clean solution on implementing a resize method on game objects with theBoxCollider2D
component.Example Physics2D Code