Constraint->setDbgDrawSize(float Size)

User avatar
Dr.Shepherd
Posts: 168
Joined: Tue Jan 04, 2011 11:47 pm

Constraint->setDbgDrawSize(float Size)

Post by Dr.Shepherd »

Could Anyone explain a bit on this function, I searched among the forum and documentation, but didn't find anything.

Thanks for help !
User avatar
Dr.Shepherd
Posts: 168
Joined: Tue Jan 04, 2011 11:47 pm

Re: Constraint->setDbgDrawSize(float Size)

Post by Dr.Shepherd »

Just to be more clear

What I found, is that, when adding this line, some lines will be visible, such as coordinate of the constraint and the limit. These information helps us get a better understanding of the constraint, for example, if the body hits the limits. when I omit this line, the information is gone and the constraint becomes "invisible".

Except for this, is there any other sense for this function? And what does the parameter mean ?

Cheers !
Bigpet
Posts: 10
Joined: Fri Oct 28, 2011 5:14 am

Re: Constraint->setDbgDrawSize(float Size)

Post by Bigpet »

well like the name suggests this is a scaling factor for the debug draw size. So if you have DBG_DrawConstraints enabled on your debug drawer it draws a representation of the constraint. It's just that this value doesn't get initialized in most constraints so it stays 0 and you can't see it unless you increase the value.

I think that this value should be 1 by default.

They actually get drawn by the btDynamicsWorld but only if these conditions are met:

Code: Select all

00906 void btDiscreteDynamicsWorld::debugDrawConstraint(btTypedConstraint* constraint)
00907 {
00908         bool drawFrames = (getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawConstraints) != 0;
00909         bool drawLimits = (getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawConstraintLimits) != 0;
00910         btScalar dbgDrawSize = constraint->getDbgDrawSize();
00911         if(dbgDrawSize <= btScalar(0.f))
00912         {
00913                 return;
00914         }
that's why you have to set the dbgDrawSize
User avatar
Dr.Shepherd
Posts: 168
Joined: Tue Jan 04, 2011 11:47 pm

Re: Constraint->setDbgDrawSize(float Size)

Post by Dr.Shepherd »

Hi, Thank you for your reply and hints, then I look at the code and suppose the Size means the size of the representation of the constraints. Let's see two examples.

Size=5:
1.png
Size=10:
2.png
You do not have the required permissions to view the files attached to this post.