-
Notifications
You must be signed in to change notification settings - Fork 44
HeightField Collision shape #62
Comments
Hi, |
Hi, thanks @elegaanz! Adding a new collision shape shouldn't be too hard. Add the new variant to However.... I am currently making some big changes (see: #31 (comment)). So you might want to wait 2-3 days, to avoid unnecessary conflicts. (I plan to merge theses changes this weekend) |
Ah, and if you need help, you can either open a draft PR and/or contact me on discord (@jomag) |
I started something, just to get a bit more familiar with the code, even if I need to redo it in a few days, and I have a question: in 2D heightfields are defined by a single-dimension array, but for 3D you need a matrix/two dimensional array. Is something like that a good idea? enum Body {
// ...
HeightField {
#[cfg(feature = "2d")]
heigths: Vec<f32>,
#[cfg(feature = "3d")]
heigths: Vec<Vec<f32>>,
} Or is there a better way? |
I merged the changes I was talking about. So you can take the latest version of Yes, you can use The You'll also needs a In 2d it's a enum CollisionShape {
// ...
#[cfg(not(all(feature = "2d", feature = "3d")))]
HeightField {
scale: f32,
#[cfg(feature = "2d")]
heigths: Vec<f32>,
#[cfg(feature = "3d")]
heigths: Vec<Vec<f32>>,
}
} P.S. The enum is now named "CollisionShape" ;-) |
No description provided.
The text was updated successfully, but these errors were encountered: