diff options
Diffstat (limited to 'src/dynamics/joint/revolute_joint.rs')
| -rw-r--r-- | src/dynamics/joint/revolute_joint.rs | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/dynamics/joint/revolute_joint.rs b/src/dynamics/joint/revolute_joint.rs index 28e3968..9400ba8 100644 --- a/src/dynamics/joint/revolute_joint.rs +++ b/src/dynamics/joint/revolute_joint.rs @@ -10,7 +10,8 @@ use crate::math::UnitVector; #[repr(transparent)] /// A revolute joint, locks all relative motion except for rotation along the joint’s principal axis. pub struct RevoluteJoint { - data: GenericJoint, + /// The underlying joint data. + pub data: GenericJoint, } impl RevoluteJoint { @@ -38,6 +39,17 @@ impl RevoluteJoint { &self.data } + /// Are contacts between the attached rigid-bodies enabled? + pub fn contacts_enabled(&self) -> bool { + self.data.contacts_enabled + } + + /// Sets whether contacts between the attached rigid-bodies are enabled. + pub fn set_contacts_enabled(&mut self, enabled: bool) -> &mut Self { + self.data.set_contacts_enabled(enabled); + self + } + /// The joint’s anchor, expressed in the local-space of the first rigid-body. #[must_use] pub fn local_anchor1(&self) -> Point<Real> { @@ -136,7 +148,7 @@ impl Into<GenericJoint> for RevoluteJoint { /// A revolute joint locks all relative motion except for rotations along the joint’s principal axis. #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[derive(Copy, Clone, Debug, PartialEq)] -pub struct RevoluteJointBuilder(RevoluteJoint); +pub struct RevoluteJointBuilder(pub RevoluteJoint); impl RevoluteJointBuilder { /// Creates a new revolute joint builder. @@ -153,6 +165,13 @@ impl RevoluteJointBuilder { Self(RevoluteJoint::new(axis)) } + /// Sets whether contacts between the attached rigid-bodies are enabled. + #[must_use] + pub fn contacts_enabled(mut self, enabled: bool) -> Self { + self.0.set_contacts_enabled(enabled); + self + } + /// Sets the joint’s anchor, expressed in the local-space of the first rigid-body. #[must_use] pub fn local_anchor1(mut self, anchor1: Point<Real>) -> Self { |
