You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working on integrating physics into my project using Bevy_Rapier and encountered an issue when trying to create an instance of MassProperties. Here's the relevant code snippet:
I received the following compiler error indicating that there's no function or associated item named new for MassProperties:
error[E0599]: no function or associated item named `new` found for struct `bevy_rapier3d::dynamics::MassProperties` in the current scope
--> src/setup.rs:42:45
|
42 | bevy_rapier3d::prelude::MassProperties::new(Vec3::ZERO,1.0,Vec3::ONE);
| ^^^ function or associated item not found in `MassProperties`
|
note:if you're trying to build a new `bevy_rapier3d::dynamics::MassProperties`, consider using `bevy_rapier3d::dynamics::MassProperties::from_rapier` which returns `bevy_rapier3d::dynamics::MassProperties`
--> /Users/xbz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_rapier3d-0.25.0/src/dynamics/rigid_body.rs:257:5
|
257 | pub fn from_rapier(mprops: rapier::dynamics::MassProperties, physics_scale:f32) -> Self{
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Could anyone clarify if the new function has been deprecated or replaced? The compiler suggests using from_rapier, but I'm unsure how to correctly apply it in this context, especially concerning the parameters it requires. Any examples or guidance on how to properly initialize MassProperties with the current version of Bevy_Rapier would be greatly appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello Bevy Rapier community,
I'm currently working on integrating physics into my project using Bevy_Rapier and encountered an issue when trying to create an instance of MassProperties. Here's the relevant code snippet:
I received the following compiler error indicating that there's no function or associated item named new for MassProperties:
Could anyone clarify if the new function has been deprecated or replaced? The compiler suggests using from_rapier, but I'm unsure how to correctly apply it in this context, especially concerning the parameters it requires. Any examples or guidance on how to properly initialize MassProperties with the current version of Bevy_Rapier would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions