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

Quaternion Based 6DOF Spring Joint Constraint #4316

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

19PHOBOSS98
Copy link

@19PHOBOSS98 19PHOBOSS98 commented Aug 9, 2022

Hello, I saw that there was a "demand" for Quaternion Based 6DOF Spring Joint Constraint calculation:

#4162
https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=8153

So I made a new class:

btGeneric6DofSpringConstraintQuaternion

Based on btGeneric6DofSpring2Constraint.
This class was made to provide more control over spring joint "equilibrium" rotation using quaternions instead of Euler Axes. This makes it useful for "puppeteering" joint controlled active ragdolls.

I also took the liberty of adding in a new example scene in the explorer.
image
(Quaternion Based Joints (left, center); Euler Axis Based Joint (right))
Per the image, the set equilibrium angles are as follows: X:0° Y:90° Z:45°

More rotation settings are available in the DOF6SpringQuatSetup.cpp file. Change the following macro definitions as you see fit:
USE_6DOF(Q, ,2)
ROTATION_([1-6])

image
image

Quaternion Based 6DOF Spring Joint Constraint.

by PHOBOSS (Kim Obordo) on 2022 August

The btGeneric6DofSpringConstraintQuaternion class is based on btGeneric6DofSpring2Constraint.
This class was made to provide more control over spring joint "equilibrium" rotation using quaternions instead of Euler Axes.
This makes it useful for "puppeteering" joint controlled active ragdolls.
@19PHOBOSS98 19PHOBOSS98 marked this pull request as ready for review August 9, 2022 13:21
@19PHOBOSS98
Copy link
Author

19PHOBOSS98 commented Aug 9, 2022

If there's anything I missed, I'd be happy to comply.

@19PHOBOSS98 19PHOBOSS98 changed the title Add files via upload Quaternion Based 6DOF Spring Joint Constraint Aug 9, 2022
oops forgot to add the example setup
oops, forgot to add the example setup
something is wrong with that space on line 156, imma try and delete it
I tried deleting the other empty line on 154 as well... it didn't work so I guess I'll put it back. I'll add a space in line 157, hope this gets rid of the red
@19PHOBOSS98
Copy link
Author

image
hmm, for some reason it found function "Dof6SpringQuatCreateFunc" unresolved...

added the "../CommonInterfaces/CommonExampleInterface.h" header. Trying to resolve the AppVeyor issue.
Retrying AppVeyor compile
@19PHOBOSS98
Copy link
Author

image
Nope, still didn't work... what gives?

@19PHOBOSS98
Copy link
Author

image Nope, still didn't work... what gives?

Its an exact copy of Dof6Spring2Setup.cpp (.h) I just renamed the function

got rid of the "../CommonInterfaces/CommonExampleInterface.h" include
I almost forgot to attribute where I got the quaternion calculation
added btGeneric6DofSpringConstraintQuaternion.cpp directory
added btGeneric6DofSpringConstraintQuaternion.cpp directory
@erwincoumans
Copy link
Member

Thanks for the PR. From Appveyor failed build, it looks like the build is broken. Some cmake or premake build files need updating, adding the new c++ file?

@19PHOBOSS98
Copy link
Author

Thanks for the PR. From Appveyor failed build, it looks like the build is broken. Some cmake or premake build files need updating, adding the new c++ file?

Hello. Sorry for the late reply. I hope I'm not too late to get this PR accepted. I'm not sure what part of the cmake file to update or what c++ file I should add to resolve this. What should I do?

@19PHOBOSS98
Copy link
Author

Thanks for the PR. From Appveyor failed build, it looks like the build is broken. Some cmake or premake build files need updating, adding the new c++ file?

Hello. Sorry for the late reply. I hope I'm not too late to get this PR accepted. I'm not sure what part of the cmake file to update or what c++ file I should add to resolve this. What should I do?

I might be wrong but I think I figured it out. I think I have to update this cmake file under this directory:
Screen Shot 2023-01-29 at 10 38 27 PM

I have to add in my DOF6SpringQuatSetup somewhere here:

Screen Shot 2023-01-29 at 10 38 19 PM

brb...

added `DOF6SpringQuatSetup` to examples/ExampleBrowser/CMakeLists.txt
@19PHOBOSS98
Copy link
Author

noice, it worked!

@19PHOBOSS98
Copy link
Author

@erwincoumans, please review :)

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

Successfully merging this pull request may close these issues.

None yet

2 participants