Add #[must_use] to builders, expose more fields
This commit is contained in:
@@ -564,21 +564,23 @@ impl RigidBody {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A builder for rigid-bodies.
|
/// A builder for rigid-bodies.
|
||||||
|
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||||
|
#[must_use = "Builder functions return the updated builder"]
|
||||||
pub struct RigidBodyBuilder {
|
pub struct RigidBodyBuilder {
|
||||||
position: Isometry<Real>,
|
pub position: Isometry<Real>,
|
||||||
linvel: Vector<Real>,
|
pub linvel: Vector<Real>,
|
||||||
angvel: AngVector<Real>,
|
pub angvel: AngVector<Real>,
|
||||||
gravity_scale: Real,
|
pub gravity_scale: Real,
|
||||||
linear_damping: Real,
|
pub linear_damping: Real,
|
||||||
angular_damping: Real,
|
pub angular_damping: Real,
|
||||||
rb_type: RigidBodyType,
|
pub rb_type: RigidBodyType,
|
||||||
mprops_flags: RigidBodyMassPropsFlags,
|
pub mprops_flags: RigidBodyMassPropsFlags,
|
||||||
mass_properties: MassProperties,
|
pub mass_properties: MassProperties,
|
||||||
can_sleep: bool,
|
pub can_sleep: bool,
|
||||||
sleeping: bool,
|
pub sleeping: bool,
|
||||||
ccd_enabled: bool,
|
pub ccd_enabled: bool,
|
||||||
dominance_group: i8,
|
pub dominance_group: i8,
|
||||||
user_data: u128,
|
pub user_data: u128,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RigidBodyBuilder {
|
impl RigidBodyBuilder {
|
||||||
|
|||||||
@@ -197,6 +197,7 @@ impl Collider {
|
|||||||
/// A structure responsible for building a new collider.
|
/// A structure responsible for building a new collider.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
||||||
|
#[must_use = "Builder functions return the updated builder"]
|
||||||
pub struct ColliderBuilder {
|
pub struct ColliderBuilder {
|
||||||
/// The shape of the collider to be built.
|
/// The shape of the collider to be built.
|
||||||
pub shape: SharedShape,
|
pub shape: SharedShape,
|
||||||
|
|||||||
Reference in New Issue
Block a user