Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Add circle bodies #443

Closed
5 tasks done
PiotrGardocki opened this issue Apr 13, 2020 · 5 comments
Closed
5 tasks done

Add circle bodies #443

PiotrGardocki opened this issue Apr 13, 2020 · 5 comments
Assignees

Comments

@PiotrGardocki
Copy link
Member

PiotrGardocki commented Apr 13, 2020

  • create circle body component
  • add circle body to components parser
  • make static collisions for circle bodies
  • make kinematic collisions for circle bodies
  • make list of systems to adapt to new mechanic
@PiotrGardocki PiotrGardocki self-assigned this Apr 13, 2020
@meyerzinn
Copy link
Contributor

Are you considering refactoring the current kinematics systems to use some sort of union component instead of storing a rectangle, to enable all of these different collision types?

If you are interested in adding more complex kinematics (i.e., polygons), what are the benefits to writing your own solver as opposed to integrating something like box2d or chipmunk2d?

@PiotrGardocki
Copy link
Member Author

For now we do not plan to add polygons to the game. Rectangles and circles should be enough for our gameplay. I think I already found a solution to optimize current collisions system. Details are in comment here: #444

External physics library would be a solution to some problems, but then we would need to integrate it with our ECS library. I think libraries you mentioned are using their own storage for bodies, so connecting them to the Entt components pools would not be worth the effort.

@Czapa10
Copy link
Member

Czapa10 commented Apr 14, 2020

We're not gonna integrate any kind of physics engine to our game.
Physics engine libary like box2D simulates physics realistically.
In our game we don't want physics to be realistic. We want physics interactions solve the gameplay problems which we have and realistic physics engine doesn't solve these problems. That's why we don't use it.

@Czapa10
Copy link
Member

Czapa10 commented Apr 14, 2020

@20zinnm @PiotrGardocki
Making union component is not the right solution.

Option 1:
We make separate components: RectangleKinematicCollisionBody, CircleKinematicCollisionBody.

Option 2:
We make component like RigidBody which stores things like mass, staticallyMovedUp itd.
And we have another components like: RectCollisionShape, CircleCollisionShape which store collision geometry.

Later we can also make circle collision shapes for static collision body but for now it's not neccessary.

@meyerzinn
Copy link
Contributor

@Czapa10 That's fair. I think Option 2 is how most other "physics" engines work, where there's a rigidbody that stores general information and a flag that indicates what geometry to use.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants