Debugging values in C
by James Laker (BurNinG) · in Torque Game Engine · 02/27/2006 (11:09 pm) · 5 replies
How do I print values from C++ to the screen?
I've tried Con::printf("bx : %d",bx);... and that prints it to console with strange results.
Values in the millions?? Isn't it suppose to be float values?
eg. in void WheeledVehicle::updateForces(F32 dt)
I'm trying to see what the values are for bx,by,bz
Any help appreciated...
EDIT: I've seen screenshots where it is printed on the screen without having to go to the console...
I've tried Con::printf("bx : %d",bx);... and that prints it to console with strange results.
Values in the millions?? Isn't it suppose to be float values?
eg. in void WheeledVehicle::updateForces(F32 dt)
I'm trying to see what the values are for bx,by,bz
Point3F bx,by,bz; currMatrix.getColumn(0,&bx); currMatrix.getColumn(1,&by); currMatrix.getColumn(2,&bz);
Any help appreciated...
EDIT: I've seen screenshots where it is printed on the screen without having to go to the console...
#2
So am I right when I say it's suppose to be a float?
02/27/2006 (11:16 pm)
Thanx for the quick reply...So am I right when I say it's suppose to be a float?
#3
bx is a Point3F which basically consists of x, y, and z float values.
Hope it helps.
-Jase
02/28/2006 (12:07 am)
Con::printf("bx: %f %f %f", bx.x, bx.y, bx.z);bx is a Point3F which basically consists of x, y, and z float values.
Hope it helps.
-Jase
#4
Is there a way to get this onscreen and not in the console?
02/28/2006 (12:09 am)
Cool now that makes sense...Is there a way to get this onscreen and not in the console?
#5
02/28/2006 (1:21 am)
You could create a textbox compent for the gui, then set its value through C
Torque 3D Owner Stephen Zepp
If you want to display a float variable, use %f.