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

JointType FIXED implementation - Error in code? #4

Open
SubtleMetaphor opened this issue Sep 17, 2021 · 1 comment
Open

JointType FIXED implementation - Error in code? #4

SubtleMetaphor opened this issue Sep 17, 2021 · 1 comment

Comments

@SubtleMetaphor
Copy link

SubtleMetaphor commented Sep 17, 2021

if (this.type == JointType.FIXED) {
            let q = globalPose0.q;
            q.conjugate();
            q.multiplyQuaternions(globalPose1.q, q);
            let omega = new THREE.Vector3();
            omega.set(2.0 * q.x, 2.0 * q.y, 2.0 * q.z);
            if (omega.w < 0.0)
                omega.multiplyScalar(-1.0);
            applyBodyPairCorrection(body0, body1, omega, this.compliance, dt);						
        }

line 322 in pages/challenges/PBD.js:

if (omega.w < 0.0)

omega is vector3, has no member w. Was q meant?

@leoxupku
Copy link

I think so, just using "q" to replace is resonable

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