I would doubt whether this is the root for this problem. If you initialize the GenericConstraint, you need to specify two rigid objects, how did you do that ?Mako_energy02 wrote:The tray is a single rigid body, but it does have a compound shape composed of a few boxes.
On the fly sticky constraint unstable.
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: On the fly sticky constraint unstable.
-
- Posts: 171
- Joined: Sun Jan 17, 2010 4:47 am
Re: On the fly sticky constraint unstable.
I get all the information for the constraint from the btPersistentManifold for the two objects. I have a somewhat complicated collision reporting system built around the construction and destruction of collision algorithms and their manifolds. Totally unrelated but that was harder to pull off then it should have been and I kinda wish that system would be improved. =\If you initialize the GenericConstraint, you need to specify two rigid objects, how did you do that ?
Anyway, when one of my collision report classes is constructed, it gets the data of the two objects from the collision algorithm/contact manifold.
-
- Posts: 52
- Joined: Mon Jul 19, 2010 3:11 am
Re: On the fly sticky constraint unstable.
If this help: this issue also happen to me, and only customized things I have are:
- world scaled by 64, so sphere with radius 64 corresponds to the sphere with radius 1 while normal usage of bullet
- simulation locked to pure 2d setLinearFactor(1,1,0) and setAnguarFactor(0,0,1)
have you done any of those things?
- world scaled by 64, so sphere with radius 64 corresponds to the sphere with radius 1 while normal usage of bullet
- simulation locked to pure 2d setLinearFactor(1,1,0) and setAnguarFactor(0,0,1)
have you done any of those things?
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: On the fly sticky constraint unstable.
Actually, I am not asking how you retrieve the collision information, but how you initialize the constraint ?Mako_energy02 wrote:I get all the information for the constraint from the btPersistentManifold for the two objects. I have a somewhat complicated collision reporting system built around the construction and destruction of collision algorithms and their manifolds. Totally unrelated but that was harder to pull off then it should have been and I kinda wish that system would be improved. =\If you initialize the GenericConstraint, you need to specify two rigid objects, how did you do that ?
Anyway, when one of my collision report classes is constructed, it gets the data of the two objects from the collision algorithm/contact manifold.
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: On the fly sticky constraint unstable.
I can understand that the second step may help avoid unnecessary collisions. But how the first one helps ?marios wrote:If this help: this issue also happen to me, and only customized things I have are:
- world scaled by 64, so sphere with radius 64 corresponds to the sphere with radius 1 while normal usage of bullet
- simulation locked to pure 2d setLinearFactor(1,1,0) and setAnguarFactor(0,0,1)
have you done any of those things?
-
- Posts: 52
- Joined: Mon Jul 19, 2010 3:11 am
Re: On the fly sticky constraint unstable.
no,no, these things are not how to avoid the problem but I think that they may cause it. So I am asking if Mako_energy02 has set any of theseDr.Shepherd wrote:I can understand that the second step may help avoid unnecessary collisions. But how the first one helps ?marios wrote:If this help: this issue also happen to me, and only customized things I have are:
- world scaled by 64, so sphere with radius 64 corresponds to the sphere with radius 1 while normal usage of bullet
- simulation locked to pure 2d setLinearFactor(1,1,0) and setAnguarFactor(0,0,1)
have you done any of those things?
-
- Posts: 171
- Joined: Sun Jan 17, 2010 4:47 am
Re: On the fly sticky constraint unstable.
Well the information in the collision is 90% of everything the constraint needs. Unless you are asking what other functions I call on to configure it...which all I call on is locking all linear and angular axes.Dr.Shepherd wrote:Actually, I am not asking how you retrieve the collision information, but how you initialize the constraint ?
Exact code:
Code: Select all
Generic6DofConstraint* NewSticky = new Generic6DofConstraint(ActorA,this,TransA,TransB);
NewSticky->SetAngularLimitLower(Vector3());
NewSticky->SetAngularLimitUpper(Vector3());
NewSticky->SetLinearLimitLower(Vector3());
NewSticky->SetLinearLimitUpper(Vector3());
I actually do both. I have my world scaled by 100 though, trying to simulate down to centimeters. And all the objects that move are locked out of moving on the Z axis(setLinearFactor(1,1,0)), but are free to rotate on all axes.marios wrote:If this help: this issue also happen to me, and only customized things I have are:
- world scaled by 64, so sphere with radius 64 corresponds to the sphere with radius 1 while normal usage of bullet
- simulation locked to pure 2d setLinearFactor(1,1,0) and setAnguarFactor(0,0,1)
have you done any of those things?
Edit: following this vein of thought I disabled the locking of the Z axis movement to see if that had an impact and it did not. Constraint is still extremely erratic and unstable with completely free movement.
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: On the fly sticky constraint unstable.
Code: Select all
Generic6DofConstraint* NewSticky = new Generic6DofConstraint(ActorA,this,TransA,TransB);
The question is that your tray is a compound shape, and it is composed of several rigidbodies (Ra, Rb, Rc). Assuming that you initialize your constraint with (Ra, Stone), even though you disable the collision detection between Ra and Stone, the collision between Rb, Rc and Stone will result in this erratic rotation.
-
- Posts: 171
- Joined: Sun Jan 17, 2010 4:47 am
Re: On the fly sticky constraint unstable.
Other way around.Dr.Shepherd wrote:Yeah, actually, this is what I asked for. I suppose "ActorA" is the green stone, and "this" is the tray ? Or the other way around ?Code: Select all
Generic6DofConstraint* NewSticky = new Generic6DofConstraint(ActorA,this,TransA,TransB);
This is very incorrect. A compound collision shape does not need or use multiple rigid bodies. It just has child collision shapes. There are only two collision objects involved in this collision whatsoever.Dr.Shepherd wrote:The question is that your tray is a compound shape, and it is composed of several rigidbodies (Ra, Rb, Rc). Assuming that you initialize your constraint with (Ra, Stone), even though you disable the collision detection between Ra and Stone, the collision between Rb, Rc and Stone will result in this erratic rotation.
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: On the fly sticky constraint unstable.
Oh, yeah, Sorry, I messed up with the notion of Collisionshapes and collisionobjects.
Emmm, then I am lost right now....
Emmm, then I am lost right now....
-
- Posts: 171
- Joined: Sun Jan 17, 2010 4:47 am
Re: On the fly sticky constraint unstable.
Regarding the setup and initialization? Or regarding the cause of the issue?Dr.Shepherd wrote:Oh, yeah, Sorry, I messed up with the notion of Collisionshapes and collisionobjects.
Emmm, then I am lost right now....
If the latter then I am right there with you. Honestly this seems to be some obscure low level thing that only Erwin can probably comment on. But he hardly checks the forums anymore.
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: On the fly sticky constraint unstable.
I mean the latter one...
We lack help from the people who wrote these codes at the earliest. It makes some problems difficult to deal with.
We lack help from the people who wrote these codes at the earliest. It makes some problems difficult to deal with.
-
- Posts: 2
- Joined: Tue Dec 20, 2011 7:46 pm
Re: On the fly sticky constraint unstable.
I've encountered what appears to be the exact same behavior in a slightly different context. In the process of experimenting with the various types of constraints, I created two identical cubes with a constraint between them as seen in figs 3, 4, and 5 of the Bullet User Manual. All the other constraints seemed to work fine, but when I tried the btGeneric6DofConstraint I ended up with a crazily colliding system like Mako described.
For example, this slider constraint behaved exactly as I expected:
While this generic6dof constraint caused the two-cube system to cartwheel wildly all over the place, constantly gaining energy:
Mako, it sounds like you could get away with a btSliderConstraint constraint with a locked linear limit; based on my observations, you might want to try that. I'd still love to know what's going wrong though.
For example, this slider constraint behaved exactly as I expected:
Code: Select all
btTransform localA, localB;
localA.setIdentity();
localB.setIdentity();
btSliderConstraint *slider = new btSliderConstraint(bodyA, bodyB, localA, localB, true);
slider->setLowerLinLimit(3.0f);
slider->setUpperLinLimit(10.0f);
slider->setLowerAngLimit(0.0f);
slider->setUpperAngLimit(0.0f);
mWorld->addConstraint(slider, true);
Code: Select all
btTransform localA, localB;
localA.setIdentity();
localB.setIdentity();
btGeneric6DofConstraint *genericConst = new btGeneric6DofConstraint(bodyA,bodyB, localA, localB,true);
genericConst->setLinearLowerLimit(btVector3(3,0,0));
genericConst->setLinearUpperLimit(btVector3(10,0,0));
genericConst->setAngularLowerLimit(btVector3(1,0,0));
genericConst->setAngularUpperLimit(btVector3(0,0,0));
mWorld->addConstraint(genericConst, true);
-
- Posts: 171
- Joined: Sun Jan 17, 2010 4:47 am
Re: On the fly sticky constraint unstable.
This was a really good idea, and I updated my code to test this...but it doesn't appear to have changed the behavior. I triple checked the modified code and even built clean because it seems unlikely that the behavior would be completely unchanged, but none of that seems to have worked. =\Demarche wrote:Mako, it sounds like you could get away with a btSliderConstraint constraint with a locked linear limit; based on my observations, you might want to try that. I'd still love to know what's going wrong though.
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: On the fly sticky constraint unstable.
Hi, in your code, I noticed that the upper limit for angular is less than the lower limit. Would you please edit these values and try again to see if that works ?Demarche wrote: While this generic6dof constraint caused the two-cube system to cartwheel wildly all over the place, constantly gaining energy:
Code: Select all
btTransform localA, localB; localA.setIdentity(); localB.setIdentity(); btGeneric6DofConstraint *genericConst = new btGeneric6DofConstraint(bodyA,bodyB, localA, localB,true); genericConst->setLinearLowerLimit(btVector3(3,0,0)); genericConst->setLinearUpperLimit(btVector3(10,0,0)); genericConst->setAngularLowerLimit(btVector3(1,0,0)); genericConst->setAngularUpperLimit(btVector3(0,0,0)); mWorld->addConstraint(genericConst, true);
Cheers !