Comments (8)
Thank you for your feedbacks @kakoeimon and @dpmkl. So I think we are talking here about letting the user setup some arbitrary filter rule for collision pairs. I think this is something we will want to add, yes.
We will also need #2 which is more efficient but not as versatile.
from rapier.
What do you mean exactly by "collision exceptions"? How is this different from #2 from the end-user point of view?
from rapier.
I would reckon he means something like the collision filter callback in Box2D. https://github.com/erincatto/box2d/blob/master/src/dynamics/b2_world_callbacks.cpp#L28
This could come in handy for 2D Platformer mechanics, where you are able to jump up through platforms but don't fall down through them.
from rapier.
The difference is that you may want an object not to collide with a particular object and not the whole group.
For example a bullet will collide with all the objects but not with the player who shooted it.
from rapier.
[Edit: oh, I guess this is a dup of #2 if my interpretation is correct.]
Some examples:
- Chain or cloth: allow each link to interpenetrate its neighbors, but collide normally with everything else
- 2D physics: often you want to ignore self-collision (e.g. in a side-view game with a walking character, the character's legs should be able to cross each other).
- (Sort of the same): 2D game with pseudo-depth in Z: objects should be able to pass in front of/behind other layers, but still hit their own layer.
- Bullet / grenade that ignores shooter / thrower but can hit everything else. [From @kakoeimon's reply]
The most general form of this would be an arbitrary predicate saying whether a pair of objects can collide or not. But simple filter bitmasks are faster and useful enough for many cases. Examples:
- In Box2d each object has a 32-bit "category" and a 32-bit "mask", and collisions require
obj1.cat& obj2.mask && obj2.cat & obj1.mask
: http://www.iforce2d.net/b2dtut/collision-filtering - In NVidia's flex there's a 32-bit "phase", with a 24-bit "group" and a 1-bit "flag" indicating whether a particle should collide with other particles with the same group.
from rapier.
It is not a dup of #2
Think about it as a bullet/granade that can do a frendly fire but cannot damage the shooter/thrower.
This is not just for 2D, neither masks and layers are.
Those two #2 and this are essential in game making. Especialy if there are no plans to expose to the user checks just before the collision detection.
If there are plans to expose to the users a way to make checks before the actual collision detection then there is no need to implement this, neither #2 and the user can implement his own checkings.
from rapier.
I'm not sure how what you're describing differs from "an arbitrary predicate saying whether a pair of objects can collide or not"?
It is not a dup of #2 ...
Think about it as a bullet/granade that can do a friendly fire but cannot damage the shooter/thrower.
This is not just for 2D, neither masks and layers are.
I wasn't saying it's only for 2D (e.g. the cloth example only makes sense in 3D). I was just giving some examples of when it's useful, and two of them happened to be for 2D.
from rapier.
Yes without the "But" It does not differ.
from rapier.
Related Issues (20)
- Crashes iOS 14 Safari
- Benchmarks webpage is not working HOT 1
- Need predict_position_using_velocity() without forces
- panic_bounds_check when solving spring joint HOT 2
- How do you simulate refraction? HOT 5
- Objects retain all velocity while moving through a Sensor HOT 4
- `KinematicCharacterController` climbing and sliding along along vertical walls are broken
- `KinematicCharacterController` doesn't respect `offest` HOT 1
- `dyn PhysicsHooks` cannot be shared between threads safely --> WASM compile fails HOT 1
- Perfectly Elastic Ball Loses Velocity After Bounces in Zero Gravity Environment HOT 2
- 2D Rigidbody type changing from Kinematic->Dynamic at runtime doesn't work HOT 2
- Bug: Incrementally-updated `QueryPipeline` memory usage linearly grows over time.
- How do I properly enable parallel in rapier3d? HOT 2
- Add support for custom friction and bounce CombineRules
- Built app WASM issue after upgrading to 0.13.1 HOT 4
- EPA convergence failure on capsules
- Very large 2d cuboid "ground" destabilizes simulation
- Perfectly elastic objects gain energy with TGS soft in Newton's cradle example HOT 1
- parry2d v0.15.0 yanked HOT 4
- rapier3d doesn't compile with simd-nightly HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rapier.