-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
💥 Add collisions methods #9
Conversation
BoxVsBox BoxVsSphere SphereVsBox SphereVsSphere
…methods 🧑🚀 Physics engine utils: movement methods
…ollisions-methods
negative size object are now consider object with a positive size but in the opposite direction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, but I'm not a fan of the "VS" naming 👀
rename from "ShapeVsShape" to "ShapeCollideShape"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the functions but not sure about the use,
We will add components like RectCollider, RoundCollider that will use these functions in their inner logic and will refer to a Transform Component to get the position / dimensions of these geometrics elements?
Update CI and good for me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good for me ! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not going to approve or disapprove this.
I believe what you did is working, there is no problem with that but it looks like your system is really 'rigid'. What I mean by that is, that whenever we will want to add another X collide with Y we will need to update Physics::Collision class.
My idea would have been to make an ICollider interfaces that would provide some way of mathematically know wether it's colliding with something.
The result code in Physics::Collision would look like this
bool isColliding(const ICollider &a, const IColllider &b) {
const aEquation = a.getCollisionEquation();
const bEquation = b.getCollisionEquation();
const mixed = // some math stuff
return // math result
}
This is all theoretical but I believe, if possible, a system like this would be better.
Maybe SDF ??
…ollisions-methods
de305d7
to
5734f35
Compare
ICollider, box and sphere are now on a fille Collider.hpp/cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
…ollisions-methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just split your classes like don't put Sphere and Box Collider in the same file. Same for Physics.hpp
remove collider cpp since it was basically the code for boxes and shperes but keeped the hpp with the interfact og a collider
…ollisions-methods
collisions methods to collide boxes and spheres