aboutsummaryrefslogtreecommitdiff
path: root/src/dynamics/joint
diff options
context:
space:
mode:
Diffstat (limited to 'src/dynamics/joint')
-rw-r--r--src/dynamics/joint/fixed_joint.rs6
-rw-r--r--src/dynamics/joint/multibody_joint/multibody.rs8
-rw-r--r--src/dynamics/joint/multibody_joint/multibody_joint_set.rs1
-rw-r--r--src/dynamics/joint/spherical_joint.rs6
4 files changed, 19 insertions, 2 deletions
diff --git a/src/dynamics/joint/fixed_joint.rs b/src/dynamics/joint/fixed_joint.rs
index 10c4d7e..c7ca904 100644
--- a/src/dynamics/joint/fixed_joint.rs
+++ b/src/dynamics/joint/fixed_joint.rs
@@ -7,6 +7,12 @@ pub struct FixedJoint {
data: JointData,
}
+impl Default for FixedJoint {
+ fn default() -> Self {
+ FixedJoint::new()
+ }
+}
+
impl FixedJoint {
pub fn new() -> Self {
#[cfg(feature = "dim2")]
diff --git a/src/dynamics/joint/multibody_joint/multibody.rs b/src/dynamics/joint/multibody_joint/multibody.rs
index e31a333..f2fa623 100644
--- a/src/dynamics/joint/multibody_joint/multibody.rs
+++ b/src/dynamics/joint/multibody_joint/multibody.rs
@@ -18,7 +18,7 @@ use na::{
};
#[repr(C)]
-#[derive(Copy, Clone, Debug)]
+#[derive(Copy, Clone, Debug, Default)]
struct Force {
linear: Vector<Real>,
angular: AngVector<Real>,
@@ -91,7 +91,11 @@ pub struct Multibody {
coriolis_w: Vec<OMatrix<Real, AngDim, Dynamic>>,
i_coriolis_dt: Jacobian<Real>,
}
-
+impl Default for Multibody {
+ fn default() -> Self {
+ Multibody::new()
+ }
+}
impl Multibody {
/// Creates a new multibody with no link.
pub fn new() -> Self {
diff --git a/src/dynamics/joint/multibody_joint/multibody_joint_set.rs b/src/dynamics/joint/multibody_joint/multibody_joint_set.rs
index 24b329f..3e786e2 100644
--- a/src/dynamics/joint/multibody_joint/multibody_joint_set.rs
+++ b/src/dynamics/joint/multibody_joint/multibody_joint_set.rs
@@ -75,6 +75,7 @@ impl Default for MultibodyJointLink {
}
}
+#[derive(Default)]
/// A set of rigid bodies that can be handled by a physics pipeline.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Clone)]
diff --git a/src/dynamics/joint/spherical_joint.rs b/src/dynamics/joint/spherical_joint.rs
index 581b959..194682d 100644
--- a/src/dynamics/joint/spherical_joint.rs
+++ b/src/dynamics/joint/spherical_joint.rs
@@ -8,6 +8,12 @@ pub struct SphericalJoint {
data: JointData,
}
+impl Default for SphericalJoint {
+ fn default() -> Self {
+ SphericalJoint::new()
+ }
+}
+
impl SphericalJoint {
pub fn new() -> Self {
let data =