dimforge / bevy_rapier

Official Rapier plugin for the Bevy game engine.
https://rapier.rs
Apache License 2.0
1.2k stars 257 forks source link

Support for quad/rect 2D shape in 3D (or degenerate cuboid)? #461

Open djeedai opened 7 months ago

djeedai commented 7 months ago

Hi,

Is it possible to use a degenerate cuboid shape in 3D to simulate a quad/rect 2D shape? That is, setting one half-extent to 0.? By "possible" I mean both whether this works in the first place, and whether this is optimal performance-wise, so handled as a single face instead of a 6-face cube?

Otherwise, what option is there for a quad/rect 2D shape in 3D? I'm surprised this is not supported as built-in given the wide variety of shapes already supported, did I miss something? Should I use a triangle mesh? That feels a bit sub-optimal.

Thanks! :)

ghost commented 5 months ago

Not sure it's gonna be optimized if you flat a value to 0. But maybe you want something like a "Coumpound shape" https://docs.rs/bevy_rapier3d/latest/bevy_rapier3d/geometry/struct.Collider.html#