btTypedConstraintType and getWorldTransform() incorrect ?

Post Reply
IresomPCH
Posts: 18
Joined: Tue Sep 24, 2013 12:29 pm

btTypedConstraintType and getWorldTransform() incorrect ?

Post by IresomPCH »

Hello,

I'm current testing the 2.83.5 version, and some minor issues shows up. :wink:

The btTypedConstraintType of btFixedConstraint returns D6_SPRING_2_CONSTRAINT_TYPE instead of FIXED_CONSTRAINT_TYPE.
It should be FIXED_CONSTRAINT_TYPE, right ?
(since the btFixedConstraint inherited from btGeneric6DofSpring2Constraint)
This issue exists since the 2.83.4 version. :roll:

Second, when calling btRigidBodyA->getWorldTransform() of btGeneric6DofSpring2Constraint, it always return an identity matrix.
However, the btRigidBodyB->getWorldTransform() works well.
On the other hand, btRigidBodyA->getWorldTransform() and btRigidBodyB->getWorldTransform() are both OK for btFixedConstraint...
This issue exists since the 2.83.5 version, not in 2.83.4.

Any ideas? Thanks~
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: btTypedConstraintType and getWorldTransform() incorrect

Post by Erwin Coumans »

IresomPCH wrote:Hello,
The btTypedConstraintType of btFixedConstraint returns D6_SPRING_2_CONSTRAINT_TYPE instead of FIXED_CONSTRAINT_TYPE.
It should be FIXED_CONSTRAINT_TYPE, right ?
No, the btFixedConstraint is now derived from btGeneric6DofSpring2Constraint and doesn't override the serialization. When importing the data, is should return as a regular btGeneric6DofSpring2Constraint, but behave as a fixed constraint, all 6 DOFs are locked between the 2 bodies.
Second, when calling btRigidBodyA->getWorldTransform() of btGeneric6DofSpring2Constraint, it always return an identity matrix.
rigidBodyA and rigidBodyB of a btGeneric6DofSpring2Constraint returns the proper getWorldTransform here, without problem. Try attached is a modified file that shows correct behaviour, just run the example browser.

If you can reproduce it, please file an issue by modifying the examples/Constraints/Dof6Spring2Setup.cpp, you might have hit some special case.
Thanks,
Erwin
Attachments
Dof6Spring2Setup.cpp
(18.83 KiB) Downloaded 242 times
anthrax11
Posts: 72
Joined: Wed Feb 24, 2010 9:49 pm

Re: btTypedConstraintType and getWorldTransform() incorrect

Post by anthrax11 »

I think the confusion comes from the fact that FIXED_CONSTRAINT_TYPE is still defined in btTypedConstraintType. I've received this same question from a BulletSharp user.
Post Reply