Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added locked_axes() and set_locked_axes() methods for (some) joints #416

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Aztro-dev
Copy link

Implemented locked_axes(&self) for all of these structs:

  • FixedJoint
  • PrismaticJoint
  • RevoluteJoint
  • RopeJoint
  • SphericalJoint

locked_axes(&self) returns all of the axes that are currently locked by the joint.

Implemented set_locked_axes(&mut self, axes: JointAxesMask) for all of these structs:

  • PrismaticJoint
  • RevoluteJoint
  • RopeJoint
  • SphericalJoint

set_locked_axes(&mut self, axes: JointAxesMask) allows you to lock axes that aren't already locked by the default axes.

implemented lock_axes(&mut self, axes: JointAxesMask) for all of these structs:

  • PrismaticJointBuilder
  • RevoluteJointBuilder
  • RopeJointBuilder
  • SphericalJointBuilder

lock_axes(&mut self, axes: JointAxesMask) works exactly the same as set_locked_axes(), but is only implemented for Joint builders.

Made JointAxesMask and JointAxis publicly available, rather than having to import them through rapier.

@Vrixyz
Copy link
Contributor

Vrixyz commented May 21, 2024

Have you considered getters ?

    pub fn get(&self) -> &GenericJoint {
        &self.data
    }

    pub fn get_mut(&mut self) -> &mut GenericJoint {
        &mut self.data
    }

or deref / derefmut derive ?

@Vrixyz Vrixyz added the question Further information is requested label May 21, 2024
@Vrixyz
Copy link
Contributor

Vrixyz commented May 21, 2024

I realized some joints data are pub (SpringJoint, ImpulseJoint), some others are not (those you modified: PrismaticJoint...).

I'm curious why there is a visibility difference there @sebcrozet ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-Medium P-Medium question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants