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

JointData.revolute multiple axes #279

Open
EthanHermsey opened this issue Jun 1, 2022 · 3 comments
Open

JointData.revolute multiple axes #279

EthanHermsey opened this issue Jun 1, 2022 · 3 comments

Comments

@EthanHermsey
Copy link

EthanHermsey commented Jun 1, 2022

Hey,

I am having trouble with revolute joints. I have tried this with https://cdn.skypack.dev/@dimforge/rapier3d-compat and with webpack and @dimforge/rapier3d@0.8.0-alpha.2.

The javascript 3d userguide ánd the joint example shows that you can provide anchor, axis, anchor, axis arguments:

let x = { x: 1.0, y: 0.0, z: 0.0 };
let params = RAPIER.JointParams.revolute({ x: 0.0, y: 0.0, z: 1.0 }, x, { x: 0.0, y: 0.0, z: -3.0 }, x);
let joint = world.createImpulseJoint(params, body1, body2, true);

Those examples both use this RAPIER.JointParams.revolute. However in the docs and in the RAPIER instance I load there's only RAPIER.JointData.revolute. That version of the revolute function only takes 3 arguments; anchor, anchor, axis.

 JointData.revolute = function (anchor1, anchor2, axis) {
        var res = new JointData();
        res.anchor1 = anchor1;
        res.anchor2 = anchor2;
        res.axis = axis;
        res.jointType = JointType.Revolute;
        return res;
    };
    pub fn new(axis: UnitVector<Real>) -> Self {
        let data = GenericJointBuilder::new(JointAxesMask::LOCKED_REVOLUTE_AXES)
            .local_axis1(axis)
            .local_axis2(axis)
            .build();
        Self { data }
    }

I would really like to be able to use specific axes per body. I don't even understand how it would work with just one. Am I doing something wrong, or is this a translation error or something? It should be Axis1, Axis2.

For example, if you connect two cuboid body's with a revolute joint; body1 on the top and body2 on the right side. You'd want to set the y-axis for body1 and the x-axis for body2. Right?

Thanks in advance,

Ethan

@EthanHermsey EthanHermsey changed the title JointData.revolute multiple axes. JointData.revolute per body axis Jun 1, 2022
@EthanHermsey EthanHermsey changed the title JointData.revolute per body axis JointData.revolute axis per body Jun 1, 2022
@EthanHermsey EthanHermsey changed the title JointData.revolute axis per body JointData.revolute multiple axes Jun 1, 2022
@EthanHermsey
Copy link
Author

I'm only now looking at the changelogs and see that much has changed in this last update..
Downgrading to 0.7.6 fixed this particular problem, for now.

@gmmyung
Copy link

gmmyung commented Apr 1, 2023

I have encountered the same issue. Are there any updates on this?

@EthanHermsey
Copy link
Author

Not from my end, sorry. Went back to ammo.js.

@Vrixyz Vrixyz transferred this issue from dimforge/rapier Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants