-
Notifications
You must be signed in to change notification settings - Fork 46
Cone collision shape #64
Comments
I'm interested in implementing this. But how would this work with 2d? The first implementation that comes to mind is having extra enum variants to enum CollisionShape {
Sphere { radius: f32 },
Capsule { half_segment: f32, radius: f32 },
// etc.
#[cfg(dim3)]
Cone { height: f32, radius: f32 },
} I don't even know if it's even possible to do this (it compiles fine, but it seems to just mark the field as non-existent). If it works there is still the question to know how the API will look like. Is this satisfactory? It's easy to make a point against it. I may be lacking imagination but I don't see the alternative. (edit1) Potential alternativeHave it not marked as |
Hi, Thanks for looking into it. Indeed cone make sense only in 3d. There is no such thing as a 2d code. You can expose the cone variant behind a You can also use this opportunity to add a
I'm not sure to understand what questions remain to be answered. Following you'r suggestion usage would be like: commands
.spawn_bundle(PbrBundle::default()) // <-- Render mesh
.insert(RigidBody::Dynamic) // <-- Make it rigid body
// The cone collision shape
.insert(CollisionShape::Cone { heigh: 5.0, radius: 3.0 }) |
At least for the I understand why in term of API stability it is good to use |
Solved by #158 |
No description provided.
The text was updated successfully, but these errors were encountered: