Twist-Cone vs 6-Dof... where to place your bets?

User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Twist-Cone vs 6-Dof... where to place your bets?

Post by Dragonlord »

I updated right now to the latest bullet version to see how the constraint issues behave. In general the simulation is a lot more stable as three versions ago but ragdolls still yield a heck lot of troubles. Now this is also possibly due to the conversions I need to do to match bullet to my system. Yet though one major question stays put in the room:

What is better to use for constraints with 3 limited ( but not locked ) angular constraints? Cone-Twist or 6-Dof?
mickey
Posts: 107
Joined: Fri Sep 19, 2008 6:08 pm

Re: Twist-Cone vs 6-Dof... where to place your bets?

Post by mickey »

Hi

wondering what sort of problem do you encounter with the rag dolls?

I am implementing bullet ragdolls with dx right now although I don't encounter any problem with Bullet's ragdoll, I do encounter problem on orienting the skinned mesh correctly to match bullet's rag doll. actually here's a link to my thread: http://www.bulletphysics.com/Bullet/php ... f=9&t=2871.

Sorry to not directly answering your question, though I was using cone twist earlier I could not find a method to get the angular data among the axis so i resorted with 6dof.
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Re: Twist-Cone vs 6-Dof... where to place your bets?

Post by Dragonlord »

The problem is mostly with (1) exploding constraints and (2) strange orientation behavior. The later on is because in my game engine I allow the modeller to place any angular limits he wants but TwistCone expects them to be centered with a swing ( although I could not figure out yet if the swing is from maximum to minimum or the deviation from the center which would be half this angle ). This requires some adjustment rotations to work which I want to do after I fixed the above mentioned problems. For testing I used some non-game model I made once for the fun of it and rigged it. Due to the nature of the model I used only spheres for most parts ( and capsules for the rest ) since the matched well enough. Problem though is as mentioned that the swing limits seem to be disrespected. I set for example on the tail a twist limit of 10° in each direction but yet it turns around to 90° roughly. This entire TwistCone just gives me hell of headaches and I'm not sure if it's worth trying to fix this guy and instead heading to 6-dof.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Twist-Cone vs 6-Dof... where to place your bets?

Post by Erwin Coumans »

Dragonlord wrote:The problem is mostly with (1) exploding constraints and (2) strange orientation behavior.
...
Problem though is as mentioned that the swing limits seem to be disrespected. I set for example on the tail a twist limit of 10° in each direction but yet it turns
Both btConeTwistConstraint and btGeneric6DofConstraint should work fine. There should be no explosions or strange orientation behavio(u)r.

Can you export a COLLADA .dae file, generated just before the first 'stepSimulation' call?

Thanks,
Erwin
User avatar
projectileman
Posts: 109
Joined: Thu Dec 14, 2006 4:27 pm
Location: Colombia

Re: Twist-Cone vs 6-Dof... where to place your bets?

Post by projectileman »

Hi.

IMHO you should put your all your bets on btGeneric6DofConstraint. Why??
  • It's more stable. I've test them alot and also I've tested Twist-Cone alternatively. And I've found some little artifacts and jerky movements with btConeTwistConstraint, noticeable when you're taking a closer look for the falling ragdolls. With btGeneric6DofConstraint the ragdolls behave more smoothly.
  • A more clear Angular limit configuration. X can vary between -PI to PI, while Y and Z are limited to [-PI/2,PI/2]. You could be sure that your ragdolls will behave as you're expecting.
  • btGeneric6DofConstraint can do the same work as btConeTwistConstraint, and MUCH MORE. You could build robotics with Motorized joints, springs etc. through its btRotationalLimitMotor interface.
  • COLLADA have a well defined asset for 6dof constraints. No tricks are needed for adapting them.
For using btGeneric6DofConstraint correctly you should read the documentation carefully (btGeneric6DofConstraint.h file at line 180).

They are now enabled and totally functional in blender since 2.48 version.
Don't bother about previous versions (2.45-2.46 ), because those versions have an outdated version of bullet with A very buggy btGeneric6DofConstraint class.
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Re: Twist-Cone vs 6-Dof... where to place your bets?

Post by Dragonlord »

@Erwin: I'll see if I manage to get this one out.

@projectileman: Makes sense. In my engine I use only 6-Dof but map it internally to simpler types like hinge, ballsocket or slider if the setup matches ( number of locked/limited/free axes ). I'll give it a try once without the ConeTwist checking out the result.
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Re: Twist-Cone vs 6-Dof... where to place your bets?

Post by Dragonlord »

Erwin Coumans wrote:
Dragonlord wrote:The problem is mostly with (1) exploding constraints and (2) strange orientation behavior.
...
Problem though is as mentioned that the swing limits seem to be disrespected. I set for example on the tail a twist limit of 10° in each direction but yet it turns
Both btConeTwistConstraint and btGeneric6DofConstraint should work fine. There should be no explosions or strange orientation behavio(u)r.

Can you export a COLLADA .dae file, generated just before the first 'stepSimulation' call?

Thanks,
Erwin
I try to get this working but for some reason it doesn't. It fails to compile with various missing headers. I'm trying to figure out where in the tarball this is hidden but until I unwound this mess I can't make a snapshot at all.
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Re: Twist-Cone vs 6-Dof... where to place your bets?

Post by Dragonlord »

Damn this gets more and more crazy. I changed a couple of joints to be only hinge constraints which increases the stability. But since a certain point onwards ( in terms of number of number of bodies in the ragdoll ) things go crazy. The number of bodies had been 25 ( mostly capsules represented as 2-sphere-hulls and 2 boxes ) until which things went okay ( except the exploding of the cone-twist constraint ) but if I add a 26 body in the ragdoll time consumption goes through the roof. It takes suddenly up to 1s and more for calculating one step whereas with one less body it is lightning fast. I finished up the ragdoll for testing and it works until hitting the floor when it slows down to a snail and finally starts exploding. I'm a bit out of ideas right now. That COLLADA exporter doesn't work for making a snapshot. May it be a solution to simply copy out the construction I used and boil it into one of the bullet demos? Since this exporting would not require COLLADA. Would this be useful?