Need help printing text in simulation

Post Reply
KodoCoder
Posts: 10
Joined: Sat Aug 16, 2014 12:40 am

Need help printing text in simulation

Post by KodoCoder »

Hey all,

I'm trying to check if part of my program is working correctly, but I'm not sure how to print things and have them displayed during the simulation. There's text at the top of the demo I'm modifying--RagdollDemo--that starts with "Profiling : Root (total run time..." Is there any way to access that, or is there a better way to output text while looking at my simulation?

Best,
Josh
theBulletGuy
Posts: 4
Joined: Tue Apr 22, 2014 12:03 pm

Re: Need help printing text in simulation

Post by theBulletGuy »

To stop showing profile info you can either:
1) add the following line to DemoApplication.h
#define BT_NO_PROFILE
Or even better you can
2) override the function that calls showProfileInfo(..)


To print something on the screen you can use DemoApplication::displayProfileString(..):
sprintf(str,"Time: %f sec.", m_timeStamp);
displayProfileString(20, 50, str);

These two lines should be added both to
clientMoveAndDisplay(..)
and
displayCallback(..)

So you need either to edit these functions in DemoApplication.cpp or better override them.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Need help printing text in simulation

Post by Erwin Coumans »

See Demos/ForkLiftDemo: you can simply use

Code: Select all

GLDebugDrawString(xStart,yStart,text);
Upcoming Bullet 2.83 has improved graphics debugging/GUI features, in particular for OpenGL 3+ GPUs.
Thanks,
Erwin
KodoCoder
Posts: 10
Joined: Sat Aug 16, 2014 12:40 am

Re: Need help printing text in simulation

Post by KodoCoder »

Thanks for the help! I appreciate all the help I've been getting on these very basic questions.

Best,
Josh
Post Reply