GithubHelp home page GithubHelp logo

Comments (2)

jrouwe avatar jrouwe commented on July 22, 2024

What you've created with the example code is this:

image

The constraint enforces the local space mPoint1 and mPoint2 to coincide in world space. It also enforces that the green axis align in world space. If the red axis align in world space we have HingeConstraint::GetCurrentAngle() == 0.

In your example, as soon as the simulation starts, the bodies move together so that their COM's coincide (because both points were set to 0):

image

and then they can rotate like this (the shared green axis):

image

from joltphysics.

fhoenig avatar fhoenig commented on July 22, 2024

Thanks for clarifying. This is indeed the behavior I have observed.

I guess the confusion came from HingeConstraintSettings when defined in world space. In that case the really only meaningful way to "fill out" that struct is to set point and axis to the same values, like in all examples. I thought you could define two relative rotational degrees of freedom with this single constraint. Like a wheel that rotates but also can "squat" sideways, like some cars when accelerating.

from joltphysics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.