dimforge / rapier.rs

Official website for the Rapier physics engine.
https://rapier.rs
17 stars 48 forks source link

Adding collision groups/solver groups doesn't seem to be working #100

Closed shnCanos closed 1 month ago

shnCanos commented 1 year ago

In the first example shown here, there are two missing parentheses that finish the insert() part. Furthermore, upon adding the parenthesis and pasting the code into my own project I get an error, as you can see in the image below.

image

I must admit I only skimmed through the documentation, and therefore my shallow understanding of the particulars of this crate may have caused some kind of misunderstanding, leading to this.

I apologize if this issue was a product of my own stupidity, and insight would be greatly appreciated

BlondeBurrito commented 1 year ago

Try constructing from the Group struct and it should work, that's how I've got it working in my simulation anyhow - maybe the docs need updating if there's no impl of From

.insert(CollisionGroups::new(Group::from_bits(0b1101).unwrap(), Group::from_bits(0b0100).unwrap())
shnCanos commented 1 year ago

I see, that does make sense. I did a small test and, with the way you demonstrated, it worked as expected.

I appreciate your help!

I'll leave the issue open since the docs appear to be wrong

Vrixyz commented 1 month ago

This has been fixed in the docs since then

edit: mh maybe not, transferring to rapier.rs ; still closing as duplicate for https://github.com/dimforge/rapier.rs/issues/75 ; thanks for providing a solution though ! We'll work on updating the docs 🫂